Skip to main content

Overview

OpenCode is an open source coding agent that supports 75+ LLM providers. In Blocks, OpenCode currently supports Anthropic (Claude models) and OpenAI (GPT models), with additional provider support planned. 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

OpenCode provides access to multiple providers through its curated “Zen” model service. In Blocks, the following providers are currently supported:
  • OpenAI: GPT-5, GPT-4o, GPT-4 Turbo
  • Anthropic: Claude 4.5 Opus, Claude 4.5 Sonnet
While OpenCode supports 75+ providers including Google, AWS Bedrock, Groq, OpenRouter, and Azure, Blocks currently only supports Anthropic and OpenAI API keys. Additional provider support is coming soon.

Authentication

OpenCode supports multiple authentication methods depending on your provider:
Use Anthropic models (Claude 4.5 Opus, Sonnet)
  1. Get an API key at Anthropic Console
  2. Set the environment variable: ANTHROPIC_API_KEY=sk-ant-...
  3. In Blocks Dashboard, go to DashboardAgents
  4. Select OpenCode and choose “Anthropic”
  5. Paste your API key

Setting as Default

To use OpenCode automatically for all requests:
  1. Go to DashboardAgents
  2. Select “Set as default agent” from OpenCode’s dropdown menu
Learn more: Setting Your Default Agent

Using OpenCode

Once configured, OpenCode is used automatically if it’s your default agent:
@blocks can you review this code?
Or use the /opencode slash command to use it specifically:
@blocks /opencode implement this feature using GPT-5

Best For

  • Flexibility between OpenAI and Anthropic 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
Currently supports Anthropic and OpenAI providers in Blocks. Support for additional providers (Google, Groq, Azure, etc.) is coming soon.

Cost

OpenCode costs vary by provider. Currently supported in Blocks: Monitor usage in each provider’s console. API usage is billed directly by your chosen provider.
You can switch between Anthropic and OpenAI to optimize costs based on task complexity. Use the provider that best fits your needs and budget for each task.

Next Steps