Skip to main content
Use in AI Tools

OpenCode

Use Coding Plan with OpenCode

OpenCode is an open-source AI coding tool.

Install OpenCode

  1. Install or update Node.js (v18.0+).
  2. Install OpenCode:
npm install -g opencode-ai
Verify the installation:
opencode -v

Set up Coding Plan

Create and open opencode.json at one of these paths:
  • macOS or Linux: ~/.config/opencode/opencode.json
  • Windows: C:\Users\<username>\.config\opencode\opencode.json
Add the following:
  • baseURL: https://coding-intl.dashscope.aliyuncs.com/apps/anthropic/v1 (not the general Qwen Cloud endpoint)
  • apiKey: Replace YOUR_API_KEY with your Coding Plan API key (format: sk-sp-xxx, not sk-xxx)
Save the file. Restart OpenCode to apply changes.
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "qwen-cloud-coding-plan": {
      "npm": "@ai-sdk/anthropic",
      "name": "Qwen Cloud Coding Plan",
      "options": {
        "baseURL": "https://coding-intl.dashscope.aliyuncs.com/apps/anthropic/v1",
        "apiKey": "YOUR_API_KEY"
      },
      "models": {
        "qwen3.5-plus": {
          "name": "Qwen3.5 Plus",
          "modalities": {
            "input": ["text", "image"],
            "output": ["text"]
          },
          "options": {
            "thinking": {
              "type": "enabled",
              "budgetTokens": 8192
            }
          },
          "limit": {
            "context": 1000000,
            "output": 65536
          }
        },
        "qwen3-max-2026-01-23": {
          "name": "Qwen3 Max 2026-01-23",
          "modalities": {
            "input": ["text"],
            "output": ["text"]
          },
          "limit": {
            "context": 262144,
            "output": 32768
          }
        },
        "qwen3-coder-next": {
          "name": "Qwen3 Coder Next",
          "modalities": {
            "input": ["text"],
            "output": ["text"]
          },
          "limit": {
            "context": 262144,
            "output": 65536
          }
        },
        "qwen3-coder-plus": {
          "name": "Qwen3 Coder Plus",
          "modalities": {
            "input": ["text"],
            "output": ["text"]
          },
          "limit": {
            "context": 1000000,
            "output": 65536
          }
        },
        "MiniMax-M2.5": {
          "name": "MiniMax M2.5",
          "modalities": {
            "input": ["text"],
            "output": ["text"]
          },
          "options": {
            "thinking": {
              "type": "enabled",
              "budgetTokens": 8192
            }
          },
          "limit": {
            "context": 196608,
            "output": 24576
          }
        },
        "glm-5": {
          "name": "GLM-5",
          "modalities": {
            "input": ["text"],
            "output": ["text"]
          },
          "options": {
            "thinking": {
              "type": "enabled",
              "budgetTokens": 8192
            }
          },
          "limit": {
            "context": 202752,
            "output": 16384
          }
        },
        "glm-4.7": {
          "name": "GLM-4.7",
          "modalities": {
            "input": ["text"],
            "output": ["text"]
          },
          "options": {
            "thinking": {
              "type": "enabled",
              "budgetTokens": 8192
            }
          },
          "limit": {
            "context": 202752,
            "output": 16384
          }
        },
        "kimi-k2.5": {
          "name": "Kimi K2.5",
          "modalities": {
            "input": ["text", "image"],
            "output": ["text"]
          },
          "options": {
            "thinking": {
              "type": "enabled",
              "budgetTokens": 8192
            }
          },
          "limit": {
            "context": 262144,
            "output": 32768
          }
        }
      }
    }
  }
}
budgetTokens sets the maximum thinking budget. Setting it too low may interrupt reasoning.For MiniMax-M2.5: budgetTokens + output ≤ 32,768.

Use OpenCode

Start OpenCode in your terminal:
opencode
Type /models, search for Qwen Cloud Coding Plan, and select a model.