Qwen Code supports multiple AI model providers through a unifiedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/QwenLM/qwen-code/llms.txt
Use this file to discover all available pages before exploring further.
modelProviders configuration in settings.json.
Overview
Model providers are configured by authentication type (protocol), with each type supporting multiple models:Supported Providers
OpenAI-Compatible
Theopenai protocol supports any OpenAI-compatible API, including:
- Alibaba Cloud DashScope (Qwen models)
- OpenAI (GPT models)
- OpenRouter (multiple providers)
- ModelScope
- Custom OpenAI-compatible endpoints
Anthropic
Supports Claude models through the Anthropic API.Google GenAI
Supports Gemini models through the Google Generative AI API.Vertex AI
Supports models through Google Cloud Vertex AI.Model Configuration Schema
Each model configuration has the following structure:The model ID sent to the API (e.g.,
qwen3-coder-plus, gpt-4o, claude-sonnet-4-20250514).Display name shown in the UI and model selector.
The name of the environment variable that holds your API key.Common values:
DASHSCOPE_API_KEYfor Alibaba CloudOPENAI_API_KEYfor OpenAIANTHROPIC_API_KEYfor AnthropicGEMINI_API_KEYfor Google Gemini
The API endpoint URL. Required for non-default endpoints.Examples:
https://dashscope.aliyuncs.com/compatible-mode/v1(DashScope)https://api.openai.com/v1(OpenAI)https://coding.dashscope.aliyuncs.com/v1(Bailian Coding Plan)
Optional description of the model shown in the UI.
Model-specific generation configuration.
Additional parameters passed to the API request body.Example for enabling thinking mode:
Request timeout in milliseconds.
Maximum number of retries for failed requests.
Configuration Examples
Qwen Models (DashScope)
Alibaba Cloud Bailian Coding Plan
The Coding Plan provides fixed monthly pricing with higher quotas and access to multiple models:Subscribe to the Coding Plan and get your API key at Alibaba Cloud Bailian.
OpenAI Models
Anthropic Claude
Google Gemini
Multiple Providers
You can configure multiple providers and switch between them using the/model command:
Switching Models
Once configured, you can switch models in several ways:Using the /model Command
In an interactive session:
Using the --model Flag
Setting Default in Settings
Authentication Type
Thesecurity.auth.selectedType determines which API protocol to use:
Available Auth Types
openai- OpenAI-compatible APIs (DashScope, OpenAI, OpenRouter, etc.)anthropic- Anthropic Claude APIgemini- Google Generative AIvertex-ai- Google Cloud Vertex AIqwen-oauth- Qwen OAuth (free tier, no API key needed)
Environment Variables
API keys can be provided in three ways (in order of priority):-
System/Shell environment variables (highest priority)
-
.envfiles (see Environment Variables) -
settings.json→envfield (lowest priority)
Best Practices
-
Store API keys securely: Use
.envfiles or system environment variables instead of committing them tosettings.json. - Use descriptive names: Give your models clear, distinguishable names to make switching easier.
-
Set a default model: Configure
model.nameto set your preferred default. - Organize by use case: You can configure the same model multiple times with different settings (e.g., with/without thinking mode).
-
Document custom endpoints: Use the
descriptionfield to note what each model configuration is for.
Troubleshooting
”Missing API key” Error
Ensure your API key environment variable is set:Model Not Available
Verify:- The model
idmatches what the provider expects - The
baseUrlis correct for your provider - The
envKeymatches your environment variable name - The
security.auth.selectedTypematches the provider protocol
