Configuration
Authentication
Section titled “Authentication”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.
Environment Variables
Section titled “Environment Variables”Server
Section titled “Server”| Variable | Default | Description |
|---|---|---|
LLMG_PORT | 8080 | Server port |
LLMG_HOST | 0.0.0.0 | Bind address |
LLMG_LOG_LEVEL | info | Log level (error, warn, info, debug, trace) |
LLMG_CORS | false | Enable CORS headers for browser clients |
Provider API Keys
Section titled “Provider API Keys”Set the API key environment variable for each provider you want to use. The gateway auto-discovers providers based on which keys are present.
| Variable | Provider |
|---|---|
OPENAI_API_KEY | OpenAI |
ANTHROPIC_API_KEY | Anthropic |
GROQ_API_KEY | Groq |
MISTRAL_API_KEY | Mistral |
COHERE_API_KEY | Cohere |
DEEPSEEK_API_KEY | DeepSeek |
OPENROUTER_API_KEY | OpenRouter |
XAI_API_KEY | xAI (Grok) |
AZURE_OPENAI_API_KEY | Azure OpenAI |
Z_AI_API_KEY | Z.AI (GLM) |
See the full provider list for all supported environment variables.
Config File
Section titled “Config File”You can optionally create an llmg.toml:
[server]port = 8080host = "0.0.0.0"timeout = 60cors = true
[providers.openai]enabled = trueapi_key = "${OPENAI_API_KEY}"default_model = "gpt-4"
[aliases]gpt-4 = "openai/gpt-4"claude = "anthropic/claude-sonnet-4-20250514"Model Aliases
Section titled “Model Aliases”The gateway supports short aliases that map to full provider/model paths. Built-in aliases include:
| Alias | Maps To |
|---|---|
gpt-4 | openai/gpt-4 |
claude | anthropic/claude-sonnet-4-20250514 |
gemini | antigravity/gemini-2.0-flash |
llama | meta_llama/llama-3.1-70b-instruct |
mistral | mistral/mistral-large |
deepseek | deepseek/deepseek-chat |
groq | groq/llama3-70b-8192 |