How to Use OpenAI Codex for AI Coding

September 16, 2026

OpenAI Codex is an AI coding agent from OpenAI that runs in three places: a cloud dashboard, a terminal CLI, and an IDE extension. It reads your repository, writes patches, runs tests, and opens pull requests without you copying diffs by hand.

If you have a ChatGPT Plus, Pro, or Team subscription, you already pay for it. The catch is that the three surfaces feel different, and picking the wrong one wastes time.

What Is OpenAI Codex and Who Is It For?

Yes, OpenAI Codex can write and ship code on its own, but only inside a sandbox it controls. You point it at a GitHub repo, describe the task, and it works in an isolated container with your code preloaded.

It suits developers who already live in GitHub pull requests. It is a poor fit if you cannot give an agent repository access, or if you want a chat window that pastes snippets back to you.

How Do You Install and Open the Codex CLI?

The terminal version installs with npm:

  • Run npm i -g @openai/codex
  • Authenticate with your ChatGPT account or an API key
  • Change into a repository folder and run codex
  • Describe a task in plain English, then review the proposed diff

Inside the CLI you get file edits and shell commands in the same session. Codex asks before running anything destructive, and you can approve or reject individual steps.

What Can You Do in the Cloud Dashboard?

The web surface is built for parallel work. Queue several jobs at once and each one runs in its own container, so a refactor and a bug fix never block each other.

When a job finishes, the output arrives as a GitHub pull request. You review it like any teammate’s branch, request changes, and merge. Nothing lands on your main branch unannounced.

Is OpenAI Codex Free?

No standalone price exists. Access is bundled with ChatGPT Plus at $20 per month and Pro at $200 per month, and Team seats also include it. Heavy cloud usage can hit plan limits before your month ends, which is the main complaint in practice.

Where Does Codex Struggle?

Three honest limits. First, cloud tasks queue behind your plan quota, so long agent runs fail at the boundary rather than finishing. Second, the IDE extension is less capable than the CLI for multi-step work. Third, ambiguous prompts produce confident but wrong patches, so you still read the diff.

Quick Summary

  • OpenAI Codex is OpenAI’s coding agent across cloud, CLI, and IDE surfaces.
  • Install the CLI with npm i -g @openai/codex.
  • Cloud tasks return GitHub pull requests, not raw diffs.
  • No separate price: it comes with ChatGPT Plus ($20/mo) or Pro ($200/mo).
  • Best for GitHub-centric teams; weaker if you cannot grant repo access.

If you are comparing agents, it is worth knowing how it differs from a terminal-first tool before you commit your workflow to one.