Claude Code usage limit reached: how to keep working
Why Claude Code stops with "Usage limit reached" on a Pro or Max plan, the official ways to continue, and how to run it on a prepaid API key with no 5-hour window.
You are in the middle of a refactor, and Claude Code stops with "Usage limit reached". This post explains where that limit comes from, what Anthropic offers to keep going, and how to run Claude Code on a prepaid API key that is billed per token instead of per 5-hour window.
Where the limit comes from
When you log in to Claude Code with a Claude plan, your work counts against the plan's usage. Anthropic's help center says it directly: "Pro and Max plans have a five-hour session limit and a weekly limit." The same page adds that "these limits are shared across Claude and Claude Code", so a long chat in the Claude app uses the same allowance as your coding session (source).
You can see how much is used in your account settings, under "Current session: How much of your plan's five-hour session limit you've used" (source). When the limit is reached, Claude Code tells you, and "the message shows when the window resets" (source).
The official options
Anthropic's documentation lists these ways to continue:
| Option | What it means |
|---|---|
| Wait for the reset | The session limit refills when the 5-hour window ends. The weekly limit refills on its own schedule |
| Usage credits | "Usage credits let you keep working past your plan's usage limit" (source) |
| Console account with API credits | "Switch to a Claude Console account and purchase API usage credits". Then "usage will be billed at standard API rates" (source) |
| A gateway endpoint | Claude Code reads ANTHROPIC_BASE_URL to "override the API endpoint to route requests through a proxy or gateway" (source) |
The last option is the one this post covers. An API key is billed per token, so there is no 5-hour window to run out of. You pay for the tokens each request uses, from a balance you top up yourself.
Run Claude Code on a Cent AI key
Cent AI serves the Anthropic Messages format at https://api.cent-ai.dev, so Claude Code works without changes. You need a Cent AI account with balance or a budget pack, and an API key from the Keys page.
Set four environment variables in your terminal (macOS, Linux, WSL):
export ANTHROPIC_BASE_URL="https://api.cent-ai.dev"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
export ANTHROPIC_MODEL="claude-opus-5"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-5.5"
In PowerShell:
$env:ANTHROPIC_BASE_URL = "https://api.cent-ai.dev"
$env:ANTHROPIC_AUTH_TOKEN = "YOUR_API_KEY"
$env:ANTHROPIC_MODEL = "claude-opus-5"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "claude-haiku-5.5"
What each one does:
ANTHROPIC_BASE_URLsends Claude Code's requests to Cent AI. Write it without/v1; Claude Code adds/v1/messagesitself.ANTHROPIC_AUTH_TOKENis your Cent AI key. Claude Code sends it in theAuthorizationheader, prefixed withBearer(source).ANTHROPIC_MODELis the model for the session. Use a name exactly as it appears in the model list.ANTHROPIC_DEFAULT_HAIKU_MODELis used for background tasks such as naming a session. Set it to a Cent AI model too; otherwise those background requests fail with 404model_not_found.
Start claude from the same terminal and type /status. The base URL line should show https://api.cent-ai.dev. To go back to your plan later, remove these variables and start Claude Code again.
Keep an eye on one thing: Anthropic's documentation says that when ANTHROPIC_API_KEY is set, "this key is used instead of your Claude Pro, Max, Ultra, Team, or Enterprise subscription even if you are logged in" (source). If an old ANTHROPIC_API_KEY is still set in your shell, remove it so you know which key is in use.
The full setup, including the VS Code extension and ~/.claude/settings.json, is in the Claude Code guide.
What changes, and what still has limits
On an API key there is no 5-hour session window and no weekly allowance. That does not mean there are no limits at all:
- Balance. Each request is paid from your balance or your budget pack. When it runs out, requests stop with 402
insufficient_balanceuntil you top up. - Rate limit. Every key accepts up to 600 requests per minute. Claude Code with many subagents can reach it; spread the work over several keys if it does.
- Your own spending limits. You can set a daily or monthly limit on each key, so a long session cannot spend more than you planned (how).
Top-up is in rupiah with QRIS, or with USDT or USDC on Solana (network fees charged by your wallet are yours). Every payment is manual: there is no card on file and no auto-renewal.
What a session costs
Every model has four rates per million tokens: input, cache read, cache write and output. These are the current Cent AI rates for the Claude models most often used in Claude Code:
| Model | Input | Cache read | Cache write | Output |
|---|---|---|---|---|
| claude-opus-5 | $1.15 | $0.115 | $1.15 | $5.75 |
| claude-opus-4-6 | $0.50 | $0.05 | $0.50 | $2.50 |
| claude-sonnet-4-6 | $0.45 | $0.045 | $0.45 | $2.25 |
Prices are per 1M tokens, taken from the pricing page on 2026-11-14. Rates can change; the pricing page always shows the current ones.
Claude Code sends the conversation again on every turn, so most tokens of a long session are usually read from cache. Take one turn that reads 40,000 tokens from cache, sends 2,000 new input tokens and gets 1,000 output tokens back, at the rates of the second row:
- cache read: 40,000 × $0.05 / 1,000,000 = $0.002
- input: 2,000 × $0.50 / 1,000,000 = $0.001
- output: 1,000 × $2.50 / 1,000,000 = $0.0025
That turn costs $0.0055. Your real turns will differ; every request in the Requests page of the dashboard shows its tokens per rate and the amount charged.
A request that fails before the model receives it costs $0. Tokens the model already produced are charged.
Quick checklist
- Top up with QRIS or crypto, or buy a budget pack.
- Create a key in Keys, and set a daily limit if you want a cap.
- Set the four environment variables and remove any old
ANTHROPIC_API_KEY. - Run
claude, type/status, and check the base URL.
Sources
- support.claude.com/en/articles/11145838-using-claude-code-with-your-pro-or-max-plan (opens in a new tab) · accessed 2026-11-14
- support.claude.com/en/articles/9797557-usage-limit-best-practices (opens in a new tab) · accessed 2026-11-14
- code.claude.com/docs/en/costs (opens in a new tab) · accessed 2026-11-14
- code.claude.com/docs/en/env-vars (opens in a new tab) · accessed 2026-11-14
- cent-ai.dev/docs/integrations/claude-code (opens in a new tab) · accessed 2026-11-14
- cent-ai.dev/docs/guides/securing-keys (opens in a new tab) · accessed 2026-11-14
Related posts
- Card declined when paying for an AI API? What to checkpayment · 3 minCommon things to check when a debit or credit card is declined while buying AI API credits, and a prepaid alternative with QRIS or USDT/USDC.
- OpenCode and Cline with a prepaid APIopencode · 3 minPoint OpenCode and the Cline CLI at an API funded with QRIS or crypto, the steps we ran on OpenCode 2.3.0 and Cline 3.0.74, and the measured cost of one turn.
- Claude Pro or a prepaid API: a break-even exampleclaude-code · 3 minClaude Pro's price from Anthropic's official pages, the cost of one Claude Code turn on a prepaid API, and a break-even example with every assumption stated.