To use ChatGPT Codex, open Codex from the ChatGPT sidebar or desktop app, connect a GitHub repository, and give it a task with the Code button (or ask it a question about your codebase with Ask) — it works in an isolated cloud sandbox and hands you back a diff or a pull request. Developers who live in a terminal can skip the browser entirely and run the same agent through the Codex CLI.
Short answer: Sign in to Codex at chatgpt.com with a Plus, Pro, Go, or Business plan, connect GitHub, pick a repo, and click Code with a task description. Codex edits files, runs tests, and proposes a PR in its own cloud sandbox. Prefer the terminal? Install the CLI with
npm install -g @openai/codexand runcodexinside your project.

I've run Codex both ways — the cloud version through the ChatGPT sidebar and the CLI in a local repo — for real feature and bug-fix tasks, not just a demo prompt. Here's what actually happens at each step, what the plans cost, and the mistakes that waste your first few tasks.
What you'll need
A ChatGPT account is the only hard requirement, but which plan you're on decides how much of Codex you can use. Free gives you limited access; Plus ($20/month) is the first tier with full Codex on the web, in the CLI, in the IDE extension, and on iOS, according to OpenAI’s Codex pricing page. For cloud tasks, you'll also need a GitHub account with the repository you want Codex to work on — Codex asks for permission to access specific repos, not your whole account. For the terminal route, you need Node.js if you're installing via npm, though a curl script and Homebrew are also options and skip that requirement. Nothing here needs a credit card if you're just trying the free tier first.
Step-by-step: how to use ChatGPT Codex
1. Choose how you want to run it
Codex isn't one single app — it's the same agent available in four places: the ChatGPT web sidebar, the desktop app, the Codex CLI in your terminal, and an IDE extension. Cloud tasks (web/desktop) are best for longer jobs you want to run in the background; the CLI is better when you want Codex working directly in a repo already open on your machine. You can mix both — I use the CLI for quick local fixes and the cloud sidebar for tasks I want to check on later.
2. Sign in
For the cloud version, go to chatgpt.com, open Codex from the sidebar or the app dropdown, and sign in with your ChatGPT account. For the CLI, install it first — curl -fsSL https://chatgpt.com/codex/install.sh | sh on Mac or Linux, npm install -g @openai/codex, or brew install --cask codex — then run codex in a project folder and choose Sign in with ChatGPT when prompted, per the Codex CLI’s own repo.
3. Connect GitHub and pick a repo
In the cloud interface, connect your GitHub account when prompted and select which repositories Codex is allowed to touch. This step is what lets Codex read your actual code instead of guessing at a generic answer.
4. Set up an environment
Open environment settings and create one for your repo — this is where you tell Codex about dependencies, environment variables, and any secrets a task needs to actually run your build or test suite. Skipping this is the single most common reason a cloud task fails halfway through.
5. Give it a task
Type what you want in plain language and click Code for something you want built or fixed, or Ask if you just want Codex to explain part of the codebase without changing anything. In my testing, tasks with a clear finish line — "add input validation to the signup form and add a test for it" — came back far cleaner than open-ended ones like "improve the signup form."
6. Review the diff, then merge or ask for changes
Codex runs in its own sandbox, so nothing touches your real branch until you say so. When it finishes, you get a summary and a code diff to review; if it's right, open a pull request straight from there. If it's close but not quite right, reply with what to fix instead of starting a new task from scratch — that follow-up message is usually faster than a full rewrite.
Example prompts you can copy
Specific prompts beat vague ones by a wide margin in my testing. A few that work well as a starting point:
- "Fix the failing test in
tests/auth.spec.tsand explain what was wrong in one sentence." - "Add a
/healthendpoint to this API that returns a 200 with the current build version." - "Review this pull request diff for bugs and security issues before I merge it."
- "Refactor
utils/format.pyto remove duplicate code, but don't change any function signatures." - "Explain how the caching layer in this repo works, step by step, without changing anything."
Notice the pattern: each one names a file or scope, states the deliverable, and sets a boundary. That last part — telling Codex what not to touch — cuts down on surprise changes more than almost anything else.
Common mistakes to avoid
The mistake I see most is skipping the environment setup and being surprised when a task fails on a missing dependency it was never told about. Second, handing Codex a vague goal like "make this better" instead of a scoped one — it will make a change, just not necessarily the one you wanted. Third, merging a PR without reading the diff; Codex is good, not infallible, and a plausible-looking change can still break an edge case your tests don't cover. Fourth, running heavy tasks on the Free or Go tier and then being confused about rate limits — Plus and up carry meaningfully more headroom, and Pro's 5x or 20x multipliers exist for a reason. And fifth, treating the CLI and the cloud version as competitors instead of a pair — I use the CLI for anything I want to watch happen live, and cloud tasks for the ones I'm happy to check on in twenty minutes instead of two.
Codex plans and what each one unlocks
| Plan | Price | What you get with Codex |
|---|---|---|
| Free | $0/mo | Limited Codex access for quick tasks |
| Go | $8/mo | Lightweight Codex usage, lower limits |
| Plus | $20/mo | Full Codex — web, CLI, IDE extension, iOS; cloud PR review |
| Pro | $100–$200/mo | Everything in Plus at 5x–20x the rate limits |
| Business | $20–$25/user/mo | Team access, SSO/MFA, no training on your data by default |
Prices and limits move often in this category — I confirmed these directly on OpenAI’s Codex pricing page on July 24, 2026. Plus is the plan most individual developers land on; Pro only makes sense once you're running enough parallel or long-running tasks to actually hit Plus's ceiling.
Tools that make this easier
Codex is one strong option in a crowded field, not the only one worth having open. If you want to see how it stacks up against editor-native tools like Cursor and Claude Code on the same tasks, my tested best AI tool for code roundup covers all three with real prices and notes. For a broader survey of coding assistants beyond OpenAI's own stack, ChatGPT alternatives for coding is worth a look before you commit to one workflow. If your main use case for ChatGPT is more general — research, drafting, quick questions — rather than shipping code, how to use ChatGPT for free covers what the no-cost tier actually includes. For multi-step browsing and research tasks that aren't code at all, see how to use ChatGPT agents, which is a close cousin of Codex built for a different job. And if you're comparing OpenAI's whole ecosystem against the competition, how to use Claude AI and how to use Gemini AI cover the two most common alternatives people ask about.
My take
Codex earns its keep once you give it scoped, well-bounded tasks and actually read the diff before merging — treat it like a fast, slightly literal junior engineer rather than an autopilot. The CLI is the better entry point if you already live in a terminal, since there's no context-switching to a browser tab; the cloud version wins when you want a task running while you do something else entirely. Plus at $20/month is enough for most individual developers to find out whether Codex fits their workflow before spending more.
Frequently Asked Questions
Is ChatGPT Codex free to use?
There's limited Codex access on the Free plan, but full access — web, CLI, IDE extension, and iOS, plus cloud PR review — starts on the $20/month Plus plan, per OpenAI's pricing page. The Go plan at $8/month sits between the two with lighter usage limits.
How long does it take to learn how to use ChatGPT Codex?
Getting your first task running takes about ten minutes: sign in, connect GitHub, set up one environment, and click Code. Getting good at scoping tasks so Codex nails them on the first try takes longer — plan on a week or two of writing specific, bounded prompts before it feels reliable.
What is the easiest way to use Codex well?
Give it one task with a clear finish line and a stated boundary — a file or folder to touch, and one thing not to change — instead of an open-ended goal. Review the diff before merging, and reply with corrections instead of starting over when a result is close but not exact.
Do I need to know how to code to use Codex?
You need to be able to read a diff and judge whether it's correct — Codex writes the code, but it doesn't replace understanding what your codebase is supposed to do. It's built for developers, not as a no-code tool for non-programmers.
Is Codex CLI different from Codex in ChatGPT's sidebar?
They're the same underlying agent, just two interfaces. The CLI runs locally in your terminal against a repo you already have open; the cloud version in the ChatGPT sidebar runs tasks in a remote sandbox you can leave running and check on later.