Skip to main content

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.
OpenCode is currently experimental and may have different behavior or limitations compared to stable agents like Claude Code or Codex.

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:
Use Anthropic models (Claude Opus 5, Sonnet 5)
  1. Get an API key at Anthropic Console
  2. Set the environment variable: ANTHROPIC_API_KEY=sk-ant-...
  3. In Blocks Dashboard, go to Dashboard → Agents
  4. Select OpenCode and choose “Anthropic”
  5. Paste your API key

Setting as Default

To use OpenCode automatically for all requests:
  1. Go to Dashboard → Agents
  2. Select “Set as default agent” from OpenCode’s dropdown menu

Using OpenCode

Once configured, OpenCode is used automatically if it’s your default agent:
Or use the /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
Anthropic, OpenAI, Moonshot AI and Google models are all available in Blocks, so you can move between them as a task demands.

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