
OpenAI Codex is an AI coding agent from OpenAI that reads your project, edits files, runs commands and tests, and reviews code, from the terminal, your editor, or the cloud.
It is not a separate product you buy on its own. Codex comes with a ChatGPT plan, and the same agent follows you between ChatGPT, the terminal, and your editor. OpenAI calls Codex an AI coding partner built for real engineering work, from hard-to-find bugs to complex refactors.
What OpenAI Codex is
Codex is an agent, not an autocomplete box. You describe a change in plain language, and it reads the files involved, makes the edits, runs checks, and shows you a diff to review. A request can be one failing test or a feature across several files.
A chatbot answers and stops. Codex works through the steps of a task, and it can run several agents at once on different jobs. The AI coding assistant guide explains how this kind of tool differs from a plain chat assistant.

How Codex works in the terminal, editor, and cloud
The terminal is where most developers meet Codex first. Install the CLI, open a project folder, run codex, and sign in with ChatGPT. The usual install is one npm command, npm install -g @openai/codex, and OpenAI also ships an installer script and a Homebrew package.
The CLI is open source under the Apache 2.0 licence, and the Codex repository on GitHub holds the code and docs. The IDE extension brings the same agent into VS Code and editors built on it, including Cursor, with your open files as context. The coding AI guide covers more editor tools.
Codex cloud handles jobs you do not want to babysit. Start a task from ChatGPT on the web, the desktop app, or your phone, and it runs in a cloud environment for your repo while your computer sleeps. The environments are reusable per repo.

The models behind Codex
Codex runs on OpenAI’s GPT-6 family. Plus includes GPT-6.1 Sol and GPT-6 Luna, and GPT-6.1 Terra is also available in Codex on Plus and higher plans. Sol is the stronger model for hard reasoning work and Luna the lighter, faster one. OpenAI publishes estimates, not fixed caps: on Plus it estimates 15 to 160 local messages per five hours on GPT-6.1 Sol, 35 to 285 on GPT-6.1 Terra, and 350 to 3,000 on GPT-6 Luna.
The ranges are wide because a one-line fix costs far less allowance than a long session holding a whole codebase in context. The ChatGPT models guide explains how the wider family fits together. Hit a limit mid-task and the active turn still finishes.

Pricing and plan access
There is no separate Codex subscription. You pay for a ChatGPT plan, and Codex comes with it, sharing one usage pool with ChatGPT Work. Free costs nothing and Go costs $8 a month, but both only get Codex in the desktop app with GPT-6 Luna, subject to rollout.
Plus costs $20 a month and opens up the web, the CLI, the IDE extension, and iOS, plus cloud code review and the Slack integration. Pro starts at $100 a month, with $200 and $500 tiers, and Pro plans currently have no five-hour limit. Business costs $25 per user a month billed monthly, or $20 billed annually. OpenAI’s Codex pricing page lists the current limits. Confirm them before you pay.
The other way in is an API key. Sign in to the CLI, the SDK, or the IDE extension with a key and pay API rates, which suits automation and shared environments like CI. That route has no cloud features, so GitHub code review and Slack are off the table.

Code review, sandbox, and staying in control
Codex reviews pull requests on GitHub, automatically on a repo where you enable it or when you tag @Codex in a pull request. It posts findings, answers questions, and can fix what it finds. GitHub reviews count as code review usage, while a local /review counts against your general allowance.
An agent that edits files needs guardrails, and Codex ships with them on. By default it runs in a sandbox that can write only inside your workspace, with network access off, so a bad command cannot reach the rest of your machine. You choose how much freedom it gets, from read-only work to full access.
Project instructions live in an AGENTS.md file at the root of your repo, which Codex reads at the start of a session. It can then follow your house rules without being told each time, and /init creates the file for you. Keep it short: a large AGENTS.md uses more allowance on every message.

OpenAI Codex vs Claude Code and Cursor
The three tools cover much of the same ground, so the choice comes down to where you like to work and which subscription you already pay for. Claude Code lives in the terminal, runs Anthropic’s models, and suits long, hands-off work. The Claude Code guide covers it in detail.
Codex sits between the two, with the terminal agent, the editor extension, and a cloud mode neither rival matches, all inside the ChatGPT plan many developers already hold. Context.dev compared the three tools on price, models, and safety controls and picked Codex for safe defaults and value.
None of the three removes the need to read the code they write. Review the diff, run your tests, and keep the agent on a branch you can throw away. The Gemini 3 guide covers another model family, and the best AI tools compared puts Codex in a wider field.

Frequently asked questions about OpenAI Codex
What is OpenAI Codex?
OpenAI Codex is an AI coding agent from OpenAI. It reads a project, edits files, runs commands and tests, and reviews code, from the terminal, an IDE extension, or the cloud.
Is OpenAI Codex free?
Codex comes with ChatGPT plans, including Free, but Free only gets Codex in the desktop app with GPT-6 Luna. Full access starts at Plus, which costs $20 a month.
Which model does Codex use?
Plus includes GPT-6.1 Sol and GPT-6 Luna, and GPT-6.1 Terra is also available on Plus and higher plans. Luna handles far more messages per allowance than Sol.
How do I install the Codex CLI?
Install it with npm, the installer script, or Homebrew, then run codex in a project folder and choose Sign in with ChatGPT. The CLI needs Plus or higher on a ChatGPT plan, or an API key instead.
Can Codex review my pull requests?
Yes. Codex reviews GitHub pull requests automatically on repos where you enable it, or when you tag @Codex in a pull request. Local reviews run with /review.
Does Codex work offline?
No. The CLI runs on your machine, but the models run on OpenAI’s servers, so you need an internet connection. The sandbox setting only controls the agent’s own network access.
Is OpenAI Codex better than Claude Code?
It depends on how you work. Claude Code suits long terminal sessions, Codex suits developers who already pay for ChatGPT and want one agent across the terminal, editor, and cloud.