OpenAI Codex

OpenAI Codex is a coding agent by OpenAI that runs as an open source CLI on your machine and as a cloud agent in ChatGPT, editing code, running commands and opening pull requests.

What OpenAI Codex does

OpenAI Codex is one product with two halves. The Codex CLI is an open source agent (Apache-2.0) that runs in your terminal, reads and edits files, and runs commands inside a sandbox. Codex cloud runs tasks in isolated cloud environments from ChatGPT on the web, the desktop app or mobile, and can open pull requests on GitHub. Both use the same account and share usage.

OpenAI Codex also ships as an IDE extension for VS Code, Cursor, Windsurf, JetBrains IDEs and Xcode, and inside the ChatGPT desktop app for macOS and Windows, with Linux in preview. For automation, codex exec runs it from scripts and CI, and there is a Codex SDK and a GitHub Action.

OpenAI Codex can be extended with subagents, hooks (PreToolUse, PostToolUse, SessionStart, Stop and others), skills and MCP servers. Besides ChatGPT sign-in, the CLI accepts an API key, and its --oss flag runs a local open source model through LM Studio or Ollama.

Who OpenAI Codex is for

  • People who already pay for ChatGPT and want a coding agent on the same plan
  • Developers who want to hand off tasks to a cloud agent and review the pull request later
  • Teams that run an agent in CI with codex exec and an API key
  • Developers who want an open source CLI they can read and modify

Who should pick something else

  • Anyone who wants the full CLI on a free plan: OpenAI's pricing page names the CLI and IDE extension from the Plus plan up
  • Teams that need cloud features with an API key only: the API key route has no GitHub code review or Slack
  • Developers who mainly want models from vendors other than OpenAI; OpenCode, Cline or Cursor offer more providers

OpenAI Codex: one strength, one limit

Strength. OpenAI Codex covers both local and cloud work: the same account drives an open source CLI with 127,502 GitHub stars (2026-10-01), IDE extensions for five editor families, and cloud tasks that open pull requests.

Limit. OpenAI Codex usage is capped per five-hour window and per week on Plus and Business, and ChatGPT and Codex share one usage pool, so heavy chat use leaves less for coding.

What OpenAI Codex costs

ChatGPT's Free plan lists Codex in the desktop app for quick tasks; the CLI, IDE extension and cloud features come with paid ChatGPT plans, or with an API key billed per use.

Current prices: learn.chatgpt.com . We do not list prices: vendors change them often, so check the maker's own page before you buy.

OpenAI Codex with agent skills and MCP servers

Skills. Codex supports Agent Skills natively and says they build on the open agent skills standard. It reads repo skills from .agents/skills (in the current folder, its parent and the repo root), user skills from ~/.agents/skills, admin skills from /etc/codex/skills, plus skills bundled with Codex. Skills arrived on 2025-12-19, and custom prompts were deprecated in favour of skills on 2026-01-22. The open skills CLI installs into the same .agents/skills folder.

MCP. Codex adds MCP servers with a command: codex mcp add <name> -- <command> for a local server, for example codex mcp add context7 -- npx -y @upstash/context7-mcp, or codex mcp add <name> --url <url> for a remote one. Servers are stored as [mcp_servers.<name>] tables in ~/.codex/config.toml or a project .codex/config.toml. In the IDE extension, use the gear menu, then MCP servers, then Add server.

Browse agent skills and MCP servers that work with OpenAI Codex.

Questions people ask

Is OpenAI Codex free?

Partly. The Codex CLI is open source under Apache-2.0, and you can run it with your own API key (pay per use) or a local model via --oss. ChatGPT's Free plan lists Codex in the desktop app for quick tasks, subject to rollout; the CLI, IDE extension and cloud features are listed from the paid Plus plan up, read on 2026-10-01.

Does Codex support agent skills and MCP?

Yes. Codex reads Agent Skills from .agents/skills in the repo and ~/.agents/skills for the user, supported since 2025-12-19. MCP servers are added with codex mcp add and stored in ~/.codex/config.toml.

Alternatives to OpenAI Codex

  • Claude Code: Claude Code is a terminal coding agent by Anthropic that reads a codebase, edits files and runs commands, and also works in VS Code, JetBrains, a desktop app and the web.
  • Gemini CLI: Gemini CLI is an open source terminal coding agent by Google that runs Gemini models from the command line, with MCP, agent skills, subagents and hooks, under the Apache-2.0 license.
  • GitHub Copilot: GitHub Copilot is an AI coding assistant by GitHub that works in VS Code, JetBrains and other editors, in a CLI, and as a cloud agent that opens pull requests on GitHub.
  • Cursor: Cursor is an AI code editor by Anysphere that pairs a desktop editor with an agent, a CLI and cloud agents, using models from several vendors plus its own Composer models.
  • Devin: Devin is a cloud coding agent by Cognition that works in its own virtual machines, takes tasks from Slack, GitHub, Linear or Jira, and also ships as a CLI and the Devin Desktop editor.