Claude Code · Usage limits
Hit your Claude Code usage limit? How the limits work and what you can do
Claude Pro and Max plans cap Claude Code twice: a session allowance that resets every five hours, and a weekly allowance. When you hit one, you can wait, upgrade, turn on Anthropic's usage credits, or point Claude Code at a pay-per-token API. This page puts the four options side by side.
Facts checked
What the limits are (October 2026)
Only officially published facts are listed. Weekly amounts and message counts are not published; your account's Settings > Usage is the source of truth.
| Plan | Price / month | 5-hour window | Weekly limit | Notes |
|---|---|---|---|---|
| Claude Pro | $20 ($17/mo billed yearly) | Yes | Yes | Fable requires usage credits |
| Claude Max 5x | $100 | 5x Pro (per 5 hours) | Yes (amount not published) | Separate weekly Fable limit; includes $100/mo API credits that can't be used in Claude Code |
| Claude Max 20x | $200 | 20x Pro (per 5 hours) | Yes (amount not published) | Same as above; includes $200/mo API credits |
| ChatGPT Plus (Codex) | $20 | Yes | May apply | About 15–160 local messages per 5 hours on GPT-6.1 Sol (OpenAI estimate) |
| ChatGPT Pro (Codex) | $100 / $200 / $500 | None currently | Included allowance | You can buy credits when it runs out |
Providers can change limits at any time. Anthropic also reserves the right to limit usage in other ways (weekly/monthly caps, model or feature limits). Facts checked 2026-10-10.
Official sources:claude.com/pricingWhat is the Max plan? (Claude Help Center)Use Claude Code with your Pro or Max planCodex pricing (OpenAI)Using Codex with your ChatGPT plan (OpenAI Help)
Why Claude Code hits limits fast
- 1
Every turn resends the whole conversation
Files read, tool output and diffs are counted again with each message. The longer a session runs, the heavier each turn gets.
- 2
Opus uses more than Sonnet
Anthropic suggests Sonnet for routine coding and Opus for hard problems, or /model opusplan (Opus plans, Sonnet executes).
- 3
Subagents, agent teams and scheduled tasks each draw usage
Anthropic's docs note that agent teams use about 7x the tokens in plan mode.
- 4
Cache misses
Come back after the cache expires and your first message reprocesses the full context.
- 5
Growing context
Large pastes, many MCP servers and a long CLAUDE.md make every turn bigger.
Save allowance: /clear between tasks, /compact mid-task, and /usage to see what is eating your allowance.
Your four options
No option is always best. Pick by how much you use and how soon you need to keep working.
| Option | How | Cost | Best for |
|---|---|---|---|
| Wait | Check the reset time; Claude Code v2.1.234+ can wait and continue automatically | Time | Not in a rush |
| Upgrade | Pro → Max 5x → Max 20x | $100–$200/mo, still weekly-capped | People who max it out every week |
| Usage credits | Turn on in Settings > Usage, or run /usage-credits in Claude Code | Standard API rates, prepaid, monthly cap optional | Occasional overflow while staying on your plan |
| Pay-as-you-go API | Set an API key and base URL in Claude Code | Per token from your balance, separate from your Claude plan | Sprints, overflow, per-key team budgets |
Pay-as-you-go is billed per token, and rate and concurrency limits still apply as described in our docs. You can also set daily, monthly or total spend caps on each API key. docs.aicodewith.ai
The math: what a Claude Code workday costs
Below are three workday intensities priced at Opus 5.5 official API rates. Most Claude Code tokens are cache reads, so the cache-read price matters a lot.
Assumptions
- Opus 5.5 official prices per 1M tokens: input $4, output $20, cache read $0.20, 5-minute cache write $5.
- 22 workdays per month; token mix per day as in the table, in millions of tokens.
- Anthropic's reference: enterprise deployments average about $13 per developer per active day, and 90% of users stay under $30 per active day. The typical and heavy scenarios sit in that range.
| Scenario (per active day) | Cache read | Cache write | Uncached input | Output | Official API / day | 22 days / month |
|---|---|---|---|---|---|---|
| Typical | 15M | 0.6M | 0.15M | 0.15M | $9.60 | $211 |
| Heavy | 40M | 1.2M | 0.3M | 0.4M | $23.20 | $510 |
| Extreme (multi-agent / long sessions) | 120M | 3M | 0.8M | 1.2M | $66.20 | $1,456 |
The same usage on aicodewith
At current public prices, Claude models on aicodewith start from 19% of the official price (price depends on the channel; the pricing page is authoritative).
| Scenario | Official API / day | aicodewith from / day | aicodewith from / month |
|---|---|---|---|
| Typical | $9.60 | from $1.82 | from $40.13 |
| Heavy | $23.20 | from $4.41 | from $96.98 |
| Extreme (multi-agent / long sessions) | $66.20 | from $12.58 | from $277 |
Claude model prices (per 1M tokens)
| Model | Official input / output | aicodewith from, input / output |
|---|---|---|
| Claude Opus 5.5 | $4 / $20 | from $0.76 / $3.8 |
| Claude Sonnet 5.5 | $2 / $10 | from $0.38 / $1.9 |
| Claude Haiku 5.5 | $0.1 / $0.5 | from $0.019 / $0.095 |
See Claude model prices|/pricing
Compared with a subscription
Max 5x is $100/month and Max 20x is $200/month, but both have 5-hour and weekly caps. Beyond that, usage credits bill at official API rates.
Bottom line
If you reliably use your whole Max allowance every week and rarely hit the cap, Max is usually cheaper.
Pay-as-you-go wins for:
- Overflow after you hit a cap
- Uneven usage, such as a few days of sprinting
- Not wanting a 5-hour window to break your flow
- Teams that need per-key accounting and budgets
Your real token mix can differ a lot. Run /usage or /cost in Claude Code and plug in your own numbers.
Switch Claude Code to aicodewith in 1 minute
Claude Code reads the API endpoint and key from environment variables. The config below is the same one the dashboard gives you.
1. Create an API key
Create an API key in the aicodewith dashboard. You can set a daily or monthly spend cap on it.
2. Edit ~/.claude/settings.json
Add the env block below (on Windows: %USERPROFILE%\.claude\settings.json). ANTHROPIC_BASE_URL is the bare domain, with no /v1.
~/.claude/settings.json{ "env": { "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY", "ANTHROPIC_API_KEY": "", "ANTHROPIC_BASE_URL": "https://api.aicodewith.ai" } }3. Restart and verify
Restart Claude Code and send a message. Pick Opus 5.5 or Sonnet 5.5 with /model, then confirm the request in your aicodewith usage records.
If an API key is set, Claude Code uses API billing instead of your subscription allowance.
Limit messages, decoded
Claude Code messages are quoted from Anthropic's errors documentation.
| What you see | What it means | What to do |
|---|---|---|
| You've hit your session limit · resets 3:45pm | Your 5-hour session allowance is used up (all models) | Wait / usage credits / switch to pay-as-you-go |
| You've hit your weekly limit · resets Mon 12:00am | Your weekly allowance is used up | Same as above; switching models won't help |
| You've hit your Opus limit / Sonnet limit | One model family's allowance is used up | Switch to the other family with /model |
| You've used 85% of your session limit | Early warning | Run /compact and move from Opus to Sonnet |
| Usage credits required for 1M context | 1M context needs usage credits | Switch back to standard context with /model |
| Codex: usage limit reached | Your Codex 5-hour or weekly allowance is used up | Wait / buy credits / use an API key |
| 429 / rate limited (on aicodewith) | Requests exceeded our rate limit | Lower concurrency and retry; see the 429 guide |
FAQ
Does Claude Max have a usage cap?
Yes. Every tier has a session allowance that resets every five hours and a weekly allowance, and Anthropic may apply other caps.
How much can Max 20x use per week?
Anthropic only publishes that it is 20x Pro per 5-hour session. Weekly amounts are not published; check Settings > Usage.
Are Claude Code and claude.ai limits separate?
No. claude.ai, the desktop app and Claude Code share one pool.
When does the weekly limit reset?
Each account has a fixed weekly reset time shown in Settings > Usage. It is not tied to when you subscribed.
Can Max's monthly API credits be used in Claude Code?
No. Anthropic says they apply to the Claude Platform only, not Claude Code or usage credits.
Does pay-as-you-go have a 5-hour limit?
Pay-as-you-go bills your balance per token and does not use your Claude plan's 5-hour or weekly allowance. Rate and concurrency limits still apply as described in our docs, and you can set a spend cap per API key.
Is aicodewith affiliated with Anthropic?
No. aicodewith is an independent third-party API service. Claude is a trademark of Anthropic.
Is pay-as-you-go always cheaper than Max?
No. If you reliably use your whole Max allowance, the subscription is usually cheaper. Pay-as-you-go fits overflow, sprints and teams that need per-key accounting.
Switch Claude Code to aicodewith in 1 minute
Pay-as-you-go is billed per token, and rate and concurrency limits still apply as described in our docs. You can also set daily, monthly or total spend caps on each API key.
Related
Official sources
- claude.com/pricing
- What is the Max plan? (Claude Help Center)
- Use Claude Code with your Pro or Max plan
- How do usage and length limits work?
- Manage usage credits for paid Claude plans
- Claude Code docs: errors
- Claude Code docs: costs
- Codex pricing (OpenAI)
- Using Codex with your ChatGPT plan (OpenAI Help)
Claude and Claude Code are trademarks of Anthropic PBC; ChatGPT and Codex are trademarks of OpenAI. This page is not affiliated with or endorsed by either company. Limit facts come from official public docs, checked 2026-10-10, and may change.