All Products
Search
Document Center

Alibaba Cloud Model Studio:Qwen Code

Last Updated:Apr 30, 2026

Qwen Code is an AI coding assistant. This topic describes how to configure and use Alibaba Cloud Model Studio Token Plan Team Edition in Qwen Code (CLI and IDE plugin).

Installation and usage

Install Qwen Code

  • Run the installation command

    • macOS/Linux:

      Press Command + Space on your keyboard, type "Terminal" in the search box, and press Enter. After opening the terminal, run the following command to install Qwen Code.

      bash -c "$(curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.sh)" -s --source bailian
    • Windows:

      Type cmd in the taskbar search box, select Run as administrator, and run the following command in the cmd window to install Qwen Code.

      curl -fsSL -o %TEMP%\install-qwen.bat https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.bat && %TEMP%\install-qwen.bat --source bailian
  • Close and reopen the cmd window

    On Windows, after the installation is complete, close the current cmd window for the environment variables to take effect. After reopening cmd, run the following command to check the installed version.

    qwen --version

Configure and use Qwen Code

Manual configuration

Edit or create the settings.json file and replace YOUR_API_KEY with the Token Plan Team Edition API Key. The file path is as follows:

  • macOS/Linux: ~/.qwen/settings.json

  • Windows: C:\Users\<Windows username>\.qwen\settings.json

{
  "env": {
    "BAILIAN_TOKEN_PLAN_API_KEY": "YOUR_API_KEY"
  },
  "modelProviders": {
    "openai": [
      {
        "id": "qwen3.6-plus",
        "name": "[Token Plan Team Edition] qwen3.6-plus",
        "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
        "envKey": "BAILIAN_TOKEN_PLAN_API_KEY",
        "generationConfig": {
          "extra_body": {
            "enable_thinking": true
          }
        }
      },
      {
        "id": "glm-5",
        "name": "[Token Plan Team Edition] glm-5",
        "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
        "envKey": "BAILIAN_TOKEN_PLAN_API_KEY",
        "generationConfig": {
          "extra_body": {
            "enable_thinking": true
          }
        }
      },
      {
        "id": "MiniMax-M2.5",
        "name": "[Token Plan Team Edition] MiniMax-M2.5",
        "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
        "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
      },
      {
        "id": "deepseek-v3.2",
        "name": "[Token Plan Team Edition] deepseek-v3.2",
        "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
        "envKey": "BAILIAN_TOKEN_PLAN_API_KEY",
        "generationConfig": {
          "extra_body": {
            "enable_thinking": true
          }
        }
      }
    ]
  },
  "security": {
    "auth": {
      "selectedType": "openai"
    }
  },
  "tokenPlan": {
    "region": "global"
  },
  "model": {
    "name": "qwen3.6-plus"
  },
  "$version": 3
}

After configuration, run the following command in your project directory to start Qwen Code and begin chatting.

qwen

Common commands

Note

The following commands apply to Qwen Code CLI. The IDE plugin only supports some of these commands. Refer to the actual usage for details.

Command

Description

Example

/model

Switch the model used in the current session.

/model

/auth

Change the authentication method.

/auth

/init

Analyze the current directory and create an initial context file (QWEN.md) to define project-level instructions and context.

/init

/clear

Clear the terminal screen and start a new conversation.

/clear

/compress

Replace the chat history with a summary to save tokens.

/compress

/settings

Open the settings editor to configure language, theme, and more.

/settings

/summary

Generate a project summary based on the conversation history.

/summary

/resume

Resume a previous conversation session.

/resume

/stats

Display detailed statistics for the current session.

/stats

/help

Display help information for available commands.

/help or /?

/quit

Exit Qwen Code.

/quit

For more advanced features of Qwen Code, refer to the Qwen Code official documentation.

Switch models (optional)

Enter /model to switch between models supported by Alibaba Cloud Model Studio Token Plan Team Edition.

If the required model (such as qwen3.6-plus, MiniMax-M2.5, or glm-5) does not appear in the list, update Qwen Code.

  1. Enter /quit to exit the current session.

  2. Run the npm install -g @qwen-code/qwen-code@latest command to update Qwen Code.

  3. Run the qwen command again to start Qwen Code.

  4. Enter /model again to select the newly added model.

Use Qwen Code IDE plugin (optional)

Qwen Code supports use as a plugin in VS Code and JetBrains IDE, providing AI coding capabilities within the IDE.

VS Code IDE

Before use, make sure your VS Code version is 1.85.0 or later.

  1. Open VS Code and search for Qwen Code Companion in the Extensions Marketplace, then install it.2026-02-26_19-30-08

  2. Edit or create the settings.json file with the following content. Replace YOUR_API_KEY with the Token Plan Team Edition API Key. The file path is as follows:

    • macOS/Linux: ~/.qwen/settings.json

    • Windows: C:\Users\<Windows username>\.qwen\settings.json

    The CLI and IDE plugin share the same settings.json. If you have already completed the configuration above, skip this step.
    {
      "env": {
        "BAILIAN_TOKEN_PLAN_API_KEY": "YOUR_API_KEY"
      },
      "modelProviders": {
        "openai": [
          {
            "id": "qwen3.6-plus",
            "name": "[Token Plan Team Edition] qwen3.6-plus",
            "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
            "envKey": "BAILIAN_TOKEN_PLAN_API_KEY",
            "generationConfig": {
              "extra_body": {
                "enable_thinking": true
              }
            }
          },
          {
            "id": "glm-5",
            "name": "[Token Plan Team Edition] glm-5",
            "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
            "envKey": "BAILIAN_TOKEN_PLAN_API_KEY",
            "generationConfig": {
              "extra_body": {
                "enable_thinking": true
              }
            }
          },
          {
            "id": "MiniMax-M2.5",
            "name": "[Token Plan Team Edition] MiniMax-M2.5",
            "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
            "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
          },
          {
            "id": "deepseek-v3.2",
            "name": "[Token Plan Team Edition] deepseek-v3.2",
            "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
            "envKey": "BAILIAN_TOKEN_PLAN_API_KEY",
            "generationConfig": {
              "extra_body": {
                "enable_thinking": true
              }
            }
          }
        ]
      },
      "security": {
        "auth": {
          "selectedType": "openai"
        }
      },
      "tokenPlan": {
        "region": "global"
      },
      "model": {
        "name": "qwen3.6-plus"
      },
      "$version": 3
    }
  3. Click the icon in the upper-right corner to start Qwen Code. Type or click /, and select Switch model to switch models.

    2026-02-27_10-38-30

JetBrains IDE

Before use, make sure your JetBrains IDE supports Agent Client Protocol (ACP).

  1. Qwen Code IDE depends on Qwen Code CLI. First refer to the Installation and usage section in this topic to install and configure Token Plan Team Edition.

  2. Open JetBrains IDE, go to the AI Chat page, and click Install Plugin. IDEA will install the JetBrains AI Assistant plugin.

    image

  3. Click the three-dot menu in the upper-right corner of the AI Chat window and select Add Custom Agent. Fill in the configuration as follows. Replace /path/to/qwen with the Qwen Code installation path. You can run the following command to find the path:

    • macOS/Linux: which qwen

    • Windows: where qwen (CMD) or Get-Command qwen (PowerShell)

    {
      "agent_servers": {
        "qwen": {
          "command": "/path/to/qwen",
          "args": ["--acp"],
          "env": {}
        }
      }
    }
  4. After configuration, Qwen Code will appear in the AI Chat panel. You can switch models in the lower-right corner.

    2026-02-27_09-52-59

Learn more

Error codes

For more information, see FAQ.

FAQ

For more information, see FAQ.