# OpenCode vs Claude Code: models, cost and setup compared

> How OpenCode and Claude Code differ on license, models and cost, which one fits you, how to move a project between them, and how to run both.

Updated: 2026-11-03

OpenCode and Claude Code are both coding agents for the terminal. Claude Code is Anthropic's agent for Claude models, on a Claude plan or an API key. OpenCode is open source under the MIT license and runs models from more than 75 providers, on your own API keys or a subscription it supports, such as ChatGPT Plus.

## How do OpenCode and Claude Code compare?

|  | Claude Code | OpenCode |
| --- | --- | --- |
| Made by | Anthropic | Anomaly, as an open-source project |
| License | Proprietary: use is subject to Anthropic's Commercial Terms of Service | Open source, MIT |
| Models | Claude models | Models from more than 75 providers, including Claude, GPT and Gemini, plus local models |
| How you pay | A Claude plan, an Anthropic API key, or a cloud provider | A provider's API key, or a ChatGPT Plus or Pro, GitHub Copilot, GitLab Duo or SuperGrok sign-in |
| Where it runs | Terminal, VS Code and Cursor, JetBrains, a desktop app and the web | Terminal, a desktop app, a web interface, and an extension for VS Code and editors built on it, such as Cursor |
| Install | Native installer, Homebrew, WinGet, Linux package managers or npm | Install script, npm, Homebrew, Chocolatey, Scoop or Docker, among others |
| Project instructions | `CLAUDE.md`, or `AGENTS.md` when there is no `CLAUDE.md` | `AGENTS.md`, or `CLAUDE.md` when there is no `AGENTS.md` |
| Extending it | MCP, skills, hooks, subagents and plugins | MCP, agents, skills, commands, plugins and custom tools |
| Scripted runs | `claude -p` | `opencode run` |

Both are full coding agents: they read your project, edit files and run commands. The real differences are the models, how you pay for them, and whether you can read and change the agent's source.

## What does each one cost?

Claude Code is included in Anthropic's Pro, Max and Ultra plans and in Team and Enterprise seats, and its use counts toward the plan's usage limits:

Claude individual plans (official prices)

| Service | Item | Value | Note | Source |
| --- | --- | --- | --- | --- |
| Claude | Pro, billed monthly | $20 a month | Includes Claude Code. | https://claude.com/pricing |
| Claude | Pro, billed yearly up front | $200 a year | Includes Claude Code. | https://claude.com/pricing |
| Claude | Max | $100 a month | 5x Pro usage every 5 hours and every week; includes Claude Code. | https://claude.com/pricing |
| Claude | Ultra | $200 a month | 10x Pro usage every week, no 5-hour limit for verified accounts; includes Claude Code. | https://claude.com/pricing |
| Anthropic | API usage with a paid plan | Billed separately from the plan | Max and Ultra include monthly API credits. | https://support.claude.com/en/articles/9876003 |

Each row links to the page it comes from, checked October 31, 2026, November 1, 2026. These figures can change, so check the source before you buy.

