Subscription and Pricing
📚 Series Navigation: The previous article 03 · Installation and Login got Codex installed and logged in using a ChatGPT account or API key. This article breaks down the bills—which plan you should subscribe to, how the money is spent, how the API key is a different story, and how to make your quota last longer.
They say "just subscribe to ChatGPT Plus and use Codex brainlessly," but to be honest, Codex pricing is not as simple as pay-and-use.
I fell into this trap myself when I first integrated Codex into my workflow in early 2026. I assumed the $20/month for Plus meant "unlimited monthly Codex," but after letting it run refactoring on a legacy project with over ten thousand lines for two consecutive days, I hit the limit the second afternoon—the CLI directly prompted me that "the usage for this window has reached its limit." I was puzzled; I had only sent dozens of messages a day, so why did it top out? Later, I figured it out: Codex's limit is not calculated by the "number of messages" but by "how many tokens each message burns". My dozens of messages were all "read large files + long tasks," where one message could equal ten normal ones.
What makes it even more confusing is that Codex has two completely different pricing models for the same tool: logging in with a ChatGPT account uses "subscription + quota," while logging in with an API key uses "real-time billing by token." When these two are mixed together, it is easy for beginners to get confused.
This article breaks down these two models. Understanding the pricing rules is more important than obsessing over which tier to subscribe to—for the same Plus subscription, someone who knows how to use it can make it last a month, while someone who doesn't can hit the ceiling in two days.
After reading this article, you will get:
- A comparison table of "ChatGPT subscription tiers vs. API key," so you know which path to choose
- An understanding of Codex's two pricing models (the subscription's "usage limit + quota" vs. the API key's "billing by token")
- How to use the
/statuscommand to check "how much quota is left" at any time in the CLI - A set of officially approved habits to "make your quota last longer"—enabling you to burn significantly fewer tokens for the same tasks
⚠️ Prices and limits are subject to change: The specific pricing, limit ranges, and credit unit prices in this article are snapshots from the official pricing page at a specific point in time. OpenAI adjusts prices and limits frequently, so please check the official site for current prices before purchasing; the numbers in this article are only to help establish concepts.
01 Make Sure You Understand: What Are You Paying For?
First, the conclusion: the Codex tool itself is free; you pay for the "model computing power" behind it.
Codex is just a command-line tool (with Desktop App, IDE extension, and Web entries), completely free to download and install. What actually costs money is the GPT series large models behind it—each step of asking questions, reading files, and writing code requires sending the content to the model for processing, and this processing volume is the billing unit.
Analogy: Codex is a free "ride-hailing app," and the model is the actual car running. Installing the App and registering an account cost no money, but once you hail a car and set off, every kilometer the car travels is billed—the more you ask, the larger the files it reads, and the longer it thinks, the longer the "mileage."
The unit of measurement for this "mileage" is the token (the smallest billing block the model splits text into). Analogy: Tokens are like the "metered word count" of text. When you send text to the model, it is split into tokens: what you send counts as "input tokens," and what it returns counts as "output tokens," with output usually being significantly more expensive than input.
Here are some real scenarios where tokens pile up quietly every day:
- Asking it to "read this 2000-line file and modify it"—the entire file is converted into input tokens and sent
- Reaching the 50th message in a conversation—the previous 49 messages are resent as context every time
- Placing a long and wordy
AGENTS.md(the project instruction file for Codex) in the root directory—it packs this instruction file into every message
So how much you spend has little to do with "how many questions you ask" and everything to do with "how much context you pack in each time"—this is the core key to saving tokens later, so keep it in mind.
💡 Summary in one sentence: The tool is free; you pay for the model's computing power billed by token—input + output + context all cost money.
02 Two Pricing Models: ChatGPT Subscription vs. API Key
Now that you know about paying for tokens, the next critical question is: how do you pay this money? Codex has two paths, and they differ significantly. Let's start with a table, then explain in plain terms.
| Dimension | ChatGPT Subscription Login | API Key Login |
|---|---|---|
| How Billed | Fixed monthly fee, including a certain "usage limit"; buy credits to continue once exceeded | No monthly fee, real-time billing by actual token usage |
| Payment Mindset | Ceiling is controllable; you know what to expect at the start of the month | Floating; pay for what you use, bill known after the fact |
| Cloud Features (Auto code review, Slack, GitHub, etc.) | ✅ Yes | ❌ Mostly none |
| New Models | Available immediately | Delayed release (e.g., new models like GPT-5.3-Codex-Spark arrive later) |
| Suitable for | High-frequency daily personal use, wanting fixed expenses | CI/CD, automation scripts, running Codex in shared environments |
| How to Log In | codex login (Browser authorization of ChatGPT account) | API key login (Select API key method in codex login) |
(Sources: official pricing and auth docs)
These two paths are not about "which is more cost-effective" but "how you use it." Breaking them down:
ChatGPT Subscription is the path most individual developers should take. If you already subscribe to Plus / Pro, Codex is included within the subscription and follows the limit—no need to bind a card separately or watch real-time bills, and you can decide whether to buy credits when you hit the limit. Cloud features (GitHub auto code review, Slack integration) are also only available with a subscription login.
API Key is for "machines," not for "humans" to chat with daily. The official docs explicitly recommend it for programmatic scenarios, such as CI/CD pipelines—running Codex in scripts, billing token costs in real time at standard API rates. The trade-offs are: no cloud features, and delayed access to new models. So if you are an individual sitting in front of a computer writing code, don't use API keys out of convenience; it is usually less cost-effective and misses features.
About "how money is calculated when using an API key": It follows the standard API prices on the OpenAI Platform, which are completely separate from the limits and credits of ChatGPT subscriptions. The specific unit prices are subject to the API pricing page, which is not hardcoded here.
My combination is: using a ChatGPT subscription login when typing by hand in the terminal, and switching to an API key only when writing automation scripts or letting it run batch tasks at night. The two sets do not interfere with each other, and the bills are clear.
💡 Summary in one sentence: Humans use subscriptions, machines use API keys—subscriptions offer peace of mind and cloud features, while API keys target precise metering in automation. Don't mix them up.
03 Choosing ChatGPT Tiers: Plus / Pro / Business / Enterprise
If you take the subscription path, the next step is choosing a tier. I have compiled a comparison table of the tiers containing Codex capabilities listed on the official pricing page (specific amounts are subject to change, so focus on the concepts):

