Connect Qwen Code to go-llm-proxy to use your self-hosted or third-party models.
Use the built-in config generator (--serve-config-generator). Select Qwen Code from the dropdown, choose a default model and any additional models, and generate a settings.json config file.
Qwen Code supports multiple model providers with both OpenAI and Anthropic protocols. The proxy is configured as a provider with per-model entries. Qwen Code's /model command lets users switch between available models at runtime.
Save as ~/.qwen/settings.json:
{
"$version": 3,
"model": { "name": "MiniMax-M2.5" },
"security": { "auth": { "selectedType": "openai" } },
"modelProviders": {
"openai": [
{
"id": "MiniMax-M2.5",
"name": "MiniMax M2.5",
"envKey": "PROXY_API_KEY",
"baseUrl": "https://your-proxy.example.com/v1",
"generationConfig": { "timeout": 300000, "maxRetries": 1 }
},
{
"id": "qwen-3.5",
"name": "Qwen 3.5",
"envKey": "PROXY_API_KEY",
"baseUrl": "https://your-proxy.example.com/v1",
"generationConfig": { "timeout": 300000, "maxRetries": 1 }
}
],
"anthropic": [
{
"id": "claude-sonnet-4-20250514",
"name": "Claude Sonnet 4",
"envKey": "PROXY_API_KEY",
"baseUrl": "https://your-proxy.example.com/anthropic",
"generationConfig": { "timeout": 300000, "maxRetries": 1 }
}
]
},
"env": {
"PROXY_API_KEY": "your-proxy-api-key"
}
}| Field | Purpose |
|---|---|
model.name |
Default model on startup |
security.auth.selectedType |
Auth protocol for the default model ("openai" or "anthropic") |
modelProviders.openai[] |
Models using OpenAI protocol (base URL ends with /v1) |
modelProviders.anthropic[] |
Models using Anthropic protocol (base URL ends with /anthropic) |
env.PROXY_API_KEY |
Your proxy API key (referenced by envKey on each model) |
Models are grouped by protocol:
- OpenAI models go in
modelProviders.openaiwithbaseUrlpointing to/v1 - Anthropic models go in
modelProviders.anthropicwithbaseUrlpointing to/anthropic
The config generator handles this automatically based on each model's protocol.
After launching Qwen Code, use the /model command to switch between configured models at runtime. All models listed in modelProviders are available.
The config generator optionally includes Tavily web search:
{
"webSearch": {
"provider": [{ "type": "tavily", "apiKey": "tvly-your-key" }],
"default": "tavily"
}
}mkdir -p ~/.qwen
# Save generated settings.json to ~/.qwen/settings.jsonmkdir %USERPROFILE%\.qwen
REM Save generated settings.json to %USERPROFILE%\.qwen\settings.json