# Qwen Code

> Use Alibaba Cloud Model Studio models in Qwen Code.

<meta property="og:title" content="Qwen Code" />

<style>/\* Numbered procedures with authored labels and no document JavaScript. \*/ .rkb-steps \{   --rkb-steps-marker-bg: var(--adoc-color-bg-secondary, #eaf3ff);   --rkb-steps-marker-color: var(--adoc-color-primary, #1677ff);   --rkb-steps-line: var(--adoc-color-border, #e4e7ec);   --rkb-steps-scroll-top: calc(var(--topbar-height, 112px) + 16px);   margin: 24px 0;   /\* Both themes add ordered-list indentation; the marker has its own column. \*/   padding: 0 !important;   list-style: none;   color: inherit;   font-family: inherit; }  .rkb-steps > .rkb-step \{   position: relative;   display: grid;   grid-template-columns: 28px minmax(0, 1fr);   column-gap: 16px;   margin: 0;   padding: 0 0 28px;   min-width: 0;   list-style: none; } .rkb-steps > .rkb-step::marker \{ content: ""; } .rkb-steps > .rkb-step::before \{   content: "";   position: absolute;   top: 36px;   bottom: 8px;   inset-inline-start: 13.5px;   width: 1px;   background: var(--rkb-steps-line); } .rkb-steps > .rkb-step:last-child \{ padding-bottom: 0; } .rkb-steps > .rkb-step:last-child::before \{ display: none; } .rkb-steps > .rkb-step > .rkb-step-number \{   position: relative;   box-sizing: border-box;   display: flex;   align-items: center;   justify-content: center;   align-self: start;   min-width: 28px;   min-height: 28px;   margin: 0;   padding: 3px;   border-radius: 50%;   background: var(--rkb-steps-marker-bg);   color: var(--rkb-steps-marker-color);   font-family: inherit;   font-size: 12px;   font-weight: 600;   line-height: 22px;   overflow-wrap: anywhere; } .rkb-steps > .rkb-step > .rkb-step-content \{   min-width: 0;   margin: 0;   padding: 0;   overflow-wrap: anywhere; } .rkb-step-content > .rkb-step-title, .rkb-steps > .rkb-step > .rkb-step-content > :is(h2, h3, h4):first-child \{   margin: 0 0 10px;   padding: 1px 0 0;   border: 0;   color: inherit;   font-size: 16px;   font-weight: 600;   line-height: 26px;   scroll-margin-top: var(--rkb-steps-scroll-top); } .rkb-step-content > h2.rkb-step-title, .rkb-steps > .rkb-step > .rkb-step-content > h2:first-child \{ font-size: 22px; line-height: 30px; } .rkb-step-content > h3.rkb-step-title, .rkb-steps > .rkb-step > .rkb-step-content > h3:first-child \{ font-size: 18px; line-height: 28px; } .rkb-step-content > h4.rkb-step-title, .rkb-steps > .rkb-step > .rkb-step-content > h4:first-child \{ font-size: 16px; line-height: 26px; } .rkb-step-content > p, .rkb-step-content > \[data-as="p"] \{   margin-block: 10px; } .rkb-step-content > \[data-as="p"] \{ display: block; } .rkb-step-content > .rkb-step-title:first-child \{ margin-top: 0; } .rkb-step-content > :last-child \{ margin-bottom: 0; } .rkb-step-content pre \{ max-width: 100%; overflow: auto; } .rkb-step-content > .rkb-steps \{ margin-block: 16px; }  /\* Keep native step gaps independent of prose list and trailing paragraph margins. \*/ .mdx-content .prose .rkb-steps > .rkb-step \{   margin: 0;   padding-bottom: 24px; } .mdx-content .prose .rkb-steps > .rkb-step:last-child \{ padding-bottom: 0; } .mdx-content .prose .rkb-steps > .rkb-step > .rkb-step-content > :last-child, .mdx-content .prose .rkb-steps > .rkb-step > .rkb-step-content > blockquote:last-child > :is(p, \[data-as="p"]):last-child \{   margin-bottom: 0; }  /\* Portal list and content margins must not accumulate between steps. \*/ .markdown-body .rkb-steps > .rkb-step \{   margin: 0;   padding-bottom: 20px; } .markdown-body .rkb-steps > .rkb-step:last-child \{ padding-bottom: 0; } .markdown-body .rkb-steps > .rkb-step > .rkb-step-content > :last-child \{   margin-bottom: 0; }  @media (max-width: 600px) \{   .rkb-steps > .rkb-step \{ column-gap: 12px; } } @media print \{   .rkb-steps \{     --rkb-steps-marker-color: #222;     --rkb-steps-line: #aaa;     color: #222;   }   .rkb-steps > .rkb-step > .rkb-step-number \{     border: 1px solid currentColor;     background: transparent;   } }</style>

## Quick Start <span id="qc-quickstart-h" />

Choose your client and complete the configuration.

<Tabs>
  <Tab title="CLI">
    <ol className="rkb-steps">
      <li className="rkb-step" value={1}>
        <span className="rkb-step-number">1</span>

        <div className="rkb-step-content">
          <p className="rkb-step-title">Connect the provider</p>

          Run `qwen`, select **Alibaba ModelStudio** on first use, and then select a billing plan when prompted.
        </div>
      </li>

      <li className="rkb-step" value={2}>
        <span className="rkb-step-number">2</span>

        <div className="rkb-step-content">
          <p className="rkb-step-title">Select a region</p>

          Select **Singapore** as the region.
        </div>
      </li>

      <li className="rkb-step" value={3}>
        <span className="rkb-step-number">3</span>

        <div className="rkb-step-content">
          <p className="rkb-step-title">Enter the API key</p>

          <Tabs>
            <Tab title="Token Plan">
              Use a Token Plan API key:

              - Token Plan Personal Edition: [Create or view API Key](https://modelstudio.console.alibabacloud.com/subscription/token-plan/personal)
              - Token Plan Team Edition: [Assign a seat and get the API Key](https://modelstudio.console.alibabacloud.com/subscription/uac-admin/organization/members/list)
            </Tab>

            <Tab title="Pay-as-you-go">
              Use a Model Studio API key from the [console](/help/en/model-studio/get-api-key).
            </Tab>

            <Tab title="Coding Plan">
              Use a Coding Plan API key from the [console](https://modelstudio.console.alibabacloud.com/ap-southeast-1/subscription/coding-plan).
            </Tab>
          </Tabs>
        </div>
      </li>

      <li className="rkb-step" value={4}>
        <span className="rkb-step-number">4</span>

        <div className="rkb-step-content">
          <p className="rkb-step-title">Verify</p>

          <span id="qc-verify-h" />

          ```bash
          qwen -p "Hello"
          ```
        </div>
      </li>
    </ol>
  </Tab>

  <Tab title="Desktop">
    <span id="qc-desktop-h" />

    <ol className="rkb-steps">
      <li className="rkb-step" value={1}>
        <span className="rkb-step-number">1</span>

        <div className="rkb-step-content">
          <p className="rkb-step-title">Open model settings</p>

          Click **More** > **Settings** > **Models**, then click **+ Add Model**.
        </div>
      </li>

      <li className="rkb-step" value={2}>
        <span className="rkb-step-number">2</span>

        <div className="rkb-step-content">
          <p className="rkb-step-title">Select the provider</p>

          Select **Alibaba ModelStudio** as the type, **Token Plan**, **Coding Plan**, or **Standard API Key** as the provider, and **Singapore** as the region.
        </div>
      </li>

      <li className="rkb-step" value={3}>
        <span className="rkb-step-number">3</span>

        <div className="rkb-step-content">
          <p className="rkb-step-title">Enter the API key</p>

          - Token Plan Personal Edition: [Create or view API Key](https://modelstudio.console.alibabacloud.com/subscription/token-plan/personal)
          - Token Plan Team Edition: [Assign a seat and get the API Key](https://modelstudio.console.alibabacloud.com/subscription/uac-admin/organization/members/list)
          - Coding Plan: use a [Coding Plan API key](https://modelstudio.console.alibabacloud.com/ap-southeast-1/subscription/coding-plan)
          - Standard API Key: use a [Model Studio API key](/help/en/model-studio/get-api-key)
        </div>
      </li>

      <li className="rkb-step" value={4}>
        <span className="rkb-step-number">4</span>

        <div className="rkb-step-content">
          <p className="rkb-step-title">Select models and save</p>

          Model IDs are prefilled; keep or add as needed. Click **Save**, then select the new model from the model list.
        </div>
      </li>
    </ol>
  </Tab>

  <Tab title="IDE plugin">
    <span id="qc-ide-h" />

    <ol className="rkb-steps">
      <li className="rkb-step" value={1}>
        <span className="rkb-step-number">1</span>

        <div className="rkb-step-content">
          <p className="rkb-step-title">Install the extension</p>

          Install **Qwen Code Companion** from your IDE's extension marketplace.
        </div>
      </li>

      <li className="rkb-step" value={2}>
        <span className="rkb-step-number">2</span>

        <div className="rkb-step-content">
          <p className="rkb-step-title">Configure the model</p>

          Add the configuration for your billing plan as described in [Configuration file](#qc-config-file-h).
        </div>
      </li>

      <li className="rkb-step" value={3}>
        <span className="rkb-step-number">3</span>

        <div className="rkb-step-content">
          <p className="rkb-step-title">Open Qwen Code</p>

          Click the Qwen icon, or run `Qwen Code: Open` from the Command Palette.
        </div>
      </li>
    </ol>
  </Tab>
</Tabs>

## Configuration file <span id="qc-config-file-h" />

In addition to the options above, you can also connect using a configuration file.

<ol className="rkb-steps">
  <li className="rkb-step" value={1}>
    <span className="rkb-step-number">1</span>

    <div className="rkb-step-content">
      <p className="rkb-step-title">Open or create the configuration file</p>

      - macOS / Linux: `~/.qwen/settings.json`
      - Windows: `C:\Users\<username>\.qwen\settings.json`
    </div>
  </li>

  <li className="rkb-step" value={2}>
    <span className="rkb-step-number">2</span>

    <div className="rkb-step-content">
      <p className="rkb-step-title">Write the configuration</p>

      <Tabs>
        <Tab title="Token Plan Personal Edition">
          <span id="qc-tpp-h" />

          Get a Token Plan API key from the [console](https://modelstudio.console.alibabacloud.com/subscription/token-plan/personal) and replace `YOUR_API_KEY`.

          ```json
          {
            "$version": 4,
            "env": {
              "BAILIAN_TOKEN_PLAN_API_KEY": "YOUR_API_KEY"
            },
            "modelProviders": {
              "openai": [
                {
                  "id": "auto",
                  "name": "Token Plan auto",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "qwen4-max",
                  "name": "Qwen4 Max",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "qwen3.8-max",
                  "name": "Qwen3.8 Max",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "qwen3.8-flash",
                  "name": "Qwen3.8 Flash",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "qwen3.7-max",
                  "name": "Qwen3.7 Max",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "qwen3.7-plus",
                  "name": "Qwen3.7 Plus",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "qwen3.6-flash",
                  "name": "Qwen3.6 Flash",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "qwen-image-3.0-pro",
                  "name": "Qwen Image 3.0 Pro",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "qwen-audio-3.0-tts-plus",
                  "name": "Qwen Audio 3.0 TTS Plus",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "qwen-audio-3.0-realtime-plus",
                  "name": "Qwen Audio 3.0 Realtime Plus",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "qwen-audio-3.0-asr-flash",
                  "name": "Qwen Audio 3.0 ASR Flash",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "wan2.7-image",
                  "name": "Wan2.7 Image",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "wan2.7-image-pro",
                  "name": "Wan2.7 Image Pro",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "wan3.0-video",
                  "name": "Wan3.0 Video",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "deepseek-v4.1-flash",
                  "name": "DeepSeek V4.1 Flash",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "deepseek-v4.1-flash-1017",
                  "name": "DeepSeek V4.1 Flash 1017",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "deepseek-v4-pro",
                  "name": "DeepSeek V4 Pro",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "deepseek-v4-pro-0813",
                  "name": "DeepSeek V4 Pro 0813",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "deepseek-v4-flash-0731",
                  "name": "DeepSeek V4 Flash 0731",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "glm-5.3",
                  "name": "GLM-5.3",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "glm-5.2",
                  "name": "GLM-5.2",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "happyhorse-1.1-i2v",
                  "name": "HappyHorse 1.1 I2V",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "happyhorse-1.1-t2v",
                  "name": "HappyHorse 1.1 T2V",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "happyhorse-1.1-r2v",
                  "name": "HappyHorse 1.1 R2V",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                },
                {
                  "id": "decision-model-preview",
                  "name": "Decision Model Preview",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
                }
              ]
            },
            "security": {
              "auth": {
                "selectedType": "openai"
              }
            },
            "model": {
              "name": "auto"
            }
          }
          ```
        </Tab>

        <Tab title="Token Plan Team Edition">
          <span id="qc-tp-h" />

          Assign a seat and generate a Token Plan API key in [team management](/help/en/model-studio/token-plan-team-management), then replace `YOUR_API_KEY`.

          ```json
          {
            "$version": 4,
            "env": {
              "BAILIAN_TOKEN_PLAN_TEAM_API_KEY": "YOUR_API_KEY"
            },
            "modelProviders": {
              "openai": [
                {
                  "id": "auto",
                  "name": "Token Plan auto",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "qwen4-max",
                  "name": "Qwen4 Max",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "qwen3.8-max",
                  "name": "Qwen3.8 Max",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "qwen3.8-flash",
                  "name": "Qwen3.8 Flash",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "qwen3.7-max",
                  "name": "Qwen3.7 Max",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "qwen3.7-plus",
                  "name": "Qwen3.7 Plus",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "qwen3.6-plus",
                  "name": "Qwen3.6 Plus",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "qwen3.6-flash",
                  "name": "Qwen3.6 Flash",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "qwen-image-2.0",
                  "name": "Qwen Image 2.0",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "qwen-image-2.0-pro",
                  "name": "Qwen Image 2.0 Pro",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "qwen-image-3.0-pro",
                  "name": "Qwen Image 3.0 Pro",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "qwen-audio-3.0-tts-plus",
                  "name": "Qwen Audio 3.0 TTS Plus",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "qwen-audio-3.0-realtime-plus",
                  "name": "Qwen Audio 3.0 Realtime Plus",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "qwen-audio-3.0-asr-flash",
                  "name": "Qwen Audio 3.0 ASR Flash",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "wan2.7-image",
                  "name": "Wan2.7 Image",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "wan2.7-image-pro",
                  "name": "Wan2.7 Image Pro",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "wan3.0-video",
                  "name": "Wan3.0 Video",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "deepseek-v4.1-flash",
                  "name": "DeepSeek V4.1 Flash",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "deepseek-v4.1-flash-1017",
                  "name": "DeepSeek V4.1 Flash 1017",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "deepseek-v4-pro",
                  "name": "DeepSeek V4 Pro",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "deepseek-v4-pro-0813",
                  "name": "DeepSeek V4 Pro 0813",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "deepseek-v4-flash-0731",
                  "name": "DeepSeek V4 Flash 0731",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "kimi-k2.7-code",
                  "name": "Kimi K2.7 Code",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "kimi-k2.6",
                  "name": "Kimi K2.6",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "kimi-k2.5",
                  "name": "Kimi K2.5",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "glm-5.3",
                  "name": "GLM-5.3",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "glm-5.2",
                  "name": "GLM-5.2",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "glm-5.1",
                  "name": "GLM-5.1",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "glm-5",
                  "name": "GLM-5",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "MiniMax-M2.5",
                  "name": "MiniMax M2.5",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "happyhorse-1.1-i2v",
                  "name": "HappyHorse 1.1 I2V",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "happyhorse-1.1-t2v",
                  "name": "HappyHorse 1.1 T2V",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                },
                {
                  "id": "happyhorse-1.1-r2v",
                  "name": "HappyHorse 1.1 R2V",
                  "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_TOKEN_PLAN_TEAM_API_KEY"
                }
              ]
            },
            "security": {
              "auth": {
                "selectedType": "openai"
              }
            },
            "model": {
              "name": "auto"
            }
          }
          ```
        </Tab>

        <Tab title="Pay-as-you-go">
          <span id="qc-payg-h" />

          Get a Model Studio API key from the [console](/help/en/model-studio/get-api-key) and replace `YOUR_API_KEY`. Replace `{WorkspaceId}` with your [Workspace ID](/help/en/model-studio/regions#h2_migrate_domain). The example lists the latest models in Singapore; for other models, see [supported models](/help/en/model-studio/models).

          ```json
          {
            "$version": 4,
            "env": {
              "BAILIAN_API_KEY": "YOUR_API_KEY"
            },
            "modelProviders": {
              "openai": [
                {
                  "id": "qwen3.8-max",
                  "name": "Qwen3.8 Max",
                  "baseUrl": "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_API_KEY"
                },
                {
                  "id": "qwen3.7-plus",
                  "name": "Qwen3.7 Plus",
                  "baseUrl": "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_API_KEY"
                },
                {
                  "id": "qwen3.8-flash",
                  "name": "Qwen3.8 Flash",
                  "baseUrl": "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_API_KEY"
                },
                {
                  "id": "deepseek-v4-pro-0813",
                  "name": "DeepSeek V4 Pro 0813",
                  "baseUrl": "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_API_KEY"
                },
                {
                  "id": "deepseek-v4.1-flash",
                  "name": "DeepSeek V4.1 Flash",
                  "baseUrl": "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                  "envKey": "BAILIAN_API_KEY"
                }
              ]
            },
            "security": {
              "auth": {
                "selectedType": "openai"
              }
            },
            "model": {
              "name": "qwen3.8-max"
            }
          }
          ```
        </Tab>

        <Tab title="Coding Plan">
          <span id="qc-cp-h" />

          Get a Coding Plan API key from the [console](https://modelstudio.console.alibabacloud.com/ap-southeast-1/subscription/coding-plan) and replace `YOUR_API_KEY`.

          ```json
          {
            "$version": 4,
            "env": {
              "BAILIAN_CODING_PLAN_API_KEY": "YOUR_API_KEY"
            },
            "modelProviders": {
              "openai": [
                {
                  "id": "qwen3.7-plus",
                  "name": "Qwen3.7 Plus",
                  "baseUrl": "https://coding-intl.dashscope.aliyuncs.com/v1",
                  "envKey": "BAILIAN_CODING_PLAN_API_KEY"
                },
                {
                  "id": "qwen3.6-plus",
                  "name": "Qwen3.6 Plus",
                  "baseUrl": "https://coding-intl.dashscope.aliyuncs.com/v1",
                  "envKey": "BAILIAN_CODING_PLAN_API_KEY"
                },
                {
                  "id": "kimi-k2.5",
                  "name": "Kimi K2.5",
                  "baseUrl": "https://coding-intl.dashscope.aliyuncs.com/v1",
                  "envKey": "BAILIAN_CODING_PLAN_API_KEY"
                },
                {
                  "id": "glm-5",
                  "name": "GLM-5",
                  "baseUrl": "https://coding-intl.dashscope.aliyuncs.com/v1",
                  "envKey": "BAILIAN_CODING_PLAN_API_KEY"
                },
                {
                  "id": "MiniMax-M2.5",
                  "name": "MiniMax M2.5",
                  "baseUrl": "https://coding-intl.dashscope.aliyuncs.com/v1",
                  "envKey": "BAILIAN_CODING_PLAN_API_KEY"
                },
                {
                  "id": "qwen3.5-plus",
                  "name": "Qwen3.5 Plus",
                  "baseUrl": "https://coding-intl.dashscope.aliyuncs.com/v1",
                  "envKey": "BAILIAN_CODING_PLAN_API_KEY"
                }
              ]
            },
            "security": {
              "auth": {
                "selectedType": "openai"
              }
            },
            "model": {
              "name": "qwen3.7-plus"
            }
          }
          ```
        </Tab>
      </Tabs>

      <Note>
        When using qwen4-max, the default output limit is 32768. For longer output, set `generationConfig.samplingParams.max_tokens` in the model entry. qwen4-max has a 1M-token context. The maximum output is 131,072 tokens in non-thinking mode and 262,144 tokens for thinking and the final answer combined. The defaults are reasoning\_effort=high and thinking\_budget=131072.
      </Note>
    </div>
  </li>
</ol>

<Note>
  The variable name in `env` must match the model entry's `envKey`. Keep `security.auth.selectedType` set to `openai` and `$version` set to `4`.
</Note>

## Integrate Bailian CLI <span id="qc-cli-h" />

[Bailian CLI](https://bailian.aliyun.com/cli) registers a Skill at `~/.qwen/skills/bailian-cli/` during installation, allowing Qwen Code to invoke Bailian capabilities through conversation. Install [Node.js](https://nodejs.org/en/download) 18+ before use.

<ol className="rkb-steps">
  <li className="rkb-step" value={1}>
    <span className="rkb-step-number">1</span>

    <div className="rkb-step-content">
      <p className="rkb-step-title">Install Bailian CLI</p>

      ```plaintext
      Please install the Alibaba Cloud Bailian CLI globally: npm install -g bailian-cli
      ```
    </div>
  </li>

  <li className="rkb-step" value={2}>
    <span className="rkb-step-number">2</span>

    <div className="rkb-step-content">
      <p className="rkb-step-title">Configure the API Key</p>

      Get an API Key ([Get from console](/help/en/model-studio/get-api-key)), then tell Qwen Code:

      ```plaintext
      My API Key is: sk-xxxxxxxxxxxxx
      ```

      <Warning>
        An API Key is a sensitive credential. Do not disclose it. A plaintext API Key pasted into the conversation may be retained in session logs. Use `settings.json` or an environment variable instead.
      </Warning>
    </div>
  </li>

  <li className="rkb-step" value={3}>
    <span className="rkb-step-number">3</span>

    <div className="rkb-step-content">
      <p className="rkb-step-title">Start using it</p>

      ```plaintext
      Generate 6 Amazon e-commerce hero images for a white wireless Bluetooth headset.
      ```
    </div>
  </li>
</ol>

## Learn More <span id="qc-more-h" /> <span id="qc-commands-h" />

For more commands, sub-agents, MCP, Skills, and examples, see the [Qwen Code documentation](https://qwenlm.github.io/qwen-code-docs/en/users/overview/) and [examples](https://qwenlm.github.io/qwen-code-docs/en/showcase/).

## Error Codes <span id="qc-faq-error-h" />

If you encounter errors during configuration, refer to the FAQ documentation for your billing plan:

- Token Plan: [Personal Edition FAQ](/help/en/model-studio/token-plan-faq) · [Team Edition FAQ](/help/en/model-studio/token-plan-faq)
- Pay-as-you-go: [Error codes](/help/en/model-studio/error-code)
- Coding Plan: [Coding Plan FAQ](/help/en/model-studio/coding-plan-faq#e07ad90b4f3l0)

## FAQ <span id="qc-faq-h" />

<AccordionGroup>
  <Accordion title="How do I use a savings plan with pay-as-you-go?">
    The pay-as-you-go setup remains the same: use your general Model Studio API key and Base URL. After you purchase a savings plan, it takes effect automatically and eligible usage is deducted automatically. See [Savings plans](/help/en/model-studio/savings-plan-and-resource-package).
  </Accordion>

  <Accordion title="What if the model I want is missing after configuration?">
    <span id="qc-faq-model-h" />

    Try the following in order:

    1. Upgrade Qwen Code to the latest version.
    2. If the model is still missing, add it manually under `modelProviders.openai` in `~/.qwen/settings.json`, then restart Qwen Code. See [Configuration file](#qc-config-file-h) for details.
  </Accordion>

  <Accordion title="What should I do if the qwen command is not found after installation on Windows?">
    Close and reopen `cmd` so that the environment variable takes effect, then run `qwen --version` to confirm the installation.
  </Accordion>
</AccordionGroup>