Current as of April 2026. Anthropic’s Claude family is the premier choice for OpenCode users who require high-fidelity tool calling and nuanced reasoning. These models excel at following complex system prompts and managing multi-file edits without losing track of architectural constraints.

The quick answer

ModelInput / OutputContextBest For
Claude 3 Haiku$0.25 / $1.25200KThe Budget Refactorer
Claude 3.5 Haiku$0.80 / $4.00200KReliable Scripting
Claude Haiku 4.5$1.00 / $5.00200KReasoning on a Budget
Claude 3.7 Sonnet$3.00 / $15200KThe Developer Workhorse
Claude Sonnet 4$3.00 / $15200KThe Iterative Baseline
Claude Sonnet 4.5$3.00 / $151MDeep Repository Analysis
Claude Sonnet 4.6$3.00 / $151MLarge-Scale Code Generation
Claude Opus 4.5$5.00 / $25200KThe Intelligence Ceiling

Start with Claude 3.7 Sonnet unless you have a specific reason to pick another. It hits the sweet spot for professional development with $3/M input pricing and a massive 64K output limit. Its reasoning capabilities handle complex refactors that cheaper models fail, making it the most reliable daily driver for CLI-based coding.

Claude 3 Haiku — The Budget Refactorer

At $0.25/M input, this is the most affordable way to use OpenCode for simple tasks like writing docstrings or unit tests. The 4K output cap is a significant limitation for generating new features, so keep it restricted to small, isolated code changes.

Claude 3.5 Haiku — Reliable Scripting

This model offers better tool-calling reliability than the base version for $0.8/M. It is ideal for automated linting or writing simple bash scripts where you need an 8K output buffer but want to stay well below Sonnet price points.

Claude Haiku 4.5 — Reasoning on a Budget

This is the first budget-tier model to include reasoning and a 64K output window. For $1/M input, it handles larger logic tasks than previous Haiku versions, bridging the gap between basic automation and complex engineering.

Claude 3.7 Sonnet — The Developer Workhorse

The standard for OpenCode users, balancing $3/M pricing with deep reasoning and 64K output. It handles multi-file diffs and complex logic puzzles with high reliability, making it the most cost-effective choice for heavy daily use.

Claude Sonnet 4 — The Iterative Baseline

Claude Sonnet 4 is nearly identical to 3.7 Sonnet in pricing and context window; prefer 3.7 Sonnet unless you have a specific requirement for this version. It provides reliable 200K context but lacks the updated reasoning optimizations found in the newer release.

Claude Sonnet 4.5 — Deep Repository Analysis

This model introduces a 1M token context window, allowing you to feed OpenCode your entire codebase for global refactors. It maintains the $3/M input price, making it the best choice for architectural changes that require visibility into many files at once.

Claude Sonnet 4.6 — Large-Scale Code Generation

With a 128K output cap, this model is designed for massive boilerplate generation or migrating entire modules. It doubles the output capacity of version 4.5, ensuring OpenCode can complete long-running tasks without hitting generation limits.

Claude Opus 4.5 — The Intelligence Ceiling

At $5/M input and $25/M output, this is the most expensive option, reserved for the most difficult logic problems. Use it for high-level architectural reviews or debugging cryptic race conditions that Sonnet models struggle to solve.

Setup in OpenCode

To configure Claude in OpenCode, add your provider settings to ~/.config/opencode/opencode.jsonc and place your API key in ~/.local/share/opencode/auth.json. OpenCode utilizes the @ai-sdk/openai-compatible adapter for custom provider integration.

Running through haimaker.ai

All Claude models are also available through haimaker.ai. Wire haimaker as a single OpenAI-compatible provider and you get Claude alongside every other frontier model:

{
  "provider": {
    "haimaker": {
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "https://api.haimaker.ai/v1"
      }
    }
  }
}

Direct provider setup

OpenCode ships with a built-in preset for Anthropic. You do not need to configure a custom provider — just drop your API key into ~/.local/share/opencode/auth.json:

{
  "anthropic": {
    "type": "api",
    "key": "your-anthropic-api-key"
  }
}

Restart OpenCode and Anthropic models appear under /models. For providers not in the built-in directory (or to hit them through a gateway like haimaker), see the custom provider guide.

Bottom line

For 90% of coding tasks, Claude 3.7 Sonnet is the correct choice; use Haiku 4.5 for low-cost scripting and Sonnet 4.6 when you need to generate massive amounts of code in one go.

USE CLAUDE IN OPENCODE WITH HAIMAKER


See our OpenCode custom provider guide. See our Haimaker + OpenCode setup.