Overview
OpenCode is an open source coding agent that supports 75+ LLM providers. In Blocks, OpenCode runs Anthropic, OpenAI, Moonshot AI and Google models, using either your own provider keys, an OpenCode Zen or OpenCode Go key, or Blocks LLM credits. With over 650,000 monthly users, OpenCode offers a privacy-focused approach where no code is stored on external servers.Latest Models
In Blocks, OpenCode can run the following models:- Anthropic: Claude Opus 5, Claude Sonnet 5, Claude Fable 5.1, Claude Opus 4.8, Claude Sonnet 4.6, Claude Haiku 4.5
- OpenAI: GPT-5.6 Luna, GPT-5.6 Terra, GPT-5.6 Sol, GPT-5.5, GPT-5.4
- Moonshot AI: Kimi K2.5, Kimi K2.6, Kimi K2.7 Code, Kimi K3
- Google: Gemini 3.1 Pro Preview, Gemini 3.7 Flash, Gemini 2.5 Pro
Which of these you can select depends on the authentication method. A provider API key covers that provider’s models, OpenCode Zen covers everything except Gemini 2.5 Pro, OpenCode Go covers five models, and Blocks covers the full list.
Authentication
OpenCode supports several authentication methods. Pick one under Settings → Agents → OpenCode → Authentication Method:- Anthropic API Key
- OpenAI API Key
- Kimi API Key
- OpenCode Zen
- OpenCode Go
- Blocks
Use Anthropic models (Claude Opus 5, Sonnet 5)
- Get an API key at Anthropic Console
- Set the environment variable:
ANTHROPIC_API_KEY=sk-ant-... - In Blocks Dashboard, go to Dashboard → Agents
- Select OpenCode and choose “Anthropic”
- Paste your API key
Setting as Default
To use OpenCode automatically for all requests:- Go to Dashboard → Agents
- Select “Set as default agent” from OpenCode’s dropdown menu
Using OpenCode
Once configured, OpenCode is used automatically if it’s your default agent:/opencode slash command to use it specifically:
Best For
- Flexibility between OpenAI, Anthropic, Kimi and Gemini models
- Privacy-focused development (no code storage)
- Open source transparency
- Cost optimization (switch between providers based on task complexity)
- Experimentation with different models from major providers
- Teams wanting to avoid vendor lock-in
Cost
OpenCode costs depend on the authentication method:- Provider API key: Billed directly by that provider. Check Anthropic Pricing, OpenAI Pricing or the Moonshot AI Platform
- OpenCode Zen: Drawn from your prepaid Zen balance
- OpenCode Go: Drawn from your Go subscription wallet, with per-model quotas
- Blocks: Billed against your Blocks LLM credits
OpenCode Zen and OpenCode Go usage is billed by OpenCode against your own key. It does not go through the Blocks AI Gateway and is not billed by Blocks.
Next Steps
Claude Code
Learn about Claude Code
Codex Agent
Explore Codex capabilities

