Use Token Plan with OpenCode
OpenCode is an open-source AI coding tool that runs in the terminal.
Verify the installation:
Create and open
Start OpenCode in your terminal:
Type
See FAQ.
Install OpenCode
- Install or update Node.js (v18.0+).
- Install OpenCode:
Set up Token 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://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1. Do not use endpoints from other plans.apiKey: ReplaceYOUR_API_KEYwith your Token Plan API key.
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, the sum of budgetTokens and output must be less than or equal to 32,768.Use OpenCode
Start OpenCode in your terminal:
/models, search for Qwen Cloud Token Plan, and select a model.
Image generation models use a separate API and must be integrated through extension mechanisms. See Integrate multimodal generation models.