Without a plan, it runs on an Anthropic API key billed per token, or through a cloud provider such as Amazon Bedrock. Whether a plan or a key costs less for you is worked out in [The cheapest way to use Claude Code](https://5abeer.ai/en/guides/claude-code-cheapest-way).

OpenCode itself costs nothing. When we checked on 2026-11-03, its site said it comes with a set of free models you can use without an account. For other models you pay the provider you connect it to: per token on an API key, or through a subscription it can sign in with.

Claude plans are the exception. On the same date, OpenCode's docs said Anthropic explicitly prohibits using a Claude Pro or Max plan in OpenCode, and that OpenCode stopped bundling the plugins that allowed it as of version 1.3.0. For Claude models, the docs point to an API key from the Anthropic Console.

## Which model providers does each tool support?

Claude Code speaks the Anthropic Messages format and runs Claude models, and `/model` switches between them during a session. OpenCode connects to each provider's own API and to any OpenAI-compatible service. You add a provider with `/connect` or in `opencode.json`, then pick any of their models with `/models`, so one session can move between Claude, GPT and Gemini.

These are the models Claude Code runs on 5abeer, at our price per million tokens. The default is [`claude-sonnet-5.5`](https://5abeer.ai/en/models/claude-sonnet-5.5):

| Model | Id | Input (ours) | Output (ours) | Context |
| --- | --- | --- | --- | --- |
| Claude Sonnet 5.5 | `claude-sonnet-5.5` | $0.60 | $3 | 1M |
| Claude Opus 5.5 | `claude-opus-5.5` | $1.20 | $6 | 1M |
| Claude Fable 5.1 | `claude-fable-5.1` | $3 | $15 | — |
| Claude Fable 5 | `claude-fable-5` | $3 | $15 | 1M |
| Claude Opus 4.6 | `claude-opus-4.6` | $1.50 | $7.50 | 1M |
| Claude Opus 5 | `claude-opus-5` | $1.50 | $7.50 | 1M |
| Claude Sonnet 5 | `claude-sonnet-5` | $0.60 | $3 | 1M |
| Claude Sonnet 4.6 | `claude-sonnet-4.6` | $0.90 | $4.50 | 1M |
| Claude Haiku 4.5 | `claude-haiku-4.5` | $0.30 | $1.50 | 200K |

And these are the models OpenCode runs on 5abeer:

| Model | Id | Input (ours) | Output (ours) | Context |
| --- | --- | --- | --- | --- |
| Claude Sonnet 5.5 | `claude-sonnet-5.5` | $0.60 | $3 | 1M |
| Claude Opus 5.5 | `claude-opus-5.5` | $1.20 | $6 | 1M |
| GPT-6.1 Sol | `gpt-6.1-sol` | $0.60 | $3 | 922K |
| Gemini 4 Argon | `gemini-4-argon` | $0.60 | $3 | — |
| Claude Fable 5.1 | `claude-fable-5.1` | $3 | $15 | — |
| Claude Fable 5 | `claude-fable-5` | $3 | $15 | 1M |
| Claude Opus 4.6 | `claude-opus-4.6` | $1.50 | $7.50 | 1M |
| Claude Opus 4.7 | `claude-opus-4.7` | $1.50 | $7.50 | 1M |
| Claude Opus 5 | `claude-opus-5` | $1.50 | $7.50 | 1M |
| Claude Sonnet 5 | `claude-sonnet-5` | $0.60 | $3 | 1M |
| Claude Sonnet 4.6 | `claude-sonnet-4.6` | $0.90 | $4.50 | 1M |
| Claude Haiku 4.5 | `claude-haiku-4.5` | $0.30 | $1.50 | 200K |
| GPT-6 Astra | `gpt-6-astra` | $3 | $15 | — |
| GPT-6 Sol | `gpt-6-sol` | $0.60 | $3 | 922K |
| GPT-6 Luna | `gpt-6-luna` | $0.03 | $0.15 | 922K |
| GPT-5.6 Luna | `gpt-5.6-luna` | $0.06 | $0.36 | 400K |
| GPT-5.6 Terra | `gpt-5.6-terra` | $0.60 | $3.60 | 400K |
| GPT-5.6 Sol | `gpt-5.6-sol` | $1.20 | $6 | 400K |
| GPT-5.5 | `gpt-5.5` | $1.50 | $9 | 1.05M |
| GPT-5.4 | `gpt-5.4` | $0.75 | $4.50 | 1.05M |
| GPT-5.4 Mini | `gpt-5.4-mini` | $0.23 | $1.35 | 400K |
| GPT-5.2 | `gpt-5.2` | $0.53 | $4.20 | 272K |
| Gemini 2.5 Pro | `gemini-2.5-pro` | $0.38 | $3 | 1M |
| Gemini 3.8 Flash | `gemini-3.8-flash` | $0.23 | $1.13 | — |
| Gemini 3 Flash | `gemini-3-flash` | $0.15 | $0.90 | 1M |
| Gemini 3.1 Pro | `gemini-3.1-pro` | $0.60 | $3.60 | 1M |

## Which one should you pick?

| Your situation | The tool that fits |
| --- | --- |
| You have a Claude plan | Claude Code, which the plan includes |
| You want Claude models on an API key | Either one: both run Claude models on a key |
| You want Claude, GPT and Gemini models in one tool | OpenCode, with a key for each provider |
| You pay for ChatGPT Plus or Pro, GitHub Copilot, GitLab Duo or SuperGrok | OpenCode, which signs in with those subscriptions |
| You want to read or change the agent's source | OpenCode, under the MIT license |

## How do you move a project between them?

OpenCode 1's docs list three Claude Code files it reads as fallbacks, so most projects open in OpenCode as they are:

- A project's `CLAUDE.md`, when the project has no `AGENTS.md`.
- `~/.claude/CLAUDE.md`, when there is no `~/.config/opencode/AGENTS.md`.
- Skills in `.claude/skills/` and `~/.claude/skills/`. OpenCode needs `name` and `description` in each `SKILL.md`, with the name matching its folder, so check both on skills you wrote for Claude Code.

`OPENCODE_DISABLE_CLAUDE_CODE=1` turns off all of that `.claude` support, `OPENCODE_DISABLE_CLAUDE_CODE_PROMPT=1` turns off only `~/.claude/CLAUDE.md`, and `OPENCODE_DISABLE_CLAUDE_CODE_SKILLS=1` only `.claude/skills`. The rest moves by hand:

| In Claude Code | In OpenCode |
| --- | --- |
| Subagents in `.claude/agents/` | Agent files in `.opencode/agents/`, with `mode: subagent` in the frontmatter |
| Custom commands in `.claude/commands/` | Command files in `.opencode/commands/` |
| MCP servers under `mcpServers` in `.mcp.json` | Servers under `mcp` in `opencode.json`, each with `type` set to `local` or `remote` |
| `claude -p "…"` in scripts | `opencode run "…"` |
| `/model` to switch models | `/models` |

Going the other way, Claude Code 2.1.277 or later reads `AGENTS.md` when there is no `CLAUDE.md` or `CLAUDE.local.md` in the folder or above it. Watch a project that has both files: by default OpenCode reads only `AGENTS.md` and Claude Code reads only `CLAUDE.md`. To share instructions, keep a single `AGENTS.md`, or set **Project instructions** to `claude-md-and-agents-md` in Claude Code's `/config` so it also loads `AGENTS.md`, and put what both tools need there. The Claude Code side of each piece is in [MCP in Claude Code](https://5abeer.ai/en/guides/claude-code-mcp) and [Claude Code skills](https://5abeer.ai/en/guides/claude-code-skills).

## How do you run both on 5abeer?

5abeer serves Claude models in the Anthropic Messages format for Claude Code, and Claude, GPT and Gemini models in the OpenAI format for OpenCode. Each key works with one provider's models, so one Claude key works in both tools. All your keys draw on one balance, and every API price is below the model's official price.

### 1. Create your keys

Create a Claude key, plus one for each other provider you want in OpenCode, as in [Create a key](https://5abeer.ai/en/docs/start/keys.md#create).

### 2. Set up Claude Code

Put these settings in `~/.claude/settings.json`, with your Claude key in place of `YOUR_5ABEER_API_KEY`:

`~/.claude/settings.json`

```json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.5abeer.ai",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_5ABEER_API_KEY",
    "ANTHROPIC_MODEL": "claude-sonnet-5.5"
  }
}
```

Run `claude` in your project. `/status` shows the base URL in use. The full steps are in [Claude Code setup](https://5abeer.ai/en/docs/apps/claude-code.md).

### 3. Set up OpenCode

Install OpenCode 1 as in [OpenCode setup](https://5abeer.ai/en/docs/apps/opencode.md#install). Put this config in `opencode.json` in your project or in `~/.config/opencode/opencode.json`, and set `KHABEER_API_KEY` to your Claude key:

`opencode.json`

```json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "khabeer": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "5abeer",
      "options": {
        "baseURL": "https://api.5abeer.ai/v1",
        "apiKey": "{env:KHABEER_API_KEY}"
      },
      "models": {
        "claude-sonnet-5.5": {
          "name": "Claude Sonnet 5.5"
        }
      }
    }
  },
  "model": "khabeer/claude-sonnet-5.5"
}
```

Run `opencode` in your project and pick a model with `/models`. To add GPT or Gemini models, add a provider entry with that provider's key, as in [Claude and GPT models together](https://5abeer.ai/en/docs/apps/opencode.md#faq-providers).

You can also skip the keys. Every 5abeer Bundle plan runs both tools, and the Claude plan runs Claude Code. The 5abeer AI app sets each tool up on your plan, with no API key and no files to edit, as in [What each plan runs](https://5abeer.ai/en/docs/subscriptions/plan-apps.md#open-source). 5abeer's plans cost less than the official ones, with details on the [OpenCode page](https://5abeer.ai/en/apps/opencode) and the [Claude Code page](https://5abeer.ai/en/apps/claude-code).

Current 5abeer Bundle plan prices are on the pricing page: https://5abeer.ai/en/pricing

## Questions

### Is OpenCode free?

The tool is: it's open source under the MIT license, and its site says it comes with a set of free models you can use without an account. Other models are paid: you pay their provider per token on an API key, or through a subscription OpenCode signs in with.

### Can I use my Claude Pro or Max plan in OpenCode?

No. OpenCode's docs say Anthropic explicitly prohibits it, and OpenCode stopped bundling the plugins that did it as of version 1.3.0. Use a Claude API key in OpenCode, or keep the plan for Claude Code.

### Which subscriptions can OpenCode sign in with?

Its docs name ChatGPT Plus or Pro, GitHub Copilot, GitLab Duo and xAI's SuperGrok, each connected with `/connect`. Some Copilot models may need a Copilot Pro+ plan, and GitLab Duo's agent platform needs a GitLab Premium or Ultimate subscription.

### Which OpenCode version should I install?

OpenCode 1, which our setup is written for. Both versions use the `opencode` command and are not installed side by side by default, and Homebrew's plain `brew install opencode` now installs OpenCode 2, so use an install command from [OpenCode setup](https://5abeer.ai/en/docs/apps/opencode.md#install).

### Which tool costs less on an API key?

It depends on the tokens, not the tool. On 5abeer a model has one price per token whichever tool calls it, but each tool builds its own requests, so the same task can use a different number of tokens. Give each tool its own key, run the same task in both, and compare each key's usage, as in [Track your usage](https://5abeer.ai/en/docs/start/pricing.md#usage).

## Sources

Checked on 2026-11-03:

- OpenCode: [Home page FAQ](https://opencode.ai), docs: [Intro](https://opencode.ai/docs), [Providers](https://opencode.ai/docs/providers), [Rules](https://opencode.ai/docs/rules), [Skills](https://opencode.ai/docs/skills), [Agents](https://opencode.ai/docs/agents), [Commands](https://opencode.ai/docs/commands), [MCP servers](https://opencode.ai/docs/mcp-servers), [CLI](https://opencode.ai/docs/cli), [IDE](https://opencode.ai/docs/ide) and the [OpenCode license](https://github.com/anomalyco/opencode/blob/dev/LICENSE)
- Claude Code docs: [Overview](https://code.claude.com/docs/en/overview), [Manage costs](https://code.claude.com/docs/en/costs), [How Claude remembers your project](https://code.claude.com/docs/en/memory), [Subagents](https://code.claude.com/docs/en/sub-agents), [MCP](https://code.claude.com/docs/en/mcp) and the [Claude Code license](https://github.com/anthropics/claude-code/blob/main/LICENSE.md)

> 5abeer is an independent service, not affiliated with OpenAI, Anthropic or Google.

## Get started

Compare every model's price on the [API page](https://5abeer.ai/en/api), or create a key and set up either tool.
