Skip to content

Configuration

The gateway requires an Authorization: Bearer <token> header on all requests (except /health). For full details on how gateway auth and provider auth work, see the Authentication guide.

VariableDefaultDescription
LLMG_PORT8080Server port
LLMG_HOST0.0.0.0Bind address
LLMG_LOG_LEVELinfoLog level (error, warn, info, debug, trace)
LLMG_CORSfalseEnable CORS headers for browser clients

Set the API key environment variable for each provider you want to use. The gateway auto-discovers providers based on which keys are present.

VariableProvider
OPENAI_API_KEYOpenAI
ANTHROPIC_API_KEYAnthropic
GROQ_API_KEYGroq
MISTRAL_API_KEYMistral
COHERE_API_KEYCohere
DEEPSEEK_API_KEYDeepSeek
OPENROUTER_API_KEYOpenRouter
XAI_API_KEYxAI (Grok)
AZURE_OPENAI_API_KEYAzure OpenAI
Z_AI_API_KEYZ.AI (GLM)

See the full provider list for all supported environment variables.

You can optionally create an llmg.toml:

[server]
port = 8080
host = "0.0.0.0"
timeout = 60
cors = true
[providers.openai]
enabled = true
api_key = "${OPENAI_API_KEY}"
default_model = "gpt-4"
[aliases]
gpt-4 = "openai/gpt-4"
claude = "anthropic/claude-sonnet-4-20250514"

The gateway supports short aliases that map to full provider/model paths. Built-in aliases include:

AliasMaps To
gpt-4openai/gpt-4
claudeanthropic/claude-sonnet-4-20250514
geminiantigravity/gemini-2.0-flash
llamameta_llama/llama-3.1-70b-instruct
mistralmistral/mistral-large
deepseekdeepseek/deepseek-chat
groqgroq/llama3-70b-8192