-
Notifications
You must be signed in to change notification settings - Fork 3k
docs: fix config/command/auth drift and surface the model-providers page #5735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,14 @@ | ||
| # Authentication | ||
|
|
||
| Qwen Code supports three authentication methods. Pick the one that matches how you want to run the CLI: | ||
| Qwen Code's first-run `/auth` menu has three top-level options. Pick the one that matches how you want to run the CLI: | ||
|
|
||
| - **Qwen OAuth**: sign in with your `qwen.ai` account in a browser. **Free tier discontinued on 2026-04-15** — switch to another method. | ||
| - **Alibaba Cloud Coding Plan**: use an API key from Alibaba Cloud. Paid subscription with diverse model options and higher quotas. | ||
| - **API Key**: bring your own API key. Flexible to your own needs — supports OpenAI, Anthropic, Gemini, and other compatible endpoints. | ||
| - **Alibaba ModelStudio**: official recommended setup. Opens a sub-menu with **Coding Plan** (for individual developers · weekly quota included), **Token Plan** (for teams and companies · usage-based billing with a dedicated endpoint), or **Standard API Key** (connect with an existing ModelStudio API key). | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] The intro was rewritten to describe the three current
Suggested fix: drop the — qwen3.7-max via Qwen Code /review
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed the intro (new menu taxonomy: Alibaba ModelStudio / Third-party Providers / Custom Provider) and the body's |
||
| - **Third-party Providers**: choose a built-in provider and connect with an API key (DeepSeek, MiniMax, Z.AI, Idealab, ModelScope, OpenRouter, Requesty). | ||
| - **Custom Provider**: manually connect a local server, proxy, or unsupported provider — supports OpenAI, Anthropic, Gemini, and other compatible endpoints. | ||
|
|
||
| > [!note] | ||
| > | ||
| > **Qwen OAuth** is no longer a selectable dialog entry — its free tier was discontinued on 2026-04-15. It remains documented below as a hard-coded, discontinued provider only. | ||
|
|
||
| ## Option 1: Qwen OAuth (Discontinued) | ||
|
|
||
|
|
@@ -23,7 +27,7 @@ Start the CLI and follow the browser flow: | |
| qwen | ||
| ``` | ||
|
|
||
| Then run `/auth` and choose the OAuth provider from the interactive dialog. | ||
| Qwen OAuth is no longer offered as a selectable entry in the `/auth` dialog; run `/auth` and choose one of the current options (Alibaba ModelStudio, Third-party Providers, or Custom Provider) instead. | ||
|
|
||
| > [!note] | ||
| > | ||
|
|
@@ -48,7 +52,7 @@ Alibaba Cloud Coding Plan is available in two regions: | |
|
|
||
| ### Interactive setup | ||
|
|
||
| Enter `qwen` in the terminal to launch Qwen Code, then run the `/auth` command and select **Alibaba Cloud Coding Plan**. Choose your region, then enter your `sk-sp-xxxxxxxxx` key. | ||
| Enter `qwen` in the terminal to launch Qwen Code, then run the `/auth` command, select **Alibaba ModelStudio**, and choose **Coding Plan** from the sub-menu. Choose your region, then enter your `sk-sp-xxxxxxxxx` key. | ||
|
|
||
| After authentication, use the `/model` command to switch between all Alibaba Cloud Coding Plan supported models (including qwen3.5-plus, qwen3.6-plus, qwen3.7-plus, qwen3-coder-plus, qwen3-coder-next, qwen3-max-2026-01-23, glm-5, glm-4.7, kimi-k2.5, and MiniMax-M2.5). | ||
|
|
||
|
|
@@ -71,15 +75,18 @@ If you prefer to skip the interactive `/auth` flow, add the following to `~/.qwe | |
| ```json | ||
| { | ||
| "modelProviders": { | ||
| "openai": [ | ||
| { | ||
| "id": "qwen3-coder-plus", | ||
| "name": "qwen3-coder-plus (Coding Plan)", | ||
| "baseUrl": "https://coding.dashscope.aliyuncs.com/v1", | ||
| "description": "qwen3-coder-plus from Alibaba Cloud Coding Plan", | ||
| "envKey": "BAILIAN_CODING_PLAN_API_KEY" | ||
| } | ||
| ] | ||
| "openai": { | ||
| "protocol": "openai", | ||
| "models": [ | ||
| { | ||
| "id": "qwen3-coder-plus", | ||
| "name": "qwen3-coder-plus (Coding Plan)", | ||
| "baseUrl": "https://coding.dashscope.aliyuncs.com/v1", | ||
| "description": "qwen3-coder-plus from Alibaba Cloud Coding Plan", | ||
| "envKey": "BAILIAN_CODING_PLAN_API_KEY" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "env": { | ||
| "BAILIAN_CODING_PLAN_API_KEY": "sk-sp-xxxxxxxxx" | ||
|
|
@@ -110,15 +117,18 @@ The simplest way to get started with API Key authentication is to put everything | |
| ```json | ||
| { | ||
| "modelProviders": { | ||
| "openai": [ | ||
| { | ||
| "id": "qwen3-coder-plus", | ||
| "name": "qwen3-coder-plus", | ||
| "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1", | ||
| "description": "Qwen3-Coder via Dashscope", | ||
| "envKey": "DASHSCOPE_API_KEY" | ||
| } | ||
| ] | ||
| "openai": { | ||
| "protocol": "openai", | ||
| "models": [ | ||
| { | ||
| "id": "qwen3-coder-plus", | ||
| "name": "qwen3-coder-plus", | ||
| "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1", | ||
| "description": "Qwen3-Coder via Dashscope", | ||
| "envKey": "DASHSCOPE_API_KEY" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "env": { | ||
| "DASHSCOPE_API_KEY": "sk-xxxxxxxxxxxxx" | ||
|
|
@@ -158,10 +168,11 @@ The key concept is **Model Providers** (`modelProviders`): Qwen Code supports mu | |
| | OpenAI-compatible | `openai` | `OPENAI_API_KEY`, `OPENAI_BASE_URL`, `OPENAI_MODEL` | OpenAI, Azure OpenAI, OpenRouter, Requesty, ModelScope, Alibaba Cloud, any OpenAI-compatible endpoint | | ||
| | Anthropic | `anthropic` | `ANTHROPIC_API_KEY`, `ANTHROPIC_BASE_URL`, `ANTHROPIC_MODEL` | Anthropic Claude | | ||
| | Google GenAI | `gemini` | `GEMINI_API_KEY`, `GEMINI_MODEL` | Google Gemini | | ||
| | Vertex AI | `vertex-ai` | `GOOGLE_API_KEY`, `GOOGLE_MODEL` (sets `GOOGLE_GENAI_USE_VERTEXAI=true`; uses the `gemini` protocol) | Google Vertex AI | | ||
|
|
||
| #### Step 1: Configure models and providers in `~/.qwen/settings.json` | ||
|
|
||
| Define which models are available for each protocol. Each model entry requires at minimum an `id` and an `envKey` (the environment variable name that holds your API key). | ||
| Define which models are available for each protocol. Each model entry requires at minimum an `id`; `envKey` (the environment variable name that holds your API key) is optional and recommended — when omitted, it falls back to the auth type's default env key (e.g. `OPENAI_API_KEY` for `openai`). | ||
|
|
||
| > [!important] | ||
| > | ||
|
|
@@ -172,28 +183,37 @@ Edit `~/.qwen/settings.json` (create it if it doesn't exist). You can mix multip | |
| ```json | ||
| { | ||
| "modelProviders": { | ||
| "openai": [ | ||
| { | ||
| "id": "gpt-4o", | ||
| "name": "GPT-4o", | ||
| "envKey": "OPENAI_API_KEY", | ||
| "baseUrl": "https://api.openai.com/v1" | ||
| } | ||
| ], | ||
| "anthropic": [ | ||
| { | ||
| "id": "claude-sonnet-4-20250514", | ||
| "name": "Claude Sonnet 4", | ||
| "envKey": "ANTHROPIC_API_KEY" | ||
| } | ||
| ], | ||
| "gemini": [ | ||
| { | ||
| "id": "gemini-2.5-pro", | ||
| "name": "Gemini 2.5 Pro", | ||
| "envKey": "GEMINI_API_KEY" | ||
| } | ||
| ] | ||
| "openai": { | ||
| "protocol": "openai", | ||
| "models": [ | ||
| { | ||
| "id": "gpt-4o", | ||
| "name": "GPT-4o", | ||
| "envKey": "OPENAI_API_KEY", | ||
| "baseUrl": "https://api.openai.com/v1" | ||
| } | ||
| ] | ||
| }, | ||
| "anthropic": { | ||
| "protocol": "anthropic", | ||
| "models": [ | ||
| { | ||
| "id": "claude-sonnet-4-20250514", | ||
| "name": "Claude Sonnet 4", | ||
| "envKey": "ANTHROPIC_API_KEY" | ||
| } | ||
| ] | ||
| }, | ||
| "gemini": { | ||
| "protocol": "gemini", | ||
| "models": [ | ||
| { | ||
| "id": "gemini-2.5-pro", | ||
| "name": "Gemini 2.5 Pro", | ||
| "envKey": "GEMINI_API_KEY" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
@@ -208,7 +228,7 @@ Edit `~/.qwen/settings.json` (create it if it doesn't exist). You can mix multip | |
| | ------------------ | -------- | -------------------------------------------------------------------- | | ||
| | `id` | Yes | Model ID sent to the API (e.g. `gpt-4o`, `claude-sonnet-4-20250514`) | | ||
| | `name` | No | Display name in the `/model` picker (defaults to `id`) | | ||
| | `envKey` | Yes | Environment variable name for the API key (e.g. `OPENAI_API_KEY`) | | ||
| | `envKey` | No | Environment variable name for the API key (e.g. `OPENAI_API_KEY`); optional/recommended — defaults to the auth type's default env key when omitted | | ||
| | `baseUrl` | No | API endpoint override (useful for proxies or custom endpoints) | | ||
| | `generationConfig` | No | Fine-tune `timeout`, `maxRetries`, `samplingParams`, etc. | | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping