opencode
opencode talks to Inferam over OpenAI Chat Completions.
With the CLI
Section titled “With the CLI”inferam opencodeArguments 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.
By hand
Section titled “By hand”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.