Guides · Updated October 23, 2026
Codex usage limit reached: 5-hour and weekly limits explained
“You’ve hit your usage limit” in Codex means one of your ChatGPT plan’s allowances is used up. Which one, and what you can do about it, depends on your plan and on the exact wording of the message. This guide covers the windows Codex meters, what each message means, how a usage limit differs from a rate limit, where to watch your remaining usage, and why a single long or looping session can empty a window early.
The limits on a ChatGPT plan
From OpenAI’s Codex pricing page and help articles on using Codex with your ChatGPT plan and resets:
- Plus and Standard Business: a 5-hour window and a weekly window. The same usage counts against both, and you need room in both to keep working. The two can end at different times.
- Pro ($100, $200, $500): currently no 5-hour limit, only the weekly allowance.
- Go: a monthly allowance.
- Enterprise/Edu with flexible pricing: no fixed rate limits; usage draws on workspace credits.
- Shared pool. Codex in the CLI, IDE extension, desktop app and cloud shares one allowance, along with ChatGPT Work and other agentic features where they apply. Cloud tasks may use more of it than local messages.
OpenAI doesn’t publish a fixed number of messages. Its estimates for local messages per 5-hour window on Plus are 15–160 with GPT-6.1 Sol, 5–45 with GPT-6 Astra and 350–3,000 with GPT-6 Luna, and it stresses that these are not fixed limits: model, context, reasoning, tool use and caching all change how much a message uses. Fast mode uses included usage at 2.5× the Standard rate, and Ultrafast at 8×.
On an API key none of this applies. You pay per token at API prices, and the controls are spend limits on the OpenAI platform (see capping Codex CLI spend).
Which message did you get?
The wording depends on your plan. These are the strings in the Codex CLI source (codex-rs/protocol/src/error.rs, checked October 23, 2026):
| Message starts with | What it means |
|---|---|
You’ve hit your usage limit. Upgrade to Pro …, visit https://chatgpt.com/settings/usage to purchase more credits or try again at … | Plus: an allowance is used up. Buy credits, upgrade or wait. |
You’ve hit your usage limit. Visit https://chatgpt.com/settings/usage to purchase more credits or try again at … | Pro: your allowance is used up (Pro currently has only the weekly window). Buy credits or wait. |
You’ve hit your usage limit. Upgrade to Plus to continue using Codex … | Free or Go. |
You’ve hit your usage limit. To get more access now, send a request to your admin … | Business and other workspace plans: an admin controls more access. |
You’ve hit your usage limit for <name>. Switch to another model now, … | A limit for one model or feature only. Another model still works: switch with /model. |
Your workspace is out of credits. / You hit your spend cap set in your workspace. | Credit-based workspace: the credits or a spend cap set by the owner ran out. |
The time after “try again at” is when the exhausted window refreshes, in your computer’s local time: just a clock time if it’s today, a full date otherwise. A date several days out means it’s the weekly window, not the 5-hour one.
Usage limit or rate limit?
They are different errors in the source, and Codex treats them differently:
- Usage limit (the messages above): your plan allowance is gone. Codex does not retry; the turn stops until you act or the window resets.
- Rate limit (
rate limit exceeded: …): a short-term throttle on requests. Codex retries it on its own with the server’s suggested delay or exponential backoff. It is not your quota. Quota exceeded. Check your plan and billing details.is also terminal, and points at billing rather than a plan window.
If you hit the limit in the middle of a turn, OpenAI says Codex can keep working on that turn, subject to fair-use limits. The next turn is the one that stops.
How to see where you stand
/statusin an active CLI session shows the chat ID, context usage and your remaining rate limits. This is the check OpenAI’s help center points to during a CLI session./usageopens the usage menu: daily, weekly or cumulative token activity (/usage daily,/usage weekly,/usage cumulative), or redeeming an earned reset (slash commands)./statuslinecan add a rate-limits item to the footer, so you see it without asking.- The Codex usage dashboard shows current limits, reset times and credits. OpenAI suggests checking it every week or two to learn your pace.
What to do when you hit it
- Wait for the time in the message.
- Use a banked reset if your account has one (
/usage, or the usage summary that says “1 reset available”). A full reset refreshes your windows and moves your weekly reset date. It’s only consumed if it actually restores something. - Buy credits (Plus and Pro) to keep going past the limit without changing plans. Credits are a separate pay-as-you-go balance used after your included usage.
- Buy an instant reset, where offered on Plus and Pro, from Usage settings in the desktop app or the weekly-limit banner. It applies immediately even if you have usage left, can’t be saved, restarts your weekly period from your next request, and OpenAI generally doesn’t refund it (help article).
- Upgrade, or run local sessions on an API key at API rates.
OpenAI Support doesn’t reset usage limits. Contact them only if the numbers look wrong or access hasn’t returned after the stated reset time.
Why one session empties a window
A Codex turn sends your prompt, files, chat history and tool results, and OpenAI notes that long-running tasks and sessions that hold a lot of context use far more per message. A few things make it worse:
- Long sessions. Every turn re-sends a growing history.
/compactreplaces earlier turns with a summary;/newstarts a fresh chat in the same CLI session. - Heavier models and speed modes. Compare the Luna and Astra estimates above: model choice changes how far a window goes by an order of magnitude. Fast and Ultrafast multiply usage.
- Context you didn’t mean to send. A large
AGENTS.mdand every enabled MCP server add to each message. OpenAI recommends trimming both. - Loops. An agent that reruns the same failing command, or keeps compacting without progress, spends a full context’s worth of usage per attempt. OpenAI’s own advice when Codex repeatedly shows “Context automatically compacted” without progress: stop the task and start a new chat with a short summary of the goal and the work done. (A new chat doesn’t reset your limits.)
Catch a looping Codex session before it eats the window
Plan limits stop you after the usage is gone. To stop one bad session early, something has to check on every tool call. Codex CLI runs hooks for that, and LoopGuard is an open-source (MIT) CLI that installs them. It needs no proxy and no API key, so it works on a ChatGPT plan.
npm i -g loopguard-cli # puts `loopguard` on your PATH loopguard init --agent codex # adds PreToolUse, PostToolUse and Stop hooks (original config backed up) codex # then run /hooks and trust the three LoopGuard hooks loopguard config set sessionCapUsd 10 # estimated $ per session (default 25) loopguard report --agent codex --by session # what recent sessions would have cost at API prices
- Trust the hooks. Codex asks you to trust new hooks. Until you do, it skips them without saying so in
codex exec. - Loops: the same tool call 5 times within 10 minutes with no change to the git working tree or to the call’s output in between is denied. Cosmetic rewrites of a shell command (
bash -lc '…',2>&1,| tail -50) count as the same call. The block message tells Codex to stop rerunning it, write down the goal, what it tried, the exact failing output and its hypotheses, and find the root cause first. - Spend: LoopGuard reads the token counts Codex writes to
~/.codex/sessions/**/rollout-*.jsonl, prices them at API list prices, and denies tool calls past a per-session cap, a daily cap, or a $10 jump within 5 minutes. - How it stops Codex: a denied call exits with code 2 and the reason on stderr. Codex hooks have no field to end a session, so LoopGuard ends it by denying every further tool call.
Be clear about what this measures. LoopGuard does not read your plan percentage; the dollar figure is an estimate at API prices, which OpenAI says not to use to estimate included usage. Treat it as a consistent measure of how heavy a session is, and calibrate it against /status after a few days (if about $15 of estimated spend is your 5-hour window, set sessionCapUsd below that). Checks run at each tool call, so a single long model response isn’t cut off mid-stream.
Related
- How to stop runaway Claude Code, Codex and Cursor agent loops
- How to track AI coding agent token costs per session
- How to set a spending limit for Claude Code
- How to limit Cursor agent usage costs
- How to cap OpenAI Codex CLI spend
- Claude Code usage limit reached: why it happens and how to monitor it
- How to set a hard budget for AI coding agents in CI
- Claude Code stuck in a loop: how to break it and stop it repeating the same command
- Cursor agent stuck in a loop: how to stop it, roll back, and keep it from repeating
- Why Claude Code uses so many tokens, and how to use fewer
- How to set a budget limit for Aider
- GitHub Copilot agent mode stuck in a loop: how to stop it and keep it from repeating
- Cline stuck in a loop: how to stop it, roll back, and cap what it spends
- Gemini CLI usage limits: daily quotas, the June 2026 change, and keeping costs in check
- Codex stuck in a loop: how to stop it, undo it, and keep it from repeating