Getting Started with Codex / Chapter 1 — Getting Started with Codex (lessons 1–4) / Lesson 1

What Codex Is — Where It Runs and What to Delegate

Time needed: about 6 min (estimate)

☆ Read later

You can try the opening of this lesson without an account.

Codex is an agent that writes code

Codex is OpenAI's coding agent. Given an instruction, it reads files in your repository, runs commands, and makes and applies changes, taking many steps on its own. That is what sets it apart from autocomplete, which suggests one line at a time. Because it takes many steps, treat it as a tool where you decide up front what it may do before you hand anything over.

It runs in more than one place

Codex isn't limited to the terminal CLI. You can also reach it from an editor extension, the cloud inside ChatGPT, GitHub pull requests, and your own programs. It's the same agent everywhere; what changes is where it runs and what it can touch. Below is what we confirmed in the official docs (learn.chatgpt.com/docs/) as of November 26, 2026.

Where Codex runs (as of November 2026)

CLI Start codex in a terminal and talk to it. codex exec runs it non-interactively IDE Use it from VS Code, Cursor, Windsurf, JetBrains IDEs, or Xcode Cloud Run tasks from Codex in ChatGPT, in an environment with your repository GitHub Comment @codex review on a pull request to ask for a review SDK/Action Build it into your own tooling with @openai/codex-sdk or openai/codex-action@v1

This course is centered on the CLI. The ideas you learn there (sandboxing, approvals, AGENTS.md, and the config file) carry over to every other surface. The cloud and GitHub come in Chapter 4, and the SDK and Action in Chapter 5.

ChatGPT plans and API keys

Codex is included in ChatGPT plans, and the usual way to use it is to sign in with your ChatGPT account. The top of the pricing page (learn.chatgpt.com/docs/pricing, as of November 26, 2026) lists Free, Go, Plus, Pro, Business, Edu, and Enterprise, but which surfaces each plan gets and how much you can use them differ by plan and change often. Check your own plan on the pricing page before you start. You can also sign in with an API key; usage is then billed at API rates and does not count against your plan.

Work to delegate, work to keep

The easiest work to delegate has a clear scope and results you can check with tests or a diff: fixing a failing test, or adding type hints to a function. On the other hand, anything that touches production data or money stays with you. A task like "make everything nicer" has neither a scope nor a check, so there's still deciding to do before you hand it off. The code below turns that line into a simple rule.

editor.py

Tab indents. To leave the editor, press Esc, then Tab.

Create a free account to keep reading

With an account you can read the rest of this lesson, take the quiz, and read every free lesson in this course. Lessons you answer correctly are recorded as complete.

Report a problem with this lesson

Log in to send a report.

Keyboard shortcuts

Keys available in a lesson
KeyAction
[ or Alt + ←Go to the previous lesson
] or Alt + →Go to the next lesson
?Open this list
EscClose this list

The keys do not work while the cursor is in a code editor or an input field.