Coding Agents
OpenCode
Route OpenCode through the Inference.net gateway with inf opencode.
inf opencode routes OpenCode through https://api.inference.net/v1. All three catalog models are registered in the provider registry, so you can switch models inside OpenCode without re-running on.
Config file
inf writes fields in ~/.config/opencode/opencode.json (JSON). If XDG_CONFIG_HOME is set, inf uses that root. inf owns fields, not the whole file. $schema and every other key stay untouched.
inf opencode on
inf opencode on| Flag | Required | Description | Default |
|---|---|---|---|
--model <alias> | No | Default OpenCode model | kimi-k3-fast |
See Model mapping for supported aliases and limits.
What gets written
provider.inference is an object with npm package @ai-sdk/openai-compatible, name Inference.net, options (baseURL and apiKey as a secret), and a models map. model is set to inference/<selected alias>.
The three registry entries are glm-5.2-fast, kimi-k3-fast, and deepseek-v4-flash-0731. glm-5.2-fast carries limit.context of 262,144.
{
"provider": {
"inference": {
"npm": "@ai-sdk/openai-compatible",
"name": "Inference.net",
"options": {
"baseURL": "https://api.inference.net/v1",
"apiKey": "<gateway-key>"
},
"models": {
"glm-5.2-fast": {
"name": "glm-5.2-fast",
"limit": { "context": 262144, "output": 128000 }
},
"kimi-k3-fast": {
"name": "kimi-k3-fast",
"limit": { "context": 1048576, "output": 131072 }
},
"deepseek-v4-flash-0731": {
"name": "deepseek-v4-flash-0731",
"limit": { "context": 1048575, "output": 384000 }
}
}
}
},
"model": "inference/kimi-k3-fast"
}inf opencode status
inf opencode statusinf opencode off
inf opencode offoff restores unchanged owned fields. It keeps fields that you edited after on.
Examples
Select the Fast-tier alias:
inf opencode on --model glm-5.2-fastRestart OpenCode after on or off. See Troubleshooting for drift, recovery, and key revocation.