Last updated: May 2026
OpenAI Codex is OpenAI's code-specialized AI system. In 2026 it exists in two forms: Codex CLI — an open-source terminal agent similar to Claude Code — and Codex in ChatGPT — the agentic coding experience built into ChatGPT's web and desktop apps. Both use OpenAI's GPT-5 Codex model family, optimized for code generation, refactoring, and review.
Codex CLI is open source and free to download and run. You pay for the model API calls via your OpenAI API key — there is no Codex CLI subscription. For Codex inside ChatGPT, access is included with ChatGPT Plus ($20/month) and higher paid plans.
| Access method | Price | What you get |
|---|---|---|
| Codex CLI | Free (+ API costs) | Open-source terminal agent, BYOK |
| ChatGPT Plus | $20/month | Codex agent in ChatGPT web/desktop |
| ChatGPT Pro | $200/month | Expanded, priority-speed Codex agent |
| ChatGPT Business | $30/user/month | Codex in team workspace |
| Enterprise | Custom | Higher limits, compliance controls |
There is no standalone Codex subscription — you access it through a ChatGPT plan or the CLI with your API key.
OpenAI's Codex model family as of May 2026:
As of April 2026, Codex switched to token-based billing. Rate: gpt-5.1-codex-mini at $0.25/million input tokens and $2.00/million output tokens (API). Heavier models cost more.
Codex CLI is a terminal-based coding agent — you run it from the command line, give it a task in plain English, and it reads your files, writes code, runs tests, and commits to git. It operates on your local filesystem. OpenAI claims it is approximately 4× more token-efficient than Claude Code, meaning your API budget stretches further per task.
The open-source nature means you can inspect the code, run it without vendor lock-in, and contribute improvements.
Both are terminal-based autonomous coding agents. The key differences:
| OpenAI Codex CLI | Claude Code | |
|---|---|---|
| Cost | Free + API costs | $20/month (Pro subscription) |
| Model | GPT-5 Codex family | Claude Sonnet/Opus 4.x |
| Token efficiency | ~4× more efficient (OpenAI claim) | Higher per-task quality on complex reasoning |
| Open source | ✓ (CLI) | ✗ |
| Subscription required | No (CLI) | Yes (Pro, $20/month minimum) |
For developers who want the lowest API cost per task, Codex CLI's token efficiency is a real advantage. For developers who need the strongest reasoning on complex architectural tasks, many prefer Claude Code with Opus 4.7. See Claude Code FAQ for a full breakdown.
Cursor is an in-editor AI assistant — it provides tab autocomplete, inline edits, and an agent inside a VS Code-based IDE. Codex is a terminal agent and a ChatGPT feature — no IDE integration, no autocomplete. Many developers use both: Cursor for active development and Codex CLI for batch tasks and automation scripts.
OpenAI estimates $100–200 per developer per month for typical heavy usage. Actual cost varies significantly based on model choice and session complexity. Light users (a few sessions per week) stay well under $50/month. The CLI's token efficiency means you typically get more work done per dollar compared to less efficient agents.
Yes. Codex models are available through the OpenAI API at per-token rates. This is how developers build tools and automations on top of Codex — CI/CD pipelines that auto-fix failing tests, code review bots, automated refactoring scripts. The CLI uses the same API under the hood. See the OpenAI Codex listing for technical details.