Using Corion AI with OpenCode
Integrate Corion models from api.corion.ai into OpenCode as a custom provider.
1. Prerequisites
- OpenCode installed and runnable
- A Corion API key from your dashboard
- The exact model IDs on your account — Corion currently exposes
kimi-k3,deepseek-v4-pro-0813anddeepseek-v4-flash-0731
2. Get your API key
Sign in at corion.ai, open Dashboard → API keys, and copy a key. Keep it private — Corion shows the complete key only once at creation.
3. Configure OpenCode
Create or edit ~/.config/opencode/opencode.json (global) or opencode.json in your project (project-scoped):
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"corion": {
"npm": "@ai-sdk/openai-compatible",
"name": "Corion AI",
"options": {
"baseURL": "https://api.corion.ai/v1",
"apiKey": "{env:CORION_API_KEY}"
},
"models": {
"kimi-k3": {
"name": "Kimi K3",
"reasoning": true,
"tool_call": true,
"attachment": true,
"interleaved": { "field": "reasoning_content" },
"limit": { "context": 1048576, "output": 131072 }
},
"deepseek-v4-pro-0813": {
"name": "DeepSeek V4 Pro 0813",
"reasoning": true,
"tool_call": true,
"attachment": false,
"interleaved": { "field": "reasoning_content" },
"limit": { "context": 1048576, "output": 384000 }
},
"deepseek-v4-flash-0731": {
"name": "DeepSeek V4 Flash 0731",
"reasoning": true,
"tool_call": true,
"attachment": false,
"interleaved": { "field": "reasoning_content" },
"limit": { "context": 1048576, "output": 65536 }
}
}
}
}
}
Notes:
npm: "@ai-sdk/openai-compatible"is the right package — Corion speaks/v1/chat/completions.- Every Corion model streams reasoning in
reasoning_content, sointerleaved.fieldis set explicitly (OpenCode's Poolside example uses the same field name). limitfeeds OpenCode's context-left indicator. Add one entry per model you want to use; model IDs must matchGET /v1/modelsexactly.
4. Store your API key
Keep the key out of the config file. Set an environment variable, then restart your terminal:
- PowerShell:
setx CORION_API_KEY "your-key-here" - cmd:
setx CORION_API_KEY "your-key-here" - macOS / Linux:
echo 'export CORION_API_KEY="your-key-here"' >> ~/.bashrc && source ~/.bashrc
Confirm the key can list the models before you start OpenCode:
curl https://api.corion.ai/v1/models -H "Authorization: Bearer your-key-here"
5. Restart and use
Quit and restart OpenCode — config is only read at startup. Then run:
/models
Select corion/kimi-k3, corion/deepseek-v4-pro-0813 or corion/deepseek-v4-flash-0731. To set a default in config, add a top-level key:
{
"model": "corion/kimi-k3"
}
First task after setup should be read-only — for example "summarize this directory" — so you can confirm responses and tool calls before allowing edits.
Troubleshooting
- Provider not listed under
/models— the config file wasn't reloaded; fully quit and relaunch OpenCode. - 401 Unauthorized — the env var is missing or the key is incomplete. Run
opencode auth listto confirm the credential is picked up, or re-set the variable and restart your shell. - Model ID rejected — check the ID matches exactly; Corion's IDs have no vendor prefix (
kimi-k3, notmoonshot/kimi-k3).
For other request errors, see errors and retries.
Sources: OpenCode providers — custom provider
