OpenCode with 5 providers, one config
Claude, GPT, Gemini, Mistral, Grok — aggregated via a single opencode.json. Routing strategies inside.
⚡ 90s read intermediate OS · macos · linux · windows v0.4.1
Last updated May 06, 2026 · by xlrd
Prereq
- Bun 1.0+
- API keys for at least one provider (Anthropic / OpenAI / Google / Mistral / Grok)
Steps
01. Install
bash
bun install -g opencode-ai 02. Create config
json
{
"providers": {
"anthropic": { "apiKey": "$ANTHROPIC_API_KEY" },
"openai": { "apiKey": "$OPENAI_API_KEY" },
"google": { "apiKey": "$GOOGLE_API_KEY" }
},
"defaultModel": "claude-opus-4.7"
} 03. Run
bash
opencode Switch models mid-session with /model gpt-5.4.
Next
- OVTH Gateway onboarding
- Cursor power setup
Feedback · anonymous
Was this helpful?