TL;DR
"Claude Code usage limits" actually means two different things, and mixing them up costs you a lot of wasted time:
- The 5-hour session limit (what people call the "5h limit"): a session window included with most paid subscriptions. It resets every five hours, and it sits alongside a separate weekly limit. It is a seat allowance shared across every model — once you hit it, switching models with
/modelwill not bring your access back. - Model-specific limits: Opus and Sonnet each carry their own allowance. If that is the one you hit, moving to a different model family keeps you working.
When you hit the 5-hour cap, there are three real paths: wait for the window to reset (no extra spend, you lose time), turn on Anthropic's usage credits (your requests switch to pay-as-you-go at standard API rates and keep running), or point Claude Code at a pay-as-you-go API endpoint (billed per token, with no session window involved).
The third option is routinely misdescribed as "bypassing Claude's limits," so let's be precise: it is not a way around any rule. Subscription seat allowances exist only inside a subscription seat. A token-metered API endpoint has no session window — but it is still metered per token, and it stops when your account balance runs out.
Below: the three options costed out, and why the subscription's 5-hour cap and API-side 429 rate limits are two completely different problems.
1. What the "5-hour limit" actually is
1.1 The official definition: a window that resets every five hours, plus a weekly limit
Anthropic's help center article on managing usage credits for paid Claude plans states it plainly: most paid plans include a session limit that resets every five hours, along with a weekly limit.
Three details in that sentence are the difference between understanding this and not:
- The window is rolling, not a calendar slot. The reset is measured from when you start consuming, so "wait until tomorrow morning" is the wrong mental model.
- The session limit and the weekly limit are separate lines. A fresh 5-hour window does not mean you still have weekly quota, and unused weekly quota does not help once the session window is exhausted.
- Plans differ. Per the same official article, the Ultra plan has a weekly limit, verified Ultra accounts do not have a five-hour limit, and Max and Ultra each carry a separate weekly limit for Fable. (Official wording, as-of 2026-11-07)
So "I am on Max, why do I still have limits?" is answered by which lines your plan actually includes and how each one resets — not by the size of the allowance.
1.2 Two limits you must keep apart
The Claude Code documentation splits the limit questions developers actually ask into two categories, with very different behavior:
- "You've hit your session limit" or "You've hit your weekly limit": a seat-based usage window on a subscription plan, shared across all models. Switching models with
/modeltherefore does not restore access. The docs are explicit about this when they explain how to tell which ceiling you hit. - "You've hit your Opus limit" or "You've hit your Sonnet limit": a model-specific allowance. When this is the one you hit, moving to a model outside that family with
/modeldoes keep you working.
That distinction is practically useful:
- Model-specific limit → switch model family and keep going (assuming you can live with the different model).
- Session or weekly limit → switching models is pointless. You wait for the reset, or you move to a different billing path.
1.3 Check where you stand with /usage
Running /usage inside Claude Code shows your plan usage bars, activity stats, and a usage breakdown on Pro, Max, Ultra, Team, and Enterprise plans. The docs also note that this view attributes recent usage to individual skills, subagents, plugins, and MCP servers as percentages — which is a better answer to "what ate my quota" than guessing.
2. Why people hit it, and what Anthropic ships as workarounds
2.1 It is rarely about "using it a lot"
Allowances are measured per seat window, so one long-running job plus parallel subagents can burn an entire window in a couple of hours. The usual culprits:
- Long autonomous runs where nearly all spend is on generated output tokens;
- Subagents and plugins splitting work across parallel streams;
- Context rebuilt repeatedly in a long session, inflating metered input.
2.2 Three official levers
The Claude Code docs describe three things you can actually use:
/usage-credits— request usage beyond your allowance when usage credits are enabled on the plan.- Automatic wait and resume — Claude Code v2.1.234 introduced automatic continuation when a claude.ai usage limit resets (turn it off in
/configunder "Continue automatically at usage limit"). v2.1.284 added/rate-limit-optionsto/helpand the command menu, where you choose whether Claude Code starts the wait on its own or waits for your confirmation; theautoContinueAtUsageLimitmanaged setting sets the default for an organization. (Official docs + changelog, as-of 2026-11-07) /usage— check the current window whenever you want.
2.3 What usage credits are
Per the same official article: once you have fully used your plan's included limits (any five-hour session limit, your weekly limit, or the Fable weekly limit on Max and Ultra), with usage credits enabled your requests switch to pay-as-you-go pricing on usage credits and keep working. Subsequent usage is billed at standard API pricing rates until you reach your monthly spend limit or your balance runs out with auto-reload off. Usage credits are billed separately from your subscription, and the monthly API credits included with Max and Ultra do not apply to them.
Worth noting: Anthropic itself offers a "hit the cap, switch to pay-as-you-go" path. The difference is only whose meter it runs on and at what price.
3. Three ways forward when you hit the cap
3.1 Wait for the window to reset
- Cost: nothing extra.
- Price: the wait, which is unpredictable and often lands right before you wanted to ship.
- Suits: work that can be interrupted, when the current window still has room.
3.2 Turn on Anthropic usage credits
- Cost: standard Anthropic API rates, plus whatever spend limit you set for the credits.
- Upside: billing, caps, and receipts stay on the Anthropic side.
- Suits: teams that already run Anthropic API billing.
3.3 Switch to a pay-as-you-go API endpoint
The idea is to point Claude Code at a token-metered compatible endpoint instead of a subscription seat:
- Allowances are not granted on a session window, so there is no "wait a few hours for the reset" step;
- billing is official list price × a fixed 1.07x multiplier, deducted per token as you go;
- the operational steps are: top up for credit → create an API key → point Claude Code's base_url at it.
Stated plainly, to avoid the wrong takeaway: a pay-as-you-go endpoint is still metered per token and stops when your balance is exhausted. What changes is how the allowance is granted (metered spend vs. a seat window), not whether you are charged. It does not alter any of Claude Code's own rules either.
3.4 How to choose
- Wait for the reset: free, costs time, fine for interruptible work.
- Anthropic usage credits: standard API rates, billed by Anthropic, good if Anthropic already appears on your invoice.
- Pay-as-you-go endpoint: metered per token, budgetable, good when you need continuous output or want one settlement across several models.
Two questions decide it: can this work wait?, and where do you want the usage cost to land on the invoice?
4. Don't confuse this with API-side 429 rate limits
This is the most common misdiagnosis. "Claude Code stopped working" can mean two unrelated things:
- The session limit in this article: a subscription seat allowance running out while you use Claude Code on a subscription. The interface tells you that you hit a session or weekly limit, and you wait for the reset.
- API-side rate limiting: you are calling the Anthropic API with an API key and tripping requests per minute (RPM), daily token allowances (TPD), or concurrent connection limits. It surfaces as HTTP 429 / 529 with a
retry-afterheader.
The diagnostics are completely different:
- For 429 / 529, read
retry-afterand thex-ratelimit-*headers and back off using the exact wait time; - A session limit has no tunable parameter. You wait, you switch billing path, or you change settings as the docs describe.
If you are on the API path, the full breakdown of limit tiers, backoff, and concurrency control lives here: Claude API rate limits explained — reading 429 / 529 and backing off. This article is only about the subscription-side session window; do not mix the two playbooks.
5. Pointing Claude Code at a pay-as-you-go endpoint
The steps below use CodeGateway's compatible endpoint; the configuration shape is the same as pointing Claude Code at Anthropic's own API.
5.1 Step one: top up for credit
Pick an amount on the Claude API top-up page — custom amounts start at $5, with $10 / $20 / $50 / $100 presets. The credited amount lands in full. Payment methods: credit card (Visa / Mastercard / AmEx), Stripe Link, and bank transfer; the checkout is provided by Stripe, and payment fees are itemized separately.
5.2 Step two: create an API key
Create a key in the dashboard (keys are bound to a workspace and billed per token). No extra approval step is needed — under pay-as-you-go, the allowance comes from your account balance.
5.3 Step three: switch base_url and key
Claude Code reads two environment variables:
export ANTHROPIC_BASE_URL="https://api.codegateway.dev"
export ANTHROPIC_AUTH_TOKEN="your API key"Put them in your shell profile or project env file so they survive a new terminal:
# ~/.zshrc or ~/.bashrc
export ANTHROPIC_BASE_URL="https://api.codegateway.dev"
export ANTHROPIC_AUTH_TOKEN="your API key"To switch back to your official subscription, comment out those two lines and open a new terminal. Switching between the two modes costs one environment variable.
5.4 Step four: verify
Send a minimal request from Claude Code (ask it to read one file) and confirm:
- no subscription-side session / weekly limit message appears;
- your request log shows the call being metered against your balance;
- for live rates, check the pricing page.
If you are chasing 429 / 529 rather than a session limit, use the rate-limit article linked in the previous section.
6. What it costs
Every figure below is the live pricing page value as of 2026-11-07. Rates change; the pricing page is the source of truth.
- Consumption multiplier: official list price × 1.07x (a flat multiplier, no tiers). It covers global acceleration, high-availability infrastructure, and API key management.
- Top-up service fee: 2% of the face value of the top-up; it does not reduce the credited amount.
- Payment fees: charged separately by Stripe at roughly 3.9% + $0.30 per transaction, itemized at checkout.
- Total charged = top-up face value + 2% service fee + Stripe payment fee.
An arithmetic estimate using those rates (the token volumes below are assumptions for the calculation, not measured figures) — take claude-sonnet-5-5 at official $2.00 / MTok input and $10.00 / MTok output, which works out to $2.14 / MTok input and $10.70 / MTok output at CodeGateway (cache reads and writes are priced separately):
Assume one session window consumed 200K input tokens + 20K output tokens:
- Input: 0.2 × $2.14 ≈ $0.43
- Output: 0.02 × $10.70 ≈ $0.21
- Total ≈ $0.64 (excluding cache I/O, the 2% top-up fee, and Stripe's payment fee)
The same arithmetic applies to any real usage you have. Face-value reference points, converted at 1.07x:
- $10 top-up ≈ 4.67M input tokens, or ≈ 0.93M output tokens
- $50 top-up ≈ 23.4M input tokens, or ≈ 4.67M output tokens
A top-up is prepaid balance, not a subscription: no monthly fee, no expiry, and you are charged for what you use. Refund terms live in the billing guide and the refund policy; multiplier and tier details are in tier pricing explained.
7. FAQ
I hit the 5-hour limit — can I just switch models and keep going?
It depends which limit you hit. For a session / weekly limit (a seat allowance shared across models), switching models does nothing; the docs are explicit about that. For a model-specific Opus or Sonnet limit, moving to a model outside that family keeps you working. /usage helps you tell the two apart.
Does the 5-hour window reset daily?
No. It is a rolling window that resets every five hours, anchored to when you start consuming — not to a calendar slot.
My plan allowance ran out. Can I keep coding?
Yes. The official path is usage credits: with them enabled, requests switch to pay-as-you-go and keep working at standard API rates until you reach your monthly spend limit. The other path is a token-metered API endpoint, which is what section 5 covers.
Does pay-as-you-go mean unlimited?
No. It is still billed per token and stops when your balance runs out. What it removes is the "session window that resets every five hours" layer — the allowance simply comes from your balance instead. Pricing and refund rules are the same as for any prepaid balance; check the pricing page.
Is latency and reliability worse than going direct?
We would rather not answer that with adjectives. For latency, availability, and error rates, see real cost and reliability data and the status page. The multiplier itself is on the pricing page.
How do I switch Claude Code over without breaking my other tools?
Claude Code reads ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN. Set them per project or in your shell profile. For a one-off switch, export them in the current shell; for a permanent one, put them in your shell config. If you are starting from scratch, see Claude Code quickstart and using Claude Code without an Anthropic key.
8. Related reading
- Claude API rate limits explained — 429 / 529, backoff, concurrency — API-side limits, a different problem from the session window in this article
- Pricing: fixed multiplier and full rate table
- Claude API top-up: face value, credited amount, subscription comparison
- Tier pricing explained
- Billing guide
- Claude Code quickstart
9. Sources
- Anthropic help center: manage usage credits for paid Claude plans — the five-hour session limit, weekly limits, and how usage credits work
- Claude Code docs: Claude Code costs — session limits vs model-specific limits,
/usage,/usage-credits, automatic wait and resume - Claude Code docs: interactive mode — waiting for a limit to reset
- Anthropic pricing — official list prices
On the numbers: Anthropic's rules above follow the official documentation and help center as published on 2026-11-07. CodeGateway's 1.07x multiplier and 2% top-up service fee are the live pricing page values as of 2026-11-07; when they change, the pricing page wins.
