OpenCode vs Codex: plans, limits and both measured on one machine

Pick OpenCode to choose the model per task: it is free, MIT-licensed and connects to more than 75 providers, a ChatGPT plan among them. Pick Codex for OpenAI's models on a ChatGPT plan, from $20 a month, in the CLI, the desktop app, the web and on iOS. On one machine the median OpenCode call cost $0.002, the median Codex call $0.032. Read 14 October 2026.

Dmitriy Solodukha · checked against Caprock v0.115.1

OpenCode itself
$0
OpenCode itself
you pay the model's provider
the cheapest plan with Codex in the CLI
$20
the cheapest plan with Codex in the CLI
ChatGPT Plus
median OpenCode call
$0.002
median OpenCode call
9,309 calls, May – Jun 2026 · mostly DeepSeek V4 Pro
median Codex call at API rates
$0.032
median Codex call at API rates
16,415 calls, mostly 10–28 Sep 2026

Caprock reads both agents. A call is one request to the model. OpenCode's costs are its own; Codex's are at OpenAI's list prices. The samples ran months apart on different models — not a verdict on code quality.

The short answer

Pick OpenCode or Codex

Pick OpenCode if…

  • You want to pick the model per task: OpenCode connects to more than 75 providers, plus local models.
  • You want an agent that costs nothing itself: you pay the provider, or sign in with ChatGPT Plus or Pro, GitHub Copilot, or OpenCode's own Go plan from $10.
  • You run cheap open models: the median OpenCode call here cost $0.002, mostly on DeepSeek V4 Pro.

Pick Codex if…

  • You want OpenAI's GPT-6 models with a published estimate of how many messages fit in five hours.
  • You want one agent across the CLI, an IDE extension, a desktop app, the web and iOS, on one ChatGPT plan.
  • You want a heavy plan without a five-hour window: ChatGPT Pro has none, at $100, $200 or $500 a month.

Facts about price, limits and where each runs, read 14 October 2026. Not a verdict on which writes better code.

Side by side

OpenCode vs Codex, side by side

OpenCode and Codex, from each one's documentation, read 14 October 2026
OpenCodeCodex
Made byAnomalyOpenAI
What it isAn agent for the terminalAn agent in ChatGPT plans
Where it runsTerminal, desktop app, IDE extensionCLI, IDE extension, web, desktop, iOS
Models75+ providers, plus Zen and GoOpenAI's GPT models
Open sourceYes, MITThe CLI, Apache-2.0
Cheapest way inFree; you pay for the modelChatGPT Plus, $20 a month
BilledBy the provider, Zen or GoPlan fee in usage limits, or per token
A ChatGPT planSign in with Plus or ProYes
Read by CaprockYes, every sessionYes, every session

Plans, per month

OpenCode pricing vs Codex pricing

Monthly price of each plan on one axis. OpenCode itself is free; its plans pay for models. Team plans are per user.

OpenCode

  • OpenCode$0free, open source
  • OpenCode Go$10mostly open models; capped per model
  • OpenCode Go Plus$40the same models, higher caps
  • OpenCode Zen — per request · prepaid credit
  • Your own key — the provider's price

Codex

  • ChatGPT Free$0desktop app
  • ChatGPT Go$8desktop app
  • ChatGPT Plus$20web, CLI, IDE, iOS
  • Business, a user$25$20 billed annually; 2+ users
  • ChatGPT Pro$100Pro 100; no five-hour limit
  • ChatGPT Pro$200Pro 200; more usage than Pro 100
  • ChatGPT Pro$500Pro 500; adds Ultrafast
  • Enterprise — not published

Both columns share one axis, $0 to $500 a month. Read 14 October 2026 from OpenCode's Go and Zen docs and OpenAI's Codex pricing page. Go Plus has the same models as Go with higher caps. Codex on ChatGPT Free and Go is for quick and lightweight tasks.

Usage limits

Usage limits: dollar caps per model against a five-hour window

How OpenCode and Codex cap use, read 14 October 2026
OpenCodeCodex
How usage is cappedGo: dollar caps per modelFive hours on Plus, Business; none on Pro
Five hoursGo: a fifth of the monthly capEstimated messages, by model
Weekly limitGo: half the monthly capMay also apply
Past the limitFree models, or your balanceCredits, or an API key
On your own keyBilled by the providerBilled per token by OpenAI
OpenCode's limits apply to Go; Zen and your own key bill per request or token instead. OpenAI calls its per-plan figures estimates that “are not fixed message limits”.

In Caprock

Codex's windows, beside your other agents

