Codex
The Short Version
Codex is OpenAI’s AI coding agent, built to handle real software development tasks, not just suggest code. You give it a task, and it reads the relevant code, makes changes, runs tests, and reports back. It runs where you prefer: in your terminal, in your editor, or in OpenAI’s cloud environments, so a long job can keep going while your laptop is closed.
Where Codex Runs
| Surface | What it is for |
|---|---|
| Codex CLI | A terminal agent that works on your local checkout. The CLI is open source. |
| IDE extension | Codex inside your editor, working on the files you have open |
| Codex Cloud | Tasks that run in OpenAI-hosted environments, which you can reuse across tasks |
| ChatGPT apps | Start, follow, and review Codex tasks from the ChatGPT web, desktop, or mobile app |
Codex also connects to GitHub and can run as a GitHub Action. Codex Security Cloud, a scanner for connected GitHub repositories, is in research preview.
Models and Pricing
Codex is built around OpenAI’s own models. As of October 2026, paid ChatGPT plans run it on GPT-6.1 Sol, which OpenAI positions as close to GPT-6 Astra on agentic coding at about a fifth of Astra’s token price. Astra is available for the hardest tasks, and an Ultrafast mode for Astra is offered on the $500 Pro plan and eligible Enterprise and Edu workspaces at a much higher usage cost. Since October 26, 2026, GPT-6.1 Terra has been rolling out in Codex on Plus, Pro, Business, Enterprise, and Edu plans. It costs half as much as Sol in the API and is built for computer use and reasoning about screenshots, which makes it a candidate for UI testing, browser-driven checks, and repetitive steps where Sol is more than the job needs. In the CLI you can pick it with codex -m gpt-6.1-terra or the /model command. See ChatGPT for the full model lineup and what Terra is for.
Codex usage is included in ChatGPT plans from Plus upward, up to each plan’s limits, and it is also available through the API. Long tasks on strong models draw down those limits quickly, so it is worth reading How to Estimate an AI Agent’s Cost Before It Starts Working and using model routing rather than sending everything to Astra.
What Codex Is Best For
- Writing new features: describe what you want and Codex implements it
- Bug fixing: point it at an error or failing test and let it find the cause
- Refactoring: restructure existing code while preserving behavior
- Writing tests: generate test coverage for existing functions and classes
- Understanding unfamiliar codebases: ask it to explain how specific code works
- Long, hands-off tasks: start a cloud task and check the result later from any device
How Codex Differs From Other Coding Tools
Some AI coding tools, like GitHub Copilot’s inline suggestions or Cursor’s tab completion, help while you type. Codex is an AI coding agent: give it a task, it works through the steps, and reports back with a result. That makes it closer to Claude Code, OpenCode, or Devin than to a code completion tool.
You can shape how it works with skills, plugins, and MCP servers, and set how much it may do without asking through its sandbox and approval settings.
Honest Limitations
- OpenAI models only. Codex is built around OpenAI’s lineup. The independent Codex Router project can add other models to the Codex app, but that is outside OpenAI’s support.
- Usage limits on plans. Heavy use of GPT-6 Astra can use up a large share of a plan’s allowance in a single long task.
- Best with clear, well-scoped tasks. Vague or highly complex requests need more guidance.
- Always review before using. AI-generated code needs human review and tests before going to production.
- Data terms depend on your plan. Code is sent to OpenAI under your plan’s terms; business plans exclude content from training by default. Check before using it on sensitive code.
How Codex Compares
- Codex vs Claude Code: OpenAI’s and Anthropic’s coding agents side by side
- OpenCode vs Codex: an open, provider-neutral agent versus OpenAI’s integrated one
- Muse Code vs Codex: Meta’s terminal agent versus Codex
- Codex vs Cursor: a task-based agent versus an AI-native editor
Alternatives Worth Knowing
- Claude Code, Anthropic’s coding agent for the terminal, IDEs, desktop, and web
- OpenCode, an open-source agent that works with many model providers
- Meta Muse Code, Meta’s terminal coding agent
- Cursor, an AI-native editor with its own agent mode
- Devin, a more autonomous AI software engineer
Continue learning
Explore related guides, tools, workflows, and prompts that help you go deeper into this topic.
See how this tool fits into a workflow
Browse step-by-step AI workflows that use ChatGPT, Claude, Gemini, and other tools.
Frequently Asked Questions
What is Codex best for?
Codex is best for developers who want an AI coding agent that can handle complete development tasks: writing code, fixing bugs, running tests, and making changes across a codebase without needing to manually guide each step. Its cloud environments also suit long tasks you want to start and check from another device.
How is Codex different from ChatGPT for coding?
Codex is a dedicated coding agent that works inside your repository, runs commands and tests, and completes multi-step tasks end to end. Chat in ChatGPT can suggest and explain code, but Codex can actually execute and iterate on a task.
Does Codex run locally or in the cloud?
Both. The Codex CLI and IDE extension work on your own machine, and Codex Cloud runs tasks in OpenAI-hosted environments that you can start or check from the ChatGPT web, desktop, or mobile apps. The CLI is open source; the cloud environments and model access are run by OpenAI.
Which model does Codex use?
As of October 2026, Codex on paid ChatGPT plans uses GPT-6.1 Sol, with GPT-6 Astra available for the hardest tasks and GPT-6.1 Terra, a cheaper computer-use model, rolling out since October 26. Model options change often, so check the model picker in Codex for what your plan includes.
Last updated: