OpenAI Codex
In short
OpenAI Codex is OpenAI's AI coding agent: it writes, edits and reviews code from a command line, an IDE extension or ChatGPT, on your computer or in the cloud.
What is OpenAI Codex?
Codex is a coding agent made by OpenAI. Given a task in plain language, it reads the relevant code, makes changes across files and runs commands such as tests to check them. It can be used in several places: the Codex CLI in a terminal, an extension for VS Code and similar editors, the ChatGPT apps, and Codex Cloud, which works on tasks in isolated cloud environments so several can run in parallel.
The Codex CLI is open source under the Apache 2.0 license and runs locally on your computer. Projects give Codex standing instructions in an AGENTS.md file, a convention that several coding agents read, and it can connect to outside tools through the Model Context Protocol. Permission modes and sandboxing control what it may change and run without asking.
Codex Cloud works like handing tickets to a remote teammate: you queue up tasks, it works on each one in its own copy of the repository, and you come back to review the proposed changes before anything is merged.
The name has a history. In 2021 OpenAI released an earlier model also called Codex, which powered the first version of GitHub Copilot and was retired in 2023. Today's Codex is a different product, an agent built on OpenAI's newer models. It comes with paid ChatGPT plans and can also run with an OpenAI API key.
Key takeaways
- Codex is OpenAI's AI coding agent.
- It runs in a terminal (the Codex CLI), in IDE extensions, in the ChatGPT apps and in the cloud.
- The Codex CLI is open source and runs on your own computer.
- Cloud tasks run in isolated environments, so several can run at once.
- An
AGENTS.mdfile in the project gives it standing instructions.
Example
cd my-project
codex # start an interactive session in this project
# Or run a single task without a session, e.g. in a script
codex exec "update the README with the new setup steps"Readers ask
Is Codex the same as GitHub Copilot?
No. GitHub Copilot is GitHub's assistant and Codex is OpenAI's agent. The mix-up comes from the original 2021 Codex model, which powered the first version of Copilot.
Is the Codex CLI open source?
Yes. The Codex CLI is open source under the Apache 2.0 license, and its code is published on GitHub.
What is AGENTS.md?
A Markdown file at the root of a repository with instructions for coding agents: how to build and test the project, its conventions and what to avoid. Codex reads it, and other agents such as Claude Code can read it too.
See also
- Claude Code vs CodexClaude Code and OpenAI Codex are both AI coding agents; they differ mainly in the models behind them, where they run and how you set them up and pay for them.
- AI Coding AgentAI & Machine Learning, p. 5An AI coding agent is an AI system that takes a programming task, explores the code, edits files and runs commands in a loop until the task is done.
- Claude CodeAI & Machine Learning, p. 15Claude Code is Anthropic's AI coding agent: it reads your codebase, edits files, runs commands and works with git in a terminal, IDE, desktop app or browser.
- GitHub CopilotAI & Machine Learning, p. 29GitHub Copilot is GitHub's AI coding assistant: it suggests code as you type, answers questions in chat and, as an agent, turns issues into pull requests.
- CursorAI & Machine Learning, p. 20Cursor is an AI code editor built on VS Code, with AI autocomplete, a chat and coding agents that edit across files and can use models from several AI labs.
- LLMAI & Machine Learning, p. 35An LLM is a machine learning model trained on huge amounts of text that generates language by repeatedly predicting the next most likely piece of text.
- Model Context ProtocolAI & Machine Learning, p. 40The Model Context Protocol is an open standard that defines how AI applications connect to external tools, data sources, and prompts through a shared interface.
Free · once a week
Software and AI, explained once a week
The week's software and AI news with every term explained, plus a term to learn and a quick quiz. A two-minute read.
See this week's issueAbout this page
Spotted a mistake or something missing on this page?Suggest an edit
How pages are made