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
- OpenCode docs — providers (75+, ChatGPT Plus/Pro sign-in, Anthropic), read 14 October 2026
- OpenCode docs — Go, read 14 October 2026
- OpenCode docs — Zen
- OpenCode on GitHub — MIT licence
- Codex pricing and usage limits, read 14 October 2026
- Codex on GitHub — Apache-2.0 licence
- OpenAI API pricing, read 14 October 2026
- DeepSeek API pricing, read 14 October 2026
- How Caprock reads Codex transcripts
- Caprock's dated price table
Try it
The record of every coding agent you run, the sessions it did not start included. Free, open source; nothing leaves your machine.
Notarized by Apple. One file for Apple silicon and Intel, macOS 13 or later.
Or run it yourself:
Paste in Terminal: it installs Caprock and opens it.Or with Homebrew: brew install --cask dspv/tap/caprock-app