Open the OpenCode config
Create or edit ~/.config/opencode/opencode.json without removing existing providers, channels, or Skills.
Add the Agent Plan as a named OpenCode provider and keep the provider model registry aligned with the active model.
1 · Quick start
Start with the matching configuration file, keep the key in the named secret location, and use one exact Model ID throughout the setup.
Create or edit ~/.config/opencode/opencode.json without removing existing providers, channels, or Skills.
Use the /v3 OpenAI-compatible base URL in provider.options and reference ARK_API_KEY through the environment rather than hard-coding it. The @ai-sdk/openai package selects the Responses API route.
Volcengine requires the registry key and the name field inside provider.models to be the same exact Model ID; the top-level model field must reference it with the provider prefix.
The key is delivered to your Dashboard after payment. Replace the placeholder in the example, then keep the real value in your environment or local secret file.
2 · Configuration
This is a safe starting point for the current Agent Plan route. Keep existing tool settings that are unrelated to the provider and replace only the placeholder key and Model ID values.
{
"$schema": "https://opencode.ai/config.json",
"model": "volcengine-agent-plan/glm-5.2",
"provider": {
"volcengine-agent-plan": {
"npm": "@ai-sdk/openai",
"name": "Volcengine Ark Agent Plan",
"options": {
"baseURL": "https://ark.cn-beijing.volces.com/api/plan/v3",
"apiKey": "{env:ARK_API_KEY}"
},
"models": {
"glm-5.2": {
"name": "glm-5.2",
"limit": {
"context": 1024000,
"output": 65536
}
}
}
}
}
}The default Model ID shown here is the stocked plan's current default. If you choose another supported model, replace every model field required by OpenCode, not just the visible label.
Install / launch
npm install -g opencode-ai3 · Verify the route
Start OpenCode from a fresh terminal so the ARK_API_KEY environment variable is available.
Enter /models, select the named provider, and run a small prompt before enabling repository-wide edits.
If the model is missing, compare the provider name, model prefix, registry key, and name field character by character.
Troubleshooting
Merge the provider block into your existing file; do not overwrite unrelated channels or Skills.
Do not put a display label in the models name field. Volcengine's guide requires the exact Model ID in both the registry key and name.
The limit block mirrors the official per-model context and output caps; adjust both values when switching models.