Guide
Claude Code and LLM API spending limits: which ones actually stop requests
The short answer: there are three kinds of limit and only two of them stop anything. A budget alert emails you. A hard limit at the provider refuses the request. A client-side cap in your agent stops the run, but only by its own estimate. 48 of the 656 public billing cases in our library mention a spend cap or limit, and 12 mention both a cap and a loop. Put the hard limit at the provider, then add the agent cap on top.
For developers paying per token on the OpenAI API, the Claude API, or Claude Code with an API key or extra usage. Figures and error codes were read in the providers' documentation on 2026-11-26 and can change.
The three kinds of limit
| Limit | Where you set it | What happens at the line | Catch |
|---|---|---|---|
| OpenAI hard spend limit | Organization limits, Spend, Edit spend limit, Enforce a hard limit. Monthly, per organization or per project. | 429 with organization_spend_limit_exceeded or project_spend_limit_exceeded | Not instantaneous. Recorded spend can slightly exceed the limit. |
| OpenAI spend alert | Same page, alert thresholds | An email | Does not stop requests. |
| Claude API spend limit you set | Console, Settings, Spend limits, per organization or per workspace. Cannot go above your tier's cap. | 400 invalid_request_error, You have reached your specified API usage limits, with the time access resumes | The Claude Code workspace is checked separately and can return 429 with retry-after. |
| Claude API tier cap | Set by tier: Start $500, Build $1,000, Scale $200,000 a month | 429 rate_limit_error, error_code enforced_spend_limit_reached, no retry-after | Retries, including SDK retries, keep failing until the first of next month. |
| Claude Code --max-budget-usd | On the command line, print mode only: claude -p --max-budget-usd 5.00 | The run stops. Spawning another subagent fails with Budget limit reached. | A client-side estimate that can differ from your bill. Spend can pass the cap. |
| Claude Code --max-turns | Print mode only: claude -p --max-turns 3 | The run ends after that many agentic turns | No limit by default. Counts turns, not dollars. |
Set it up in 5 minutes
- 1
Give the agent its own key and project or workspace. A limit on a shared key stops everything, and a limit on the wrong project stops nothing.
- 2
Set a hard monthly limit on that project or workspace. Pick a number you would not mind losing in one bad night.
- 3
Add the agent cap. For headless Claude Code, pass both --max-budget-usd and --max-turns. Leave headroom, because the budget is an estimate.
- 4
Turn off auto-reload or keep its ceiling low. A loop with auto-reload on can keep buying credit. 42 of the 656 cases mention auto-recharge.
- 5
Screenshot the settings with the date. If a limit is passed later, the setting as it stood is your evidence.
Where caps were passed in public cases
- $5 extra-usage limit, $12.52 charged. 250% of the configured cap, no warning and no stop. The user asked for $7.52 back and the support bot declined (#59858).
- No per-session ceiling, auto-reload on. A Stop hook kept the agent running for six days, about $9,364 (#107256). The user says the hooks were his own configuration.
- A weekly allowance with no cost estimate up front. Recurring jobs ran about 580 times a day and used 361.6M tokens in 3.83 days, then $45.61 of overage (#110395).
The check-up reads your files inside your browser tab and sends nothing anywhere. It does not log in to your account and does not promise a refund.
FAQ · Claude Code and LLM API spending limits: which ones actually stop requests
Does Claude Code have a spending limit?
Yes, in print mode. --max-budget-usd stops a claude -p run once estimated spend reaches the amount, and --max-turns caps the number of agentic turns. The CLI reference says the budget is checked against a client-side estimate that can differ from your bill and that spend can pass it, so leave headroom. Interactive sessions do not take either flag. For a limit Claude Code cannot exceed, set one at the API organization or workspace.
What happens when I hit a Claude API spend limit?
If it is a limit you set, requests return HTTP 400 with invalid_request_error and a message that starts You have reached your specified API usage limits, stating when access resumes. If it is your tier's monthly cap, requests return 429 with error_code enforced_spend_limit_reached and no retry-after header until the first of next month. Limits on the Claude Code workspace are checked separately and can return 429 with retry-after.
Is an OpenAI budget alert a hard cap?
No. OpenAI's docs say spend alerts send notifications and do not enforce a cap. You need a spend limit with Enforce a hard limit turned on. Requests then return 429 with organization_spend_limit_exceeded or project_spend_limit_exceeded. OpenAI also says enforcement is not instantaneous, so recorded spend can slightly exceed the limit.
My limit was passed anyway. Can I dispute it?
You can try, and a limit you set is one of the stronger points you can bring. In one public report a $5 extra-usage limit was set and $12.52 was charged. The user asked for the $7.52 difference and the support bot declined. Keep the limit setting, the date you set it, and a day-by-day comparison of your logs against the bill.
Sources
- OpenAI API docs: Spend limits
- Claude Platform docs: Rate limits and spend limits
- Claude Code docs: CLI reference (--max-budget-usd, --max-turns)
- GitHub #59858: $5 limit, $12.52 charged
- GitHub #107256: no per-session ceiling, about $9,364 in six days
- GitHub #110395: recurring jobs, $45.61 overage
Case counts on this page come from our research library of 656 verified public AI billing dispute cases (170 curated cases plus 486 collected on 2026-11-24). Counts are keyword counts over the case texts; one case can match more than one pattern.
Fireborn finds and stops surprise charges for free. If money is owed, it gives you a free appeal template to send yourself. Setting up a hard spend cap for you is a paid job on Upwork. It does not promise refunds or log in on your behalf. Figures on this page follow the sources cited. Last verified: 2026-11-26. By Fireborn (6hn68).