# OpenAI Codex

URL: https://softwaredictionary.org/terms/openai-codex
Category: AI & Machine Learning
Last updated: 2026-10-18

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.md` file in the project gives it standing instructions.

## Example: Giving Codex a task from the terminal

```bash
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"
```

## Frequently asked questions

**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.

## Sources

- [OpenAI: Codex documentation](https://developers.openai.com/codex)
- [openai/codex: Codex CLI (GitHub)](https://github.com/openai/codex)

---

Software Dictionary: https://softwaredictionary.org/ · https://softwaredictionary.org/llms.txt
