Key takeaways

  • Codex comes with ChatGPT plans from Free to Pro at $500 a month or runs on an API key, and is built for OpenAI's GPT-6 models.
  • OpenCode is a free MIT-licensed agent from Anomaly that connects to more than 200 providers, including a ChatGPT Plus or Pro plan, GitHub Copilot and local models.
  • On Artificial Analysis's Coding Agent Index, Codex with GPT-6 Astra scored 53 and OpenCode with GLM-5.3 scored 40, a gap that mostly reflects the models.

Codex vs OpenCode comes down to who you want to pay and which models you want to run. Codex is OpenAI's coding agent, paid for through a ChatGPT plan or an API key and built around OpenAI's GPT models. OpenCode is a free, MIT-licensed agent from Anomaly that connects to more than 200 model providers, including your ChatGPT plan, GitHub Copilot and local models.

Both run in a terminal, both have a desktop app, and both read your repository, edit files and run commands. This comparison is based on each product's docs, pricing pages, GitHub repositories and published benchmark results, all read on November 15, 2026.

Codex vs OpenCode at a glance

Codex OpenCode
Made by OpenAI Anomaly
License CLI, SDK and app server: Apache-2.0. IDE extension and Codex cloud: closed MIT
GitHub stars (Nov 15, 2026) 135.3k (openai/codex) 226.9k (anomalyco/opencode)
Where it runs CLI, IDE extension, ChatGPT desktop, web and mobile apps, Codex cloud Terminal UI, desktop app (beta), web, iPhone and Android apps, SDK
Models OpenAI's GPT-6 family, plus custom providers with a Responses API endpoint and local models through --oss 200+ providers through Models.dev, including OpenAI, Anthropic, Google Vertex, Bedrock, OpenRouter and local models
How you pay ChatGPT plan (Free to $500 a month) or API usage Free tool. Bring a provider, use free models, or buy OpenCode Go from $10 a month
Cloud tasks Yes, Codex cloud (ChatGPT sign-in only) No hosted cloud agent in the docs read
Code contributions Issues only; no outside pull requests Open repository with 1,092 contributors

What Codex is

Codex is the coding agent inside OpenAI's ChatGPT products. The docs list it on the ChatGPT desktop, mobile and web apps, the Codex CLI, a Codex IDE extension and Codex cloud, which runs tasks in OpenAI's hosted environment. The GitHub README says the IDE extension works in VS Code, Cursor and Windsurf, and codex app opens the desktop app. It connects to GitHub, GitLab (in beta), Slack and Linear, and runs unattended through codex exec, a GitHub Action and the Codex SDK.

In a terminal, the CLI docs list resumable chats, screenshot input, subagents (helper agents that each take part of a task), web search, code review, handoff to Codex cloud and MCP, the protocol that lets an agent call outside tools. Permission modes and a sandbox decide when it may edit files or run commands without asking.

What OpenCode is

OpenCode is an open-source coding agent built by Anomaly. Its home page lists a desktop app for macOS, Windows and Linux, a terminal interface, an iPhone app on TestFlight, an Android app on Google Play and an SDK for scripts and CI. Anomaly says more than 22 million developers use it each month.

The README describes two built-in agents. build is the default and has full access. plan is read-only: it refuses file edits and asks before running shell commands. The Tab key switches between them, and a @general subagent handles searches and multistep jobs. The site also lists plugins, MCP servers, custom agents, skills, permissions and undo. We covered the release of OpenCode version 2 earlier.

Open source: how open each one is

OpenCode is MIT-licensed as a whole. Codex is open in parts. OpenAI's open-source page says the CLI, the SDK and the app server live in the Apache-2.0 openai/codex repository. The IDE extension and Codex cloud are not open source. The repository takes bug reports and analysis through issues but "doesn't accept external code contributions or pull requests." Our explainer on whether Codex is open source goes through each part.

In practice that means you can read and fork both CLIs. Only OpenCode takes your patches.

Which models each one supports

Codex is built for OpenAI's models. Its models page recommends four as of November 15, 2026: GPT-6 Astra, the most capable; GPT-6.1 Sol, close to Astra for less; GPT-6.1 Terra, a fast model; and GPT-6 Luna, the most efficient, for high-volume tasks.

Codex can use other models, but with conditions. The advanced config docs have built-in providers for OpenAI, Ollama, LM Studio, Amazon Bedrock and Google Cloud, and a custom provider must offer a Responses API endpoint. Endpoints that only offer Chat Completions don't work. The --oss flag runs Codex against a local model in Ollama or LM Studio.

OpenCode starts from the other end. Its catalog comes from Models.dev, and the providers docs cover OpenAI, Anthropic, Azure, Amazon Bedrock, Google Vertex, GitHub Copilot, OpenRouter and xAI, along with Ollama, LM Studio and vLLM on your own machine. Ollama is found automatically with no account.

  • ChatGPT Plus or Pro. OpenCode can sign in with ChatGPT, and usage then counts against your plan instead of an API bill. It caps input at 500,000 tokens for GPT-6.1 Sol and newer models and 272,000 for older ones by default.
  • GitHub Copilot. OpenCode signs in through GitHub's device login. The account needs Copilot Chat access.

The providers page documents no sign-in with a Claude Pro or Max plan. Anthropic models work with an API key or through another provider.

How much Codex costs

Codex comes with ChatGPT. The pricing page lists these plans as of November 15, 2026:

Plan Price Codex access
Free $0 Included
Go $8 a month Included
Plus $20 a month Included, with five-hour limits
Pro $100, $200 or $500 a month Included, no five-hour limit for now
Business $20 per user a month billed yearly, $25 monthly Included
Enterprise and Edu Contact sales Included
API key No plan, API rates Local use only, no cloud features

