Codex CLI fix: Codex stops mid-task and says the usage limit is reached

Codex usage limit reached

The Codex usage limit is a rolling allowance on your ChatGPT account, not a daily quota and not a fault on your machine. Codex meters a 5-hour window and a weekly window, the message tells you when the one you filled resets, and /status inside the Codex CLI shows how much of each is left. The line itself comes from ChatGPT, so the only questions that matter are which window you filled, when it turns over, and whether you want to pay to keep going before then.

You've hit your usage limit. Upgrade to Pro
Printed by Codex CLI.

Diagnosis

What it actually is

Two rolling windows, not a monthly quota

ChatGPT meters Codex on a 5-hour window and a weekly one. The time in the message is the end of whichever window you filled, which is why the same account is free again within the hour on one day and blocked for days on another.

Nothing on your machine caused it

Codex CLI is relaying what the backend answered. Reinstalling the CLI, clearing $CODEX_HOME or starting a fresh session changes nothing, because the counter lives on the account rather than on the box.

A reset credit may be sitting unused

ChatGPT grants rate-limit reset credits to some accounts. They are separate from the usage windows and from purchased credits, and spending one lifts the current limit at once. The app-server returns them as rateLimitResetCredits beside the windows, so reading only the windows is how a granted credit stays invisible.

The weekly window does not always arrive where you expect

Codex ships the two windows in a primary and a secondary slot, and it now sends the weekly one as primary with secondary empty. Anything that reads the slot rather than the window length can label a weekly block as a 5-hour one, which turns a four-day wait into a promise of forty minutes. It also means some accounts report only a weekly window, which is why /status is a better source than any rule of thumb.

ChatGPT Work spends the same allowance

OpenAI's Codex pricing page says ChatGPT Work and Codex share usage, and that ChatGPT Work inside ChatGPT uses the same pricing, credits and usage limits as Codex. Work you did in the ChatGPT app can therefore be what filled the window your terminal just hit.

Some models burn it faster than others

The window counts usage, not prompts, and models cost it at different rates. Codex itself describes GPT-6 Luna as significantly more efficient, so your usage limits go even further, and flags some options with Consumes usage limits faster. Long agentic turns at high reasoning effort on a frontier model empty a window far sooner than short ones on a light model.

The message changes with your plan

Codex prints different endings for the same limit depending on the account. One suggests upgrading to Plus, one offers Pro and https://chatgpt.com/settings/usage to purchase more credits, one offers only the credits link, and one says To get more access now, send a request to your admin, because on a managed workspace the admin, not you, controls the credits. The ending tells you which levers your account actually has.

An API key does not use these windows at all

Signed in with an API key, Codex bills through your OpenAI Platform account at API prices. The pricing page puts it as pay for Codex usage based on API pricing. The ChatGPT 5-hour and weekly windows belong to a ChatGPT sign-in only, so this message means the CLI is signed in with ChatGPT.

Check

Confirm it before you fix it

Run thisWhat a good answer looks like
codex login statusOne line, Logged in using ChatGPT or the API-key equivalent. Worth ruling out first: the limit is per account, and a machine signed in as an account you did not expect has a different set of windows.
/statusTyped inside an interactive Codex session. It shows the session configuration and token usage, and when signed in with ChatGPT, how much of each usage window is left and when it resets. Codex points you at it itself when a window runs low: limit left. Run /status for a breakdown. If it says the limits may be stale, run it again shortly.
/usageAlso inside a session, and only for a ChatGPT sign-in: it shows account usage and is where you spend a usage limit reset if the account has one. Codex prompts Run /usage to use one. when a reset is available.
codex doctor --summaryGrouped rows and a count. The auth, network, websocket and reachability rows separate a usage limit from a connectivity failure, which stall in a similar way and are fixed by nothing alike.

Every command here has been run on a real machine. Termdeck answers the same questions for every machine you have connected, without opening a terminal on any of them.

Fix

Cheapest thing first

1. Read which window it was

The reset time in the message is the answer. Under an hour means the 5-hour window and the work continues once it turns over. Days out means the weekly window, and no amount of retrying moves it.

2. Look for a reset credit before paying anything

If the account holds one, spending it lifts the current limit immediately. Run /usage in Codex to use it. It is a one-shot grant rather than a plan change, and it is the cheapest lever on the page.

3. Switch to a lighter model for the rest of the window

Use /model in the session and pick a model Codex describes as more efficient. The same allowance then goes further, which often finishes the task before the window turns over. The Codex models and effort guide covers the trade-off.

4. Buy credits, or move up a plan, in that order

Credits are bought at https://chatgpt.com/settings/usage, are consumed as you use them and leave the plan alone. A plan change raises the windows themselves and is the right lever only if you fill them most weeks. On a workspace plan, ask your admin.

5. Run the overflow on an API key

Pipe a key in with printenv OPENAI_API_KEY | codex login --with-api-key and Codex bills at API prices instead of drawing on the plan. Sign in with ChatGPT again with codex login once the window resets. Note that an API key reaches the models your API key covers, which is not the same list as your plan.

6. Continue on another login

The windows follow the ChatGPT account. A second login carries its own, so signing into it finishes the session instead of waiting out the window. Termdeck keeps several logins per machine, shows each one's windows side by side in Settings, Machines and accounts, and switches mid chat without losing context; it also shows a reset pill when the account has a reset to spend. See Accounts and rate limits.

Not this

What will not help

Reinstalling or updating the CLI

The counter is on the account. A fresh install signs into the same account and meets the same window a second later.

Deleting the session and starting over

Rate limiting has nothing to do with your transcript. Starting again throws away context you then have to rebuild once the window turns over anyway.

Logging out and back in to the same account

It clears nothing. The windows live on the ChatGPT account, so the same account signs in to the same filled window.

FAQ

Codex stops mid-task and says the usage limit is reached, answered

Is there a limit on using Codex?

Yes, when you sign in with ChatGPT. Codex is included in ChatGPT plans and is metered on rolling usage windows shared with ChatGPT Work. Signed in with an API key there is no plan window; you pay API prices for what you use.

Does Codex still have a 5 hour limit?

Codex still tracks a 5-hour window and a weekly window, but not every account reports both: some now get only the weekly one. Run /status in a Codex session to see exactly which windows your account has and when each resets.

How do I know my Codex limit?

Type /status in an interactive Codex session. Signed in with ChatGPT, it shows how much of each window is left and when it resets. Termdeck shows the same windows in the sidebar for every connected machine, read on that machine.

How do I increase my Codex usage limits?

Spend a reset credit if the account has one, buy credits at chatgpt.com/settings/usage, move up a plan, or run extra work on an API key at API prices. On a workspace plan the admin controls credits.

Does the Codex usage limit reset at midnight?

No. Both windows roll, so each one turns over a fixed period after the usage that filled it rather than at a fixed time of day. The message names the exact moment.

Is the 5-hour window the same as the weekly one?

They are separate and either can stop you on its own. An account can be well inside its weekly allowance and still be blocked by the 5-hour window.

Do purchased credits remove the limit?

Credits let work continue past a filled window and are consumed as you go. They do not raise the windows themselves; a plan change does that.

Does using ChatGPT count against my Codex limit?

ChatGPT Work does. OpenAI says ChatGPT Work and Codex share usage, with the same credits and usage limits, so heavy Work use in the ChatGPT app leaves less for the CLI.