Skip to content

opencode

opencode talks to Inferam over OpenAI Chat Completions.

Terminal window
inferam opencode

Arguments pass through: inferam opencode run "explain this repo", inferam opencode --session <id>. The CLI passes its config in OPENCODE_CONFIG_CONTENT for that run only. It also pins small_model and enabled_providers, so a repository’s own opencode.json can’t route any call, or your key, to another provider.

Add a provider to your global ~/.config/opencode/opencode.json:

{
"$schema": "https://opencode.ai/config.json",
"model": "inferam/DeepSeek-V4.1-Flash-1017",
"small_model": "inferam/DeepSeek-V4.1-Flash-1017",
"provider": {
"inferam": {
"name": "Inferam",
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://api.inferam.ai/v1",
"apiKey": "{env:INFERAM_API_KEY}"
},
"models": {
"DeepSeek-V4.1-Flash-1017": {
"name": "DeepSeek-V4.1-Flash-1017",
"reasoning": true,
"tool_call": true,
"limit": { "context": 524288, "output": 32768 }
}
}
}
}
}

Then export INFERAM_API_KEY=ifr_... and run opencode.