Codex writes its five-hour and weekly windows into its session files; Caprock shows them under Codex's name, as of the last thing Codex wrote. Caprock does not read OpenCode Go's caps.

Caprock's Plan limits panel. On ChatGPT Pro, Codex reports only the week.

Per million tokens

Per-token prices of the models measured

Per million tokens, each maker's own list. On a plan, neither side pays these per call.

Model prices per million tokens, read 14 October 2026
ModelInputCache readOutput
DeepSeek V4 ProOpenCode's main model here; off-peak to peak$0.66–1.32$0.022–0.044$1.98–3.96
GPT-6 AstraCodex$10$1$50
GPT-6.1 SolCodex$2$0.10$10
GPT-6 SolCodex$2$0.20$10
GPT-6 LunaCodex$0.10$0.01$0.50
Read 14 October 2026 from OpenAI's and DeepSeek's API pricing pages. OpenAI's rates are for input up to 272K tokens; above it input costs double and output 1.5×. DeepSeek's peak hours are 01:00–04:00 and 06:00–10:00 UTC on weekdays. OpenCode runs GPT models too, at OpenAI's rates on an API key. MiniMax M3 is not on this table.

Measured · read 3 October 2026

What each cost on one machine

Caprock reads OpenCode's database and Codex's transcripts into one table. The two samples are months apart, on different models — the dates are on each bar.

OpenCode
9,309 calls on 21 active days, May – Jun 202684% DeepSeek V4 Pro, 16% MiniMax M3
Codex
16,415 calls, mostly 10–28 Sep 2026a third on Luna models

Median cost per call

  • OpenCodeMay – Jun 2026$0.002
  • Codexmostly 10–28 Sep 2026$0.032
OpenCode's own cost; Codex at OpenAI's list prices. A third of the Codex calls ran its Luna models.

Median context per call

  • OpenCodeMay – Jun 2026298K
  • Codexmostly 10–28 Sep 2026128K
Tokens of conversation each call re-sends. The OpenCode calls carried more and still cost less.

Cache hit

  • OpenCodeMay – Jun 202698.7%
  • Codexmostly 10–28 Sep 202697.6%
Share of input read from the cache. Both re-read almost everything.

What the tool calls were

  • OpenCodeMay – Jun 2026
  • Codexmostly 10–28 Sep 2026
ShareOpenCodeCodex
Shell39%81%
Everything else61%19%
Share of tool calls. OpenCode's shell is bash, Codex's is exec; OpenCode spent more of its calls reading and editing files.

Both at once

OpenCode and Codex in one window

Either agent in a Caprock tab, its own interface untouched, with the session's cost, context and processes beside it; a session you start in your own terminal gets the same panel.

OpenCode in a Caprock tab, on DeepSeek V4 Pro. A Codex tab opens the same way, from New agent.

Your own machine

Run both, and measure both.

Caprock is a free, open-source desktop app that keeps the ledger of OpenCode and Codex alike, with Claude Code and Gemini CLI: who is waiting on you, who is stuck, how close each plan is to its limit, and each pull request with what it cost, every call at list price. It reads OpenCode's database read-only and Codex's transcripts, so sessions you start elsewhere show up too. Local; no account.

Download for Mac

Notarized by Apple. One file for Apple silicon and Intel, macOS 13 or later.

Or run it yourself:

curl -fsSL https://caprock.dev/mac.sh | sh

Paste in Terminal: it installs Caprock and opens it.Or with Homebrew: brew install --cask dspv/tap/caprock-app

The full guide

OpenCode vs Codex, step by step

OpenCode is an open-source terminal agent that runs any of more than 75 providers' models, OpenAI's included; Codex is OpenAI's own agent, included in ChatGPT plans, and runs OpenAI's GPT models. OpenCode costs nothing itself — you pay the provider, or sign in with a plan — while Codex starts with ChatGPT Plus at $20 a month. They overlap more than the names suggest: OpenCode can sign in with ChatGPT Plus or Pro.

OpenCode vs Codex pricing

Read on 14 October 2026 from OpenCode's docs and OpenAI's Codex pricing.

  • OpenCode: the agent is free. You bring a provider — an API key, a GitHub Copilot subscription, a ChatGPT Plus or Pro sign-in — or use OpenCode's own: Zen bills per request from prepaid credit, and Go is $10 a month and Go Plus $40, both for the same set of mostly open models, with a cap per model.
  • Codex: ChatGPT Plus at $20 a month includes it; Pro is $100, $200 or $500; Business is $20 a user billed annually, or $25 monthly, for two or more users. Free and Go include Codex "for quick coding tasks" and "lightweight coding tasks". With an API key, Codex bills per token at OpenAI's rates.