This diagram lists the Codex capabilities comparison across five tiers: Plus, Pro, Business, Enterprise & Edu, and API key. Let's break down each tier in the text.
| Tier | Monthly Fee (Ref) | Codex Usage (Relative) | Key Features | Suitable for |
|---|---|---|---|---|
| Plus | $20/mo | Base amount | Web/CLI/IDE/iOS all entries, cloud auto-review + Slack, latest models | Individuals, a few focused coding sessions a week |
| Pro | From $100/mo | 5x or 20x of Plus | All Plus features + a fast model for daily use (Research Preview) | Heavy users, running Codex extensively every day |
| Business | Pay as you go | Same level as Plus, credits can be added | Team seat management, larger cloud VMs, SSO/MFA, data not trained by default | Startups, growing companies |
| Enterprise & Edu | Contact Sales | Elastic pricing, usage scales with credits | All Business features + priority processing, SCIM/RBAC, audit logs, data residency | Organization-wide deployments |
(Source: official pricing page)
Let's put this in plain terms:
Plus ($20) is the starting point for most people. It has all the entries you need (Web, CLI, IDE extension, iOS) and cloud features (auto code review, Slack), and latest models are available immediately. The only suspense is "whether the limit is enough for you"—which is the trap I fell into when I hit the ceiling in two days. The next section focuses on the limits.
Pro (From $100) has one main selling point: a significantly increased limit. The official docs state plainly that Pro offers "5x or 20x higher" Codex usage than Plus, along with a fast model for daily programming (currently in research preview). Simply put, it is for heavy users who get annoyed by hitting limits on Plus and don't want to buy credits manually. I debated upgrading to Pro after my refactoring limit incident, but ultimately didn't—because by using the token-saving habits in Section 05, Plus became sufficient again. Learn to save before considering upgrading.
Business / Enterprise & Edu are for teams and organizations. Business works on a "pay-as-you-go + seats" model, providing team management and security controls; Enterprise & Edu add priority processing, compliance audits, and data residency on top. Individual developers rarely need them; just know they exist.
What about Free and Go?
Many ask: Can I use Codex on the free version of ChatGPT (Free) or the entry-tier Go?
To be honest, the official Codex pricing page is vague here. As of the snapshot referenced in this article, the lowest tier explicitly listed on the pricing page as containing Codex capabilities is Plus ($20). Free is only briefly mentioned in a sentence stating "image generation is not supported in the free tier," and the Go tier does not appear on the entire page.
So my judgment and recommendation:
Analogy: This is like a "free trial pass" vs. a "formal membership" at a gym. A trial pass might let you enter the door and look around, but core services like equipment and personal trainers usually require a formal membership to unlock. Codex's core programming capabilities are explicitly placed in Plus and above.
- Do not expect Free / Go to run Codex programming seriously—at least the official pricing page promises no quota for them.
- If you really want to try it for free, the Sites feature on Codex Web is free during the preview period (Source: pricing docs), which you can use to get a feel for it, but this is not the same as "using Codex to write code for free."
- Whether Free / Go contains Codex and how much is subject to official policy adjustments—check the current tier descriptions on chatgpt.com/pricing before placing an order, and do not trust any secondhand claims of "unlimited use on the free version."
💡 Summary in one sentence: Individuals start with Plus, upgrade to Pro if limits are annoying, and teams look at Business and above; whether Free / Go can use Codex is vague officially, so refer to the current official site and do not assume you can use it for free.
04 How Limits Are Calculated: 5-Hour Window + Credits
This is the area that confuses beginners the most, and is the real reason behind my "two-day limit hit" at the start. Let's clear up two things: how limits are counted and what to do when exceeded.
Limits Are Billed on a "5-Hour Rolling Window," Not Daily
The official documentation divides Codex usage limits into Local Messages and Cloud Tasks, which share a single "5-hour window" (Source: pricing docs). That means every 5 hours is a metering cycle; it is not as simple as "resetting daily," and there may also be a weekly cap. (The exact calculation of the window is subject to current official descriptions.)
More importantly—the limit is a range, not a hard number. For example, Plus is listed with "15–80 local messages per 5 hours on GPT-5.5." Why is it a range? Because:
The number of Codex messages you can send depends on the model used, the size and complexity of the programming tasks, and whether you run locally or in the cloud. Small scripts or routine functions may consume very little quota, while large codebases, long-running tasks, and long sessions requiring Codex to remember more context will consume significantly more quota. (Translated from official pricing docs)
Seeing this explain why I hit the limit in dozens of messages—each of my messages was "large codebase + long task," burning quota several times faster than small scripts. For the same Plus tier, you might send dozens of messages modifying small functions, while I might hit the limit in a dozen messages trying to digest a large project.
Quota Limits Across Tiers
Here are the official numbers (GPT-5.5 model, local messages per 5 hours, for concept building only; refer to the official site for actual values):
| Tier | GPT-5.5 Local Messages / 5 Hours (Ref) |
|---|---|
| Plus | 15–80 messages |
| Pro (5x) | 80–400 messages |
| Pro (20x) | 300–1600 messages |
| Business | 15–80 messages (Same level as Plus, credits can be added) |
(Source: official pricing page; the same page lists higher limits for GPT-5.4 and GPT-5.4-mini; switching to smaller models lets you send more messages.)
This table reveals a cost-saving signal: under the same tier, switching to a smaller model (such as GPT-5.4-mini) can multiply your message limit. This will be used in Section 05.
What if You Exceed the Limit? Buy Credits
Don't panic if you hit the limit, and don't rush to upgrade your subscription. The official solution is to buy credits:
ChatGPT Plus and Pro users can purchase additional credits to continue working after hitting their usage limits, without upgrading their existing subscription. (Translated from official pricing docs)
Analogy: Credits are like "add-on data packs" when your monthly mobile data runs out. The subscription limit is your "monthly data," and if you go over, you don't have to upgrade to a more expensive plan; just buy an add-on pack to continue. For Business / Enterprise / Edu, the equivalent is purchasing "workspace credits."
Credits are also calculated by token—the official docs provide a rate card showing "credits per million tokens," along with a very practical reference value:
GPT-5.5 consumes an average of 5–45 credits per message. (Translated from official pricing rate card)
Just remember this "5–45 credits/message" scale; the specific credits per million tokens and model rates are subject to change, so refer to the official rate card.
💡 Summary in one sentence: Limits are calculated based on a 5-hour cycle + model and are a range rather than a fixed number; working on large projects burns them faster, and you can buy credits to continue when you hit the limit instead of upgrading immediately.
05 Making Quotas Last Longer: Officially Approved Habits
Upgrading to a more expensive tier is the last resort; knowing how to use the tool is the best way. Going back to Section 01—how much you spend is highly correlated with how much context you pack in. The four tips below are all from the "how to make limits last longer" section of the official pricing docs, and I have verified each one myself.
First, make prompts specific and remove unnecessary context. The official docs state: "give Codex precise instructions and remove unnecessary context." The more vague you are, the more it has to scan your project to guess what you want to do, burning tokens on every file it reads. When I reviewed my refactoring limit hit, more than half of the tokens were burned when it was blindly reading files trying to guess where to modify. Later, I changed my prompts to "modify the login function in src/auth.ts to add input validation," saving tokens immediately.
Second, slim down AGENTS.md. AGENTS.md is the project instruction file for Codex, and it packs this content into the context of every message. The official docs recommend "nesting" for large projects (placing smaller AGENTS.md files in different subdirectories) instead of keeping a giant, hundreds-of-lines file in the root directory. I once trimmed a root AGENTS.md from over two hundred lines to dozens of lines, and the input tokens for each message dropped visibly.
Third, reduce connected MCP servers. For every MCP server (external tool interface) you connect, its tool descriptions are packed into the context of your messages, consuming more quota. The official recommendation is to "close MCP servers when not in use." Simply put: only open them when needed, don't keep them all running.
Fourth, switch to smaller models for routine tasks. The official docs state that "switching to GPT-5.4 or GPT-5.4-mini extends your local message limit." Combined with the table in Section 04—smaller models offer several times the message limit on the same tier. For daily coding edits and minor bug fixes, switching to a smaller model with /model is plenty; save the strongest models for tough tasks.
The table below can serve as a "quota-saving cheat sheet" next to your monitor:
| Bad Habit ❌ | Good Habit ✅ | Where It Saves |
|---|---|---|
| "Help me improve this project" | "Modify the login function in src/auth.ts to add input validation" | Fewer blind file reads |
Giant, hundreds-of-lines AGENTS.md in root | Slim down + distribute by subdirectories | Less context sent in every message |
| Keeping all MCP servers connected | Open only when needed, close after use | No paying for unused tools |
| Using the strongest model for everything | Switch to GPT-5.4-mini for routine tasks | Quota limits multiply on the same tier |
Add a practical CLI habit: switch to a new conversation with /new when changing to an unrelated task. /new resets the chat context without exiting the CLI (Source: official CLI slash commands)—otherwise, if you keep the same conversation going from morning to night, every message in the afternoon will resend the useless morning history, wasting your quota.
💡 Summary in one sentence: Saving quota is not about paying for expensive plans; it is about clear prompts, slimmed-down
AGENTS.mdfiles, on-demand MCP usage, smaller models for routine tasks, and resetting context with/new. The smaller the context, the longer the quota lasts.
06 Hands-on: Monitoring Your Usage in the CLI
Reading concepts is not enough; run this sequence right now to build "usage awareness" in a few minutes.
Prerequisite: Codex is installed and logged in (via ChatGPT subscription or API key) as described in 03 · Installation and Login. Mainland China network tip: logging in with a ChatGPT account and running cloud tasks usually requires a VPN, while running locally with an API key depends on whether your network can directly connect to the OpenAI API.
Launch Codex in your project directory:
codexStep 1: Check the current session status and remaining quota with /status. Type directly in the Codex conversation:
/statusIt will display the current model, approval policy, writable directory, and remaining context capacity among other session configs and token usages (Source: official CLI slash commands). The pricing docs also point to using /status to check remaining limits:
To view remaining limits while a Codex CLI session is active, you can use /status. (Translated from official pricing docs)Focus on two things: whether the current model is correct (avoid keeping the strongest model enabled for routine tasks) and how much remaining quota you have. Knowing before you hit the limit is much better than being blocked suddenly.
Step 2: Ask it to do a small task, then check again. Send a small instruction first:
Check what files are in the current directory and briefly explain what this project does.Once it responds, run /status again to compare how much the context usage grew. This is the cost of "asking a simple question + reading the directory"—with this benchmark, you will easily notice if a conversation is burning quota abnormally.
Step 3: Switch to a smaller model for routine tasks. Use /model to switch the current model and reasoning intensity (Source: official docs; /model selects the active model and can be switched mid-session):
/modelFollow the prompts to select a smaller model (such as GPT-5.4-mini) for daily tasks, extending your quota. You can also specify it directly on startup, for example:
codex --model gpt-5.5(The model names after --model are subject to what is currently available on your account, which you can check via /status.)
Step 4 (Subscription Users): View the full usage panel on the web. The /status command in the CLI shows the current session; to view your full usage and remaining limits across devices, go to the official usage panel:
https://chatgpt.com/codex/settings/usage(Source: official pricing docs point to this Codex usage dashboard.)
API Key Users: You do not follow ChatGPT limits; view your bills and usage in the OpenAI Platform backend (platform.openai.com), not this dashboard. However, the habits of running
/statusto check context and/newto reset context still apply.
After running these steps, you will upgrade from "burning quota blindly" to "knowing what is left and saving actively."
💡 Summary in one sentence: Use
/statusto build a benchmark for remaining limits →/modelto switch to smaller models and save quota → the web dashboard to view global usage to regain control over your expenses in minutes.
07 Summary
This article has broken down the billing of Codex:
| What You Learned | Key Points |
|---|---|
| Why Pay | The tool is free; you pay for the model's computing power billed by token |
| Two Pricing Models | Humans use ChatGPT subscriptions (limits + credits), machines use API keys (billed by token in real time) |
| Choosing Tiers | Individuals start with Plus, upgrade to Pro if limits are annoying, and teams look at Business and above |
| How Limits Work | 5-hour rolling window + model, range rather than fixed number; large projects burn quota faster; buy credits if exceeded |
| How to Save Quota | Specific prompts, slimmed-down AGENTS.md, on-demand MCP, smaller models for routine tasks, and /new for task switching |
If you remember only one thing: how much you spend is highly correlated with how much context you pack in, not how many questions you ask. Master this, and you can derive all the quota-saving techniques—understand the two billing systems, check session expenses, buy credits when limits are hit, and run tasks more efficiently.
⚠️ Again, to emphasize accuracy: subscription fees, limit ranges, and credit rates are subject to change; refer to the current official pricing page or chatgpt.com/pricing; behaviors of commands like /status, /model, and /new are subject to the official CLI docs and may update with versions (codex --version checks version).
Now that the bill is clear and you have chosen a subscription tier, if you are based in mainland China and find setting up official subscriptions (which require foreign credit cards + VPNs) too troublesome, there is an even more cost-effective way—the next article, 05 · Connecting Third-Party Models, will teach you how to connect models like DeepSeek, Kimi, and GLM to Codex, allowing you to run Codex without an OpenAI account. This path is highly practical for domestic developers.