Use Coding Plan with OpenCode
OpenCode is an open-source AI coding tool.
Verify the installation:
Create and open
Start OpenCode in your terminal:
Type
Install OpenCode
- Install or update Node.js (v18.0+).
- Install OpenCode:
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
baseURL:https://coding-intl.dashscope.aliyuncs.com/apps/anthropic/v1(not the general Qwen Cloud endpoint)apiKey: ReplaceYOUR_API_KEYwith your Coding Plan API key (format:sk-sp-xxx, notsk-xxx)
Save the file. Restart OpenCode to apply changes.
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:
/models, search for Qwen Cloud Coding Plan, and select a model.