Limits are counted in local messages per five hours. OpenAI's estimates for Plus are 5 to 45 messages with GPT-6 Astra, 15 to 160 with GPT-6.1 Sol, 35 to 285 with GPT-6.1 Terra and 350 to 3,000 with GPT-6 Luna. OpenAI calls them estimates, not fixed limits, and says weekly limits may also apply and that cloud tasks use more of the allowance.

More on the Plus tier: is Codex included in ChatGPT Plus.

How much OpenCode costs

OpenCode is free. You pay for the model:

  • Free models. No account needed. The Go docs list three, Beam Free, Iceman Contributor Free and LongCat 2.5 Free, as unlimited "for a limited time." Iceman Contributor Free uses your prompts to train the model, and Beam Free is unavailable in many regions, including China, Russia and Iran.
  • Your own subscription or key. A ChatGPT Plus or Pro plan, GitHub Copilot, or an API key from any provider. You pay that provider's price.
  • OpenCode Go. $10 a month, Go Plus $40 a month, and Go Teams $20 per member a month, as of November 15, 2026. Go covers 32 models, among them GPT 6 Luna, Claude Haiku 5.5, Gemini 4 Argon, Kimi K3.1 Pro, DeepSeek V4 Pro, Qwen3.8 Max and GLM-5.3.

Go limits are set in dollars per model. GLM-5.3, for example, gets $15 of use a month on Go and $120 on Go Plus. Up to 20% of the monthly amount can go in any five hours and 50% in a week. When a limit runs out, the free models keep working.

The OpenCode Console adds team workspaces, usage tracking, budget controls and paid inference for open and proprietary models.

The two tools also overlap. OpenCode lists Codex as a validated client for Go models, so you can run Codex on OpenCode's subscription, and OpenCode can run OpenAI's models on your ChatGPT plan.

How to install each one

Codex, from the CLI docs:

curl -fsSL https://chatgpt.com/codex/install.sh | sh   # macOS and Linux
npm install -g @openai/codex                           # npm
brew install --cask codex                              # Homebrew

On Windows, the docs give a PowerShell installer. Then run codex in a project folder and pick Sign in with ChatGPT or an API key.

OpenCode, from the docs and README:

curl -fsSL https://opencode.ai/v2/install | bash   # install script
npm i -g @opencode/cli@latest                       # npm
brew install anomalyco/tap/opencode-v2              # Homebrew

It is also on the Arch User Repository, mise, Nix and Docker. Windows package managers aren't supported, but Windows binaries are. Inside the app, /connect adds a provider.

Published benchmarks

Coding-agent benchmarks test an agent and a model together. Artificial Analysis publishes the closest thing to a direct comparison, its Coding Agent Index v2.1, which combines FrontierCode-AA 2.0, Terminal-Bench 4.1 and SWE-Atlas-QnA-AA. On its page as read on November 15, 2026, with every model at maximum reasoning effort:

Agent and model Coding Agent Index Terminal-Bench 4.1 Cost per task Time per task
Codex, GPT-6 Astra 53 58 $7.63 26.0 min
Codex, GPT-6.1 Sol 52 54 $1.51 21.9 min
Codex, GPT-6.1 Terra 49 51 $1.53 28.1 min
OpenCode, GLM-5.3 40 40 $5.41 52.8 min

Costs are at API prices, not plan prices, and the page gives no test date. OpenCode was tested only with GLM-5.3, so the gap mostly measures the models, not one harness against the other. OpenCode's runs averaged 17.7 million tokens per task, against 3.47 million for Codex with Astra. The Terminal-Bench leaderboard at tbench.ai showed no Codex or OpenCode entries when read.

Which one to pick

Pick Codex if you already pay for ChatGPT and mostly want GPT models. You get the IDE extension, cloud tasks, and GitHub, GitLab, Slack and Linear integrations, at no extra cost beyond the plan.

Pick OpenCode if you want to switch between providers, use Claude, Gemini or open-weight models, run local models, or change the tool's code. It costs nothing on its own, and a ChatGPT plan still works inside it.

The choice is less binary than it looks. Each tool can run on the other's subscription, so the harness you prefer to work in and the subscription you pay for are two separate decisions. For how Codex compares with Anthropic's agent, see Claude Code vs Codex.

Frequently asked questions

Can I use my ChatGPT subscription in OpenCode?

Yes. OpenCode's providers docs say you can sign in with a ChatGPT Plus or Pro plan, and usage then counts against the plan instead of an API bill. By default it caps input at 500,000 tokens for GPT-6.1 Sol and newer models.

Is OpenCode free?

The tool is free and MIT-licensed. You pay your model provider, use the free models OpenCode offers for a limited time, or buy OpenCode Go from $10 a month, as of November 15, 2026.

Can Codex use local models?

Yes. The Codex CLI runs against a local model in Ollama or LM Studio when you pass the --oss flag. Other custom providers need a Responses API endpoint.

Which is better for GPT models, Codex or OpenCode?

Both can run OpenAI's models on a ChatGPT plan. Codex adds the IDE extension, Codex cloud tasks and OpenAI's integrations, while OpenCode lets you switch to other providers without changing tools.

Sources

  1. Codex pricingOpenAI
  2. Codex modelsOpenAI
  3. Codex CLIOpenAI
  4. Codex advanced configurationOpenAI
  5. Codex open sourceOpenAI
  6. Codex documentationOpenAI
  7. openai/codexGitHub
  8. OpenCodeAnomaly
  9. OpenCode docsAnomaly
  10. OpenCode providersAnomaly
  11. OpenCode GoAnomaly
  12. OpenCode ConsoleAnomaly
  13. anomalyco/opencodeGitHub
  14. Codex vs. OpenCode: Coding Agent IndexArtificial Analysis

Add ClaudeGPT Si as a preferred source on Google