Checked against OpenAI's own docs, September 2026
Codex CLI: Install, Pricing, Commands and Usage Limits for the OpenAI Codex CLI
Codex CLI comes with a ChatGPT plan, so the real question is how much terminal work each plan actually allows. The answer is a rolling five-hour message window, and ChatGPT Business gets exactly the same window as a $20 personal Plus seat.
No card to start · Flat $29/mo billed yearly, no five-hour window to wait out
Pick a task
Plan
- planning
Files changed
Test run
Pull request
You review and merge. Agentcode never merges on its own.
The short answer
Codex CLI is OpenAI's terminal coding agent, and it is included with a ChatGPT plan rather than sold separately. Install it with npm install -g @openai/codex, brew install --cask codex, or the one-line script at chatgpt.com/codex/install.sh, then run codex in a project directory and sign in. What your plan buys is a rolling five-hour message window, not a monthly balance: Plus at $20 gives roughly 10 to 100 GPT-5.6 Sol messages per window, Pro 5x at $100 gives 50 to 500, Pro 20x at $200 gives 200 to 2,000, and ChatGPT Business gives exactly the same numbers as Plus. Credits only start to matter once that window is spent.
How to install Codex CLI
Four install routes, all official, all copied from OpenAI's own documentation. Pick the one that matches how the rest of your tooling is managed rather than the one printed first. One detail catches almost everybody: on the two script routes, the update command is the identical command you installed with. There is no separate upgrade flag to hunt for.
Swipe to see more
| Route | Command | What to know |
|---|---|---|
| Install script (macOS, Linux) | curl -fsSL https://chatgpt.com/codex/install.sh | sh | The route OpenAI lists first. It drops a standalone binary, so you do not need Node.js on the machine at all. The same command is also the update command, which is worth knowing before you go looking for a separate upgrade flag. |
| Install script (Windows) | powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex" | Native Windows, no WSL required. As with the macOS script, re-running the identical command is how you update. Read any script before you pipe it into a shell on a work machine. |
| npm (any platform) | npm install -g @openai/codex | The route most teams already have muscle memory for. Update with the same command. Pick this one if your developer tooling is already pinned and audited through package.json and you want Codex to live in the same place. |
| Homebrew (macOS, Linux) | brew install --cask codex | A cask, not a formula, so brew upgrade --cask codex is the update. Easiest route if Homebrew already manages the rest of your developer tools and you would rather not carry a global npm package. |
| Sign in | codex login | Opens a browser flow. This is the default path when no valid session exists. Run codex login status in a script: OpenAI documents that it exits with 0 when credentials are present, which is the clean way to gate a CI step. |
| Check it works | codex doctor | Run it before you file a bug. Then start the agent by running codex from inside a project directory, and use /status at any point to see how much of your usage window is left. |
Once it is installed, open a project directory and run codex. The first launch asks you to sign in with ChatGPT or another available method, and after that the agent can read your files, make edits and run the tools already on your machine. OpenAI's own advice is worth repeating: create a Git checkpoint before and after a task so you can revert cleanly, because an agent with write access to a workspace is exactly as fast at making a mess as it is at making progress.
Codex CLI pricing: which ChatGPT plan do you need?
None in particular, which is the part most articles skip. There is no Codex CLI price, no CLI tier and no add-on. The CLI ships with the ChatGPT plan you already pay for, from Free upward. What a bigger plan buys is a bigger message window, and on one of these tiers it buys you no extra window at all.
Swipe to see more
| Plan | Price | Published Codex limits | CLI included | What it means for terminal work |
|---|---|---|---|---|
| Free | $0 / month | Not published per model | Yes | OpenAI positions Free as "quick coding tasks" and does not list it in the local-messages table at all, so there is no published figure for how many terminal messages you get. Image generation is not available on Free. Useful for a look, useless for a budget. |
| Go | $8 / month | Not published per model | Yes | Described as "lightweight coding tasks". Like Free, Go has no column in OpenAI's per-five-hour table, so we are not going to invent a number for it. If a published limit is what you need to plan against, Plus is the first tier that has one. |
| Plus | $20 / month | 10 to 100 Sol, 25 to 200 Terra, 250 to 2,000 Luna per 5 hours | Yes | The first tier with published numbers, and the reference point for everything above it. Includes Codex on the web, in the CLI, in the IDE extension and on iOS, plus cloud features like automatic code review and the Slack integration. |
| Pro 5x | $100 / month | 50 to 500 Sol, 125 to 1,000 Terra, 1,250 to 10,000 Luna per 5 hours | Yes | Five times the price of Plus for five times the messages, so the cost per message is identical. You are buying a higher ceiling, not a discount. Also the only tier with GPT-5.3-Codex-Spark, a research preview governed by its own separate limit. |
| Pro 20x | $200 / month | 200 to 2,000 Sol, 500 to 4,000 Terra, 5,000 to 40,000 Luna per 5 hours | Yes | Ten times the price of Plus for twenty times the messages. This is the only Codex tier where the price per message actually falls, and it falls by half. If you are genuinely rate limited every day, this is the tier that changes the math. |
| Business | $20 / user / month annual, $25 monthly | Identical to Plus, row for row | Yes | Read that limits column twice. Business buys SAML SSO, MFA, admin controls, no training on your business data by default and larger cloud VMs. It does not buy a single extra terminal message over a personal Plus seat. |
| Enterprise and Edu | Contact sales | No fixed rate limits with flexible pricing | Yes | The one structural upgrade. With flexible pricing OpenAI states there are no fixed rate limits and usage scales with credits instead. Without flexible pricing, Enterprise and Edu carry "the same per-seat usage limits as Plus for most features". |
| API key | Standard API rates | Usage based, no included allowance | Yes, with a catch | Sign in with a key and you get Codex in the CLI, SDK and IDE extension but, in OpenAI's words, "No cloud-based features (GitHub code review, Slack, etc.)". Model availability follows what your key can reach. This is the route for CI and shared environments. |
The Pro row is worth a second read, because it is sold as one plan and priced as two. At $100 the 5x tier costs five times what Plus costs and delivers five times the messages, so the price per message has not moved a cent. At $200 the 20x tier costs ten times Plus and delivers twenty times the messages, which halves it. If you are being rate limited on Plus and you buy Pro 5x expecting better value, you have bought the same value in a bigger bucket. The full plan-by-plan breakdown of what else is in those tiers sits on our Claude Code pricing comparison and in what the Codex VS Code extension costs.
Codex CLI usage limits, per model and per plan
This is OpenAI's own published table of local messages per five-hour window, reproduced with the model guidance next to each row. Read the Plus column against the Business column before you do anything else on this page.
Swipe to see more
| Model | Plus ($20) | Pro 5x ($100) | Pro 20x ($200) | Business ($20 to $25) | What the model is for |
|---|---|---|---|---|---|
| GPT-5.6 Sol | 10 to 100 | 50 to 500 | 200 to 2,000 | 10 to 100 | The hardest work: complex reasoning, ambiguous problems, advanced coding. Also the model cloud chats run on, which is why a cloud task eats your local window faster than a local one. |
| GPT-5.6 Terra | 25 to 200 | 125 to 1,000 | 500 to 4,000 | 25 to 200 | OpenAI calls Terra the everyday workhorse for production tasks and coding that needs judgment. For most teams this is the default that should be in AGENTS.md. |
| GPT-5.6 Luna | 250 to 2,000 | 1,250 to 10,000 | 5,000 to 40,000 | 250 to 2,000 | Fast, high volume work: routing, classification, extraction, focused coding. Twenty five times the Sol allowance on the same plan, which makes it the single biggest lever you have. |
| GPT-5.5 | 15 to 80 | 75 to 400 | 300 to 1,600 | 15 to 80 | The previous frontier generation. Tighter allowance than Sol on every plan, so there is rarely a reason to pick it over Sol for hard work. |
| GPT-5.4 | 20 to 100 | 100 to 500 | 400 to 2,000 | 20 to 100 | Roughly Sol-level allowance a generation back. Worth keeping in mind if a workflow was tuned against it and you do not want to re-tune. |
| GPT-5.4 mini | 60 to 350 | 300 to 1,750 | 1,200 to 7,000 | 60 to 350 | The cheap option in the previous generation. Luna beats it on allowance on every plan, so on a current install this row is mostly historical. |
Two things fall out of that table that will save a US engineering team real money. The first is that the Business column is identical to the Plus column in every single row. Moving a developer from a personal Plus seat at $20 to a Business seat at $20 annually or $25 monthly buys SAML SSO, MFA, admin controls, larger cloud virtual machines and the default that OpenAI does not train on your business data. It buys zero extra terminal capacity. That is a perfectly good reason to buy Business, but it is a governance purchase, not a throughput purchase, and it should be budgeted as one.
The second is that the model you pick matters roughly twenty five times more than the plan you buy. On the same $20 Plus seat, GPT-5.6 Sol gives you 10 to 100 messages per window and GPT-5.6 Luna gives you 250 to 2,000. Switching routine work to Luna with /model costs nothing and multiplies your allowance by more than upgrading from Plus to Pro 20x does, for $180 a month less. Save Sol for the work that genuinely needs it.
One caution on that window. Local CLI messages and cloud chats share it, and cloud chats run on Sol, the most expensive model in the family. So a task you dispatched to Codex cloud in the morning can be the reason your terminal stops answering in the afternoon. OpenAI also notes that additional weekly limits may apply on top of the five-hour one, which is the ceiling that tends to find teams in the last two days of a sprint.
What one Codex CLI session costs in credits
Once the five-hour window is spent, credits take over, and OpenAI publishes a rate card in credits per million tokens. Multiply the rates by a session and you get a comparable number. We assume one session is 300,000 input tokens and 30,000 output tokens, which is a realistic multi-turn agent run where the whole conversation is resent with every tool result. That token assumption is ours, not OpenAI's, and it is deliberately the same assumption we use on our GitHub Copilot CLI page so the two tables can be read side by side. The rates are OpenAI's.
Swipe to see more
| Model | Credits per 1M in / cached / out | Credits per session | Relative cost |
|---|---|---|---|
| GPT-5.6 Luna | 5 / 0.5 / 30 | 2.4 | 1x (the floor) |
| GPT-5.4 mini | 18.75 / 1.875 / 113 | 9.0 | 3.8x Luna |
| GPT-5.6 Terra | 50 / 5 / 300 | 24 | 10x Luna |
| GPT-5.4 | 62.50 / 6.250 / 375 | 30 | 12.5x Luna |
| GPT-5.6 Sol | 100 / 10 / 500 | 45 | 18.8x Luna |
| Daybreak Blue | 100 / 10 / 500 | 45 | 18.8x Luna |
| GPT-5.5 | 125 / 12.50 / 750 | 60 | 25x Luna |
| Daybreak Red | 312.5 / 31.25 / 1875 | 150 | 62.5x Luna |
Sanity check that against OpenAI's own note, which says GPT-5.6 usage averages 5 to 30 credits per message. Our figures are higher because we are pricing a whole multi-turn session rather than a single message, and because we deliberately ignore cached input, which is billed at a tenth of the input rate. A session with heavy cache reuse will land meaningfully below the number in that table. Treat these as an upper bound for a session of that size, not a forecast.
And here is the honest limit of this table. OpenAI publishes the rate card in credits and does not publish a dollar-per-credit price on the Codex pricing page, unlike GitHub, which states plainly that one AI credit is one cent. We are not going to invent an exchange rate to make a tidier number. Read the credit price from your own billing settings before converting anything here into dollars. Two other things move the rate: fast mode and other speed configurations consume credits faster on supported models, and image generation uses your limits roughly 3 to 5 times faster than a comparable turn without it.
Codex CLI commands worth knowing before you buy
Most command references list everything. This one lists the fifteen that change either what the tool can do or what it costs you. Three of them, /model, /status and /compact, are direct cost controls.
Swipe to see more
| Command | What it does | Why it matters |
|---|---|---|
| codex | Start the interactive terminal agent in the current directory. | The whole product in one word. Prefix any line with ! to run a shell command under the current approval and sandbox settings, and press Tab while it works to queue a follow-up for the next turn. |
| codex exec "task" | Run non-interactively for scripts and CI. Short form: codex e. | Progress streams to stderr, only the final message goes to stdout, so piping just works. Add --ephemeral when you do not want session rollout files written to disk. |
| codex exec --json | Emit newline-delimited JSON events instead of prose. | Event types include thread.started, turn.started, turn.completed, turn.failed, item.* and error. OpenAI recommends pairing --json with --output-last-message so CI gets both a machine-readable stream and a human summary. |
| --sandbox workspace-write | Let the agent edit files inside the workspace. | codex exec defaults to a read-only sandbox, so without this flag a scripted run proposes and never applies. The deprecated --full-auto still works and prints a warning; use the explicit flag in new scripts. |
| --sandbox danger-full-access | Remove the sandbox entirely. | OpenAI says to use it only in a controlled environment such as an isolated CI runner or container. If you only need one more directory, use --add-dir instead, which is the safer and documented preference. |
| /permissions | Change what Codex may do without asking, mid-session. | This is the answer to "Codex CLI keeps asking for permission". Switch between Read Only and Auto from inside the session rather than restarting with different flags. |
| /model | Switch the active model and reasoning effort. | The single most useful command on this page. Moving routine work from Sol to Luna multiplies your five-hour allowance by roughly twenty five times on the same plan. |
| /status | Show remaining usage limits during a live session. | OpenAI documents this as the way to see your remaining limits without leaving the CLI. The fuller picture lives in the usage dashboard, which OpenAI suggests checking every week or two. |
| /compact | Summarize the visible chat to free tokens. | Long agent sessions resend the whole conversation, so compacting is a direct cost control rather than a tidiness feature. /clear goes further and starts a fresh chat. |
| /init | Generate an AGENTS.md scaffold in the current directory. | AGENTS.md is injected into your context, so OpenAI explicitly lists shrinking it and nesting it inside subdirectories as a way to make usage limits last longer. |
| /mcp | List the configured Model Context Protocol tools. | Every MCP server adds context to every message and therefore spends more of your limit. OpenAI advises disabling the ones you do not need, which is real money on a rate-limited plan. |
| codex resume / codex fork | Continue a past session, or branch a new one from it. | resume --last is scoped to the current working directory unless you add --all. fork opens the session picker by default. Both accept the same model and sandbox overrides as codex itself. |
| codex review | Run a code review from the terminal. | Worth knowing which meter it hits: OpenAI counts Code Review usage separately only when reviews run through GitHub. Reviews run locally count against your general usage limits. |
| codex cloud exec | Submit a task to Codex cloud from the terminal. | Cloud chats run on GPT-5.6 Sol and share the same five-hour window as your local messages, so a cloud task can eat a local allowance you were saving. |
| /import | Import a Claude Code or Cursor setup, projects and chats. | The migration path most teams do not know exists. If you are evaluating Codex CLI against a tool you already configured, this removes most of the setup cost of the trial. |
The safety guidance is OpenAI's, not ours, and it is sensible. Use --sandbox workspace-write for unattended local work that can stay inside the workspace, prefer --add-dir over dropping to full access when the agent needs one more directory, and avoid --dangerously-bypass-approvals-and-sandbox unless you are inside a dedicated sandbox virtual machine. On a shared CI runner, that last flag is how a coding agent becomes a security incident.
Codex CLI vs Claude Code vs Copilot CLI vs Cursor CLI
These four are the terminal agents a US engineering team actually shortlists in September 2026. Every figure below comes from that vendor's own documentation, including the ones that make Codex look worse. We sell a competing product, so read the last row knowing that.
Swipe to see more
| Codex CLI | Claude Code | GitHub Copilot CLI | Cursor CLI | |
|---|---|---|---|---|
| What you pay | Included with a ChatGPT plan: Free $0, Go $8, Plus $20, Pro $100 at 5x or $200 at 20x, Business $20 per user billed annually or $25 monthly, Enterprise on quote. | Included with a Claude plan, or metered per token through the API and through Amazon Bedrock, Google Cloud and Microsoft Foundry. | Nothing extra. GitHub states all plans include Copilot CLI, so it rides on a Copilot seat from Free at $0 up to Max at $100. | Included with a Cursor plan: Pro $20, Pro Plus $60, Ultra $200, Teams Standard $40 per user, Premium $120 per user. |
| How usage is metered | A rolling five-hour message window first, shared between local CLI messages and cloud chats, with credits only mattering after that window is spent. | A per-seat allowance on a rolling five-hour window and a weekly window, shared with Claude chat. Anthropic writes that the seat allowance is the default ceiling. | A monthly balance of GitHub AI credits at 1 credit = $0.01, charged on tokens processed and priced per model. Pro carries 1,500 a month, Business 1,900 a seat. | Two separate usage pools that reset with the billing cycle, one for Cursor's own models and one for third-party models, shared across the editor, the Agents window and the CLI. |
| The number you can budget against | Messages per five hours, published per model and per plan. Precise as a ceiling, useless as a monthly forecast, because OpenAI publishes no dollar-per-credit rate on the pricing page. | Anthropic publishes real dollars: around $13 per developer per active day and $150 to $250 per developer per month, staying under $30 per active day for 90% of users. | Dollars, because a credit is a cent. Overage is $0.01 per credit, the same rate as the included credits, so the bill is arithmetic rather than a guess. | A monthly included usage figure per pool, plus a Cursor Token Rate of $0.25 per million tokens on third-party models on Teams and Enterprise. |
| Bring your own key | Yes, and it changes the product. An API-key sign-in drops the cloud features, including GitHub code review and Slack, and bills at standard API rates with no included allowance. | Yes, through an API key, Bedrock, Google Cloud or Microsoft Foundry, billed to that account rather than to a seat. | Yes, against Ollama, OpenAI, Azure OpenAI or Anthropic through four environment variables. Business and Enterprise admins can disable local BYOK by policy. | Yes. Set CURSOR_API_KEY for scripts and CI, or use agent --api-key. Browser login with agent login is the recommended path for a person. |
| Where the cost surprise hides | The five-hour window, and the fact that cloud chats drain it too. You can be productive all morning and locked out at two in the afternoon on a plan that was fine yesterday. | Long sessions. Anthropic warns the full conversation is resent on every request, so a one-line question in a thread left open all day still draws usage for the whole thread. | The model dropdown. Same plan, same work, up to a 47 times difference in what one session costs, and unused credits are forfeited at the start of each month. | The two-pool split. Work you thought was covered can land in the Other Models pool and exhaust it while the Cursor Models pool sits mostly untouched. |
| Best for | Developers and teams already paying for ChatGPT who work in bursts and would rather hit a window that resets than watch a balance drain. | Teams that want the strongest long-running agent sessions and can absorb a genuinely variable per-developer bill. | Teams already on GitHub who want a terminal agent without a second vendor, a second invoice or a second security review. | Teams standardized on the Cursor editor who want the same agent and the same account available from a script. |
The honest summary: Codex CLI is the most predictable of the four if you work in bursts, because a window that resets on a clock is easier to live with than a balance that drains. Copilot CLI is the easiest to budget in dollars, because a credit is a cent. Claude Code is the most capable in long sessions and the most expensive in published terms. Cursor CLI mostly makes sense if your team already standardized on the Cursor editor. If you want the first pair taken apart properly, we do it on Codex vs Claude Code, the Copilot side on Codex against GitHub Copilot, and the editor comparison on Codex vs Cursor.
One migration detail that makes an evaluation much cheaper than it looks: Codex CLI ships a /import slash command that pulls in an existing Claude Code or Cursor setup, including projects and chats. If you have already spent a week configuring a rival, you do not have to spend a second week to try this one. Our cost per session comparison across the three terminal agents is the companion piece to this table. If you are weighing a cloud agent rather than a terminal one, the closest comparison is Codex against Google Jules on price, where the two products meter completely different things.
The fine print Codex CLI buyers find out later
All twelve of these are in OpenAI's own documentation. Most of them are in none of the comparison articles, and at least three will change which plan you sign.
- ChatGPT Business gets exactly the same Codex usage limits as ChatGPT Plus. Every row of OpenAI's published local-messages table is identical across the two columns. Business buys SSO, admin controls, a no-training-by-default data posture and bigger cloud VMs. It does not buy more terminal capacity.
- Local messages and cloud chats share one five-hour window. Sending a task to Codex cloud spends the same allowance you were saving for the CLI, and cloud chats run on GPT-5.6 Sol, the most expensive model in the family.
- OpenAI also warns that "Additional weekly limits may apply" on top of the five-hour window. Plan around both, because a weekly ceiling is the one that catches teams in the last two days of a sprint.
- Free and Go have no published per-model message figures at all. They are simply absent from OpenAI's limits table. If a documented number is what your budget needs, Plus at $20 is the first tier that has one.
- Pro is two tiers, not one. At $100 the 5x tier costs five times Plus for five times the messages, so the price per message does not move. At $200 the 20x tier costs ten times Plus for twenty times the messages, which halves it. Only the top tier is actually cheaper per unit of work.
- Signing in with an API key removes the cloud features. OpenAI states an API-key sign-in gets you Codex in the CLI, SDK and IDE extension but no GitHub code review, no Slack, and model availability limited to what the key can reach.
- Image generation burns your limits roughly 3 to 5 times faster than a comparable turn without it, and is not available on Free at all. Fast mode and other speed configurations also consume credits at a higher rate.
- GPT-5.3-Codex-Spark is Pro only, a research preview, and governed by a separate usage limit that OpenAI says may adjust based on demand. Do not build a team workflow on it.
- Every MCP server you connect adds context to every message and therefore spends more of your allowance. OpenAI lists disabling unused MCP servers and shrinking AGENTS.md as two of its own official ways to make limits last longer.
- Plus and Pro users who hit the limit can buy additional credits instead of upgrading the plan. Business, Edu and Enterprise workspaces on flexible pricing can buy workspace credits the same way, and with flexible pricing there are no fixed rate limits at all.
- GPT-5.6 Sol is on promotional pricing that OpenAI says runs "at least through November 21, 2026". If your budget assumes today's Sol rate, note the date and re-check it before that quarter closes.
- OpenAI publishes the credit rate card in credits per million tokens but does not publish a dollar-per-credit price on the Codex pricing page. We are not going to guess one. Read the credit price from your own billing settings before you convert any of the numbers on this page into dollars.
Which plan should you actually buy for terminal work?
Solo developer, a few sessions a week
ChatGPT Plus at $20. It is the cheapest tier with published limits, and 25 to 200 Terra messages per five-hour window covers a normal working day comfortably. Set Terra or Luna as your default with /model and you will rarely see the ceiling at all.
You are hitting the limit every day
Skip Pro 5x and go to Pro 20x at $200, or fix the model first. Pro 5x is the same price per message as Plus in a bigger bucket. Before spending either, try moving routine work to Luna, which carries roughly twenty five times the Sol allowance on the identical plan.
Team of 5 to 50
Buy Business at $20 per user annually for the governance, not for the throughput, because the throughput is identical to Plus. What you are actually paying for is SAML SSO, MFA, admin controls and the default that OpenAI does not train on your business data. Budget the capacity as if every seat were a Plus seat.
You need a real capacity ceiling raised
Enterprise or Edu with flexible pricing is the only structural answer. OpenAI states that with flexible pricing there are no fixed rate limits and usage scales with credits instead. Without flexible pricing, Enterprise carries the same per-seat limits as Plus for most features, so ask about it by name.
CI, shared runners and automation
Sign in with an API key and script codex exec --sandbox workspace-write --json. Know the trade before you commit: an API-key sign-in drops the cloud features and bills at standard API rates with no included allowance. Gate the step on codex login status, which exits 0 when credentials exist.
You want finished pull requests, not a terminal session
A CLI agent is a good pair of hands that still needs you sitting in front of it. If what you want is to hand off a task and read a pull request afterwards, that is a different product shape, and it is the one we build.
Where we fit, and where Codex CLI beats us
Take the losses first. Codex CLI installs in one line, rides on a ChatGPT subscription most developers already have, runs against your local repository with your own tools, and has a genuinely good command surface. Nothing we sell replaces having a capable agent inside the terminal you are already typing in. If your team wants one vendor and one invoice, buy a ChatGPT plan and stop reading here.
What we do differently is where the work lands. A CLI agent needs you sitting in front of it, watching output, approving steps and re-steering when it drifts, and it spends your allowance for every minute of that attention. Agentcode takes a task against a connected GitHub or GitLab repository, plans it, edits the code, runs your test suite and opens a pull request for a human to read. It never merges on its own, so your branch protection rules and your reviewers stay exactly as they are.
It also costs $29 a month, flat, billed yearly. No five-hour window to wait out, no credit rate card, no cloud task quietly draining the allowance you were saving for the afternoon. That is a narrower product than Codex and we are happy to say so. If you are still building a shortlist, the AI coding tools worth shortlisting and every AI coding tool priced side by side cover the field honestly, including where we lose.
Codex CLI: the questions people actually search
Is Codex CLI free?
Codex CLI itself costs nothing to install and works on the ChatGPT Free plan, so in that narrow sense yes. It is not unlimited, and OpenAI does not publish any per-model message figure for Free or for Go, so you cannot plan against it. Plus at $20 a month is the first tier with documented limits: roughly 25 to 200 GPT-5.6 Terra messages per five-hour window.
How much does Codex CLI cost?
The CLI is included with whatever ChatGPT plan you already have. Free is $0, Go $8, Plus $20, Pro $100 for 5x limits or $200 for 20x, and Business $20 per user per month billed annually or $25 monthly. There is no separate Codex CLI price and no add-on. What differs between tiers is how many messages you get per five-hour window.
How to install Codex CLI
Run curl -fsSL https://chatgpt.com/codex/install.sh | sh on macOS or Linux, or powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex" on Windows. You can also use npm install -g @openai/codex or brew install --cask codex. Then open a project directory, run codex, and choose Sign in with ChatGPT when prompted.
What are the Codex CLI usage limits?
Limits are messages per rolling five-hour window, published per model. On Plus you get 10 to 100 GPT-5.6 Sol messages, 25 to 200 Terra and 250 to 2,000 Luna. Pro 5x multiplies those by five, Pro 20x by twenty, and Business matches Plus exactly. Local CLI messages and cloud chats draw on the same window, and OpenAI notes additional weekly limits may apply.
How do I check my usage in Codex CLI?
Type /status inside a running session and Codex prints your remaining limits without leaving the terminal. For the fuller picture, OpenAI points to the usage dashboard at chatgpt.com/codex/settings/usage and suggests checking it every week or two so you learn your own pace before a deadline finds it for you.
How do I change the model in Codex CLI?
Type /model in a running session to switch the active model and, where available, the reasoning effort. This is the most valuable command in the CLI, because model choice is what decides your allowance. Moving routine work from GPT-5.6 Sol to Luna takes you from 10 to 100 messages per window on Plus to 250 to 2,000 on the same plan.
Codex CLI vs Codex app: what is the difference?
Same agent, different surface and different meter behavior. The CLI runs against your local repository, uses the tools already installed on your machine, and spends local messages. The app and the web surface can dispatch cloud chats, which run on GPT-5.6 Sol and draw from the same five-hour window, so cloud work quietly costs more of your local allowance.
Does Codex CLI work on Windows?
Yes, natively. Install with powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex", or use the npm package if Node is already on the machine. Windows has a couple of sandbox-specific slash commands the other platforms do not need, /setup-default-sandbox and /sandbox-add-read-dir, for when a command needs to read a path outside the default roots.
Can I use Codex CLI with an API key?
Yes, and it is the right choice for CI and shared environments, but understand the trade. OpenAI states an API-key sign-in gives you Codex in the CLI, SDK and IDE extension with no cloud-based features, so GitHub code review and the Slack integration are gone. Model availability follows your key and you pay standard API rates with no included allowance.
How do I run Codex CLI headless in CI?
Use codex exec rather than the interactive TUI. It streams progress to stderr and prints only the final message to stdout, so it pipes cleanly. Add --json for newline-delimited events, pair it with --output-last-message for a human summary, and set --sandbox workspace-write explicitly, because codex exec defaults to read only and will otherwise propose changes without applying them.
What are the Codex CLI commands?
The base command is codex for an interactive session and codex exec for scripted runs. Around those sit codex login, codex doctor, codex resume, codex fork, codex review, codex update and codex mcp. Inside a session, slash commands do the steering: /model, /permissions, /status, /compact, /diff, /init, /mcp and /import, which pulls in an existing Claude Code or Cursor setup.
Codex CLI vs Claude Code: which should a team buy?
Codex CLI is the more predictable purchase and Claude Code is the more capable one in long sessions. Codex gives you a documented message ceiling per five hours that resets on a clock; Anthropic publishes actual dollars, around $13 per developer per active day and $150 to $250 per developer per month. Buy Codex if you already pay for ChatGPT and work in bursts.
Last updated: September 2026
Keep researching
More on Codex: Codex vs Claude Code, Codex vs Cursor, Codex against GitHub Copilot and how the two sets of usage limits compare.
The other terminal agents: GitHub Copilot CLI pricing and install, Gemini CLI against Claude Code, Claude Code pricing and Cursor pricing.
A terminal is not the only place an agent can work
Connect a GitHub or GitLab repository, describe a task, and read the pull request it opens. Flat $29/mo billed yearly, no five-hour window, no credit rate card, and nothing merges without you.