OpenCode
OpenCode is a terminal AI coding tool that can connect to SilvaMux Coding Plan.
Before You Start
- Purchase a subscription: buy a Coding Plan Personal subscription (Lite / Pro / Max with monthly, quarterly, or yearly billing) on the subscription page; it takes effect immediately after payment.
- Create a subscription API key: in the console, go to Coding Plan → API Keys, create a key, and copy the full value starting with
cp_live_right away. - Confirm endpoints and protocols: all tools share the Base URL
https://www.silvamux.com/api/coding-plan/v1, compatible with both the OpenAI and Anthropic protocols; see Endpoints & Protocols for endpoint details.
cp_live_ key can only call the /api/coding-plan/v1 subscription endpoints; using it on regular endpoints (such as /api/v1/chat/completions) returns 403 CODING_PLAN_KEY_NOT_ALLOWED; conversely, a regular sk_live_ key cannot call the subscription endpoints.For the full flow of purchasing, key creation, and a verification call, see Quick Start.
Install OpenCode
- Install Node.js (v18.0 or later).
- Run the following command in a terminal to install OpenCode.
npm install -g opencode-ai
Verify the install; a version number means it succeeded.
opencode -v
Configure Credentials
Open the config file in a text editor:
- macOS / Linux:
~/.config/opencode/opencode.json - Windows:
C:\Users\<username>\.config\opencode\opencode.json
Add the following, replacing YOUR_API_KEY with your cp_live_ key. The OpenAI-compatible entry uses @ai-sdk/openai-compatible.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"silvamux-coding-plan": {
"npm": "@ai-sdk/openai-compatible",
"name": "SilvaMux Coding Plan",
"options": {
"baseURL": "https://www.silvamux.com/api/coding-plan/v1",
"apiKey": "YOUR_API_KEY"
},
"models": {
"deepseek-v4-pro": {
"name": "DeepSeek V4 Pro"
},
"glm-5.2": {
"name": "GLM 5.2"
},
"minimax-m3": {
"name": "MiniMax M3"
}
}
}
}
}
To use the Anthropic Messages protocol instead, switch to @ai-sdk/anthropic; the rest of the configuration is unchanged:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"silvamux-coding-plan": {
"npm": "@ai-sdk/anthropic",
"name": "SilvaMux Coding Plan",
"options": {
"baseURL": "https://www.silvamux.com/api/coding-plan/v1",
"apiKey": "YOUR_API_KEY"
},
"models": {
"deepseek-v4-pro": {
"name": "DeepSeek V4 Pro"
}
}
}
}
}
The available models follow GET /api/coding-plan/v1/models and the Model Plaza.
Verify the Configuration
Save the config and restart OpenCode. Enter /models, select a model under SilvaMux Coding Plan, and start chatting.
FAQ
401 on calls
A cp_live_ key must be used with https://www.silvamux.com/api/coding-plan/v1; a mismatch returns 401.
404 on calls
Check that provider.options.baseURL is https://www.silvamux.com/api/coding-plan/v1 and that you have not added any path beyond it.
429 on calls
When any subscription quota window is exhausted, calls return 429 QUOTA_EXCEEDED (the message identifies 5h / weekly / monthly). Wait for the window to recover, or check remaining quota in the console.