What you pay for differs. OpenCode's price is the model's price, so the same agent can cost a fraction of a cent per call on an open model or the full GPT rate on OpenAI's. Codex's price is a plan, and the plan's limits decide how much you get.

Usage limits

  • OpenCode Go caps each model in dollars a month, with a five-hour cap of a fifth of that and a weekly cap of half. Past the cap you can keep using the free models, or switch on "Use balance" to draw on pay-as-you-go credit. Zen and your own key have no plan cap; the provider bills you.
  • Codex on Plus and Business has a five-hour window and a weekly limit; OpenAI publishes estimated messages per five hours by model, 15–160 on GPT-6.1 Sol, and calls them estimates, "not fixed message limits". Pro has no five-hour limit. The two windows, by plan, are in Codex usage limits.

Models and what they cost per token

Codex runs OpenAI's GPT models: GPT-6.1 Sol at $2 per million input tokens and $10 output, GPT-6 Astra at $10 and $50, GPT-6 Luna at $0.10 and $0.50, read on 14 October 2026. Above 272K input tokens input costs double and output 1.5×.

OpenCode runs whatever its providers offer, GPT models among them at the same OpenAI rates on a key. The model most of its calls here ran, DeepSeek V4 Pro, lists $0.66–1.32 input, $0.022–0.044 for a cache hit and $1.98–3.96 output per million tokens, off-peak to peak.

Both, measured on one machine

Caprock reads both agents — OpenCode's own database, read-only, and Codex's transcripts in ~/.codex — into one table, read on 3 October 2026. A call is one request to the model.

$0.002
median OpenCode call, 9,309 calls, May–Jun 2026
$0.032
median Codex call at list prices, 16,415 calls, Sep 2026
  • Cost. OpenCode's figure is its own: it computes each call's cost and Caprock passes it through. Codex records tokens only, so Caprock prices each call at OpenAI's list rate; on a ChatGPT plan that is an equivalent, not a charge. 84% of the OpenCode calls ran DeepSeek V4 Pro and the rest MiniMax M3; a third of the Codex calls ran its Luna models.
  • Context. The median OpenCode call re-sent 298K tokens of conversation, the median Codex call 128K. The OpenCode calls carried more and still cost less, because DeepSeek reads its cache for cents.
  • Cache. 98.7% of OpenCode's input and 97.6% of Codex's came from the cache: both re-read almost everything.
  • Tools. 81% of Codex's tool calls were shell commands, against 39% of OpenCode's, which spent more of its calls reading and editing files.

The samples ran months apart, on different projects and different models. It says what the work cost, read the same way for both, not which agent writes better code.

Which one to pick

If you want to choose the model per task, or run cheap open models, OpenCode fits, and costs nothing until you pick a provider. If you want OpenAI's GPT-6 models on one flat plan, across the CLI, the desktop app, the web and iOS, Codex fits; Pro drops the five-hour window. If you already pay for ChatGPT, you can try both on it.

Each against Claude Code: OpenCode vs Claude Code and Codex vs Claude Code. The plans in full: OpenCode pricing and Codex usage and cost.

Run both, side by side

Caprock is a free, open-source desktop app that records every session of both agents on your machine, started in its own tabs or in any terminal, and prices each call per session and per repository: OpenCode's own figure, and for Codex a list-price estimate beside its plan windows. Nothing leaves your machine. Install Caprock.

Questions people ask

Is OpenCode better than Codex?
Neither across the board. OpenCode lets you pick from 75+ providers and costs nothing itself; Codex runs OpenAI's GPT models on a ChatGPT plan. This page compares price, limits and measured cost, not code quality.
Can I use ChatGPT Plus in OpenCode?
Yes. OpenCode's OpenAI provider has a ChatGPT Plus/Pro sign-in, or takes an API key. Its docs do not say how those calls count against your plan's Codex limits.
Is OpenCode free?
The agent is, under the MIT licence. You pay the model's provider, or use OpenCode Go at $10 or $40 a month, or Zen's per-request credit.
Is Codex open source?
The Codex CLI is, under Apache-2.0. Using it on OpenAI's models needs a ChatGPT plan or an API key.
Which is cheaper, OpenCode or Codex?
It depends on the model. On one machine the median OpenCode call cost $0.002, mostly on DeepSeek V4 Pro, and the median Codex call $0.032 at OpenAI's list prices — months apart, on different models.

Sources