API spend limits work differently on every platform. OpenAI and Anthropic can stop requests at a limit you set, and Mistral suspends a workspace when it hits its budget. Google’s AI Studio cap is experimental and runs about 10 minutes behind, and a Google Cloud budget only sends alerts. None of them stops spending instantly. Give each app its own key, project and cap, and lock the key down so it can’t leak.
On 10 June 2026, a family tire shop in Brazil that normally paid about $44 a month for Google Cloud ran up roughly $14,000 in Gemini charges in about two hours. The owner laid out the details on Google’s AI developer forum. The key used in the attack was a Google Maps key he created in 2021 for the shop’s public website, with no restrictions on it. In December 2025 he switched on the Gemini API in the same project for an internal tool. He says nothing warned him that the old Maps key now worked for Gemini too. His forensic notes count 515,226 calls in the first hour. His budget alerts went off, but an alert doesn’t stop anything.
This guide covers what API spend limits at OpenAI, Anthropic, Google and Mistral actually stop as of 9 October 2026, how to set them up, and the key habits that matter more than any cap.
What each platform’s limit actually does
“Spend limit” means a different thing on each platform. Some stop requests, some send an email, and some are ceilings the provider sets that you can’t raise without asking. All of the details below come from each provider’s own documentation.
| Platform | What you can set | Does it stop requests? | Documented delay | Applies to |
|---|---|---|---|---|
| OpenAI API | Monthly spend limit, plus spend alerts | Only if you tick “Enforce a hard limit”. Alerts on their own don’t stop anything | “Not instantaneous”; a small overage is possible | Organization or project |
| Anthropic (Claude Console) | Organization spend limit below your tier cap; workspace spend limits with alerts | Yes | Not stated | Organization or workspace, but never the Default Workspace |
| Google AI Studio (Gemini API) | Project monthly spend cap, labelled experimental | Not guaranteed. Google says batch jobs and agent sessions can run past it | About 10 minutes | One project |
| Google Cloud Billing budget | Budget with alert thresholds | No. Alerts only | Billing data lags | Billing account or project |
| Mistral | Organization and workspace monthly spending limits | Yes, access is suspended | Not stated | Organization or workspace |
Two providers also impose a ceiling of their own. Anthropic’s rate-limits page lists monthly spend caps of $500 on the Start tier, $1,000 on Build and $200,000 on Scale. The Gemini API billing docs list $250 for Tier 1, $2,000 for Tier 2 and $20,000 to $100,000 for Tier 3, counted across the whole billing account. Google added those caps, along with project caps, on 16 March 2026. OpenAI assigns an “approved monthly usage limit” by tier as well, but the pages we read don’t give the amounts.
Don’t mistake a provider ceiling for a budget. An Anthropic account on the Start tier can still lose $500 in a month before Anthropic’s own cap steps in. That’s fine if you planned for it and a shock if you didn’t.
The lag counts toward your bill
Every cap here takes some time to react, and Google is the only provider that puts a number on it. Its billing docs say a project cap leaves you “subject to overages” for about 10 minutes.
The tire-shop numbers show what that can cost. About 515,226 of roughly 594,000 calls came in the first hour. If the cost followed the call count, that hour cost about $12,100, or about $200 a minute. At that pace, a 10-minute delay lets through about $2,000 before any cap catches up. That’s our arithmetic from one case, built on the owner’s own figures. Even so, a $50 cap with a $2,000 overrun is still a far better outcome than $14,000.
OpenAI’s spend limits guide says enforcement is “not instantaneous” and that recorded spend can slightly exceed the limit. Anthropic’s page doesn’t mention a delay. Prepaid credit isn’t an instant stop either. OpenAI’s prepaid billing help says usage can continue briefly after the balance hits zero, leaving a negative balance that comes out of your next purchase. Auto-reload is switched on by default during setup, and its monthly reload limit is optional, so set one or turn auto-reload off.
How to set API spend limits on each platform
OpenAI
- Create a separate project for each app, and create that app’s key inside the project so its traffic bills there.
- In the project’s settings, open Limits, then Spend, then Edit spend limit. Enter a monthly amount, tick “Enforce a hard limit”, and save.
- Do the same at organization level on the organization limits page. Both limits can apply to the same request.
- Add spend alerts below each limit, so you hear about trouble before the hard stop.
- When you create the key, choose Restricted permissions and allow only the endpoints the app uses. New keys default to full permissions.
Anthropic (Claude API)
Start with the organization limit: Settings, then Billing, then Spend limits. It can’t go above your tier cap. Then create a workspace for each app under Settings, then Workspaces, open it, and set its spend limit and alert thresholds in the Spend limits panel. Create the app’s key inside that workspace so it can only reach that workspace.
The trap is the Default Workspace. Anthropic’s workspace docs say you can’t set limits on it, so a production key there is only bounded by your organization limit. Keep it empty. You get up to 100 workspaces per organization by default, which is plenty for a small business. Claude Code gets its own automatically created workspace, and it’s the only one that supports a monthly limit per person.
Google (Gemini API)
In Google AI Studio, open the Spend page, then Monthly spend cap, then Edit spend cap. You need the editor, owner or admin role on the project. Know the limits before you rely on it. The feature is labelled experimental, batch jobs and agent sessions can run past it, and it isn’t available on invoiced billing accounts.
A Google Cloud budget is not a cap. Google’s own budget documentation says an alerts-only budget doesn’t automatically cap usage or spending. You can wire a budget to Pub/Sub so a script disables billing when it fires. That works, but it’s a small engineering project, not a setting you switch on.
The bigger fix is keeping Gemini away from old keys. Run Gemini in its own Cloud project, separate from Maps or anything else that puts a key in a browser. In AI Studio’s API Keys page, any key marked “Unrestricted” has an “Add restrictions” option; choose “Restrict to Gemini API only”. Google’s key documentation says dormant unrestricted keys were blocked from 7 May 2026, and new AI Studio keys have defaulted to “auth keys” limited to the Gemini API since 28 May 2026. Older keys are what you need to check.
Mistral
Mistral’s usage-limits docs put the organization limit under Admin Panel, Subscriptions, Billing, and each workspace’s limit on that workspace’s Settings tab under Administration, Workspaces. Keys are scoped to a workspace, and a workspace limit can’t exceed the organization’s. When a workspace hits its budget, requests return 429 until the next month or until an admin raises the limit. The docs don’t mention warning alerts, so check usage yourself.
A cap can’t fix a leaked key
The AI evaluation group METR published its own account of a stolen key on 31 August 2026. In March, a researcher ran agents on a public cloud server protected by a Google login. A flaw in the app silently switched that login off. METR thinks the attacker found the server by scanning newly registered websites. The attacker then simply asked the agent for its model provider API key, and used it for about three weeks.
METR says the credits consumed would have been worth about $600,000; the model developer had given them for free. It also writes that at the time there was “no way to put a spending limit on keys like this one”. Heavy token use and frequent rate-limit errors were normal for its work, and its internal dashboard didn’t show rate-limited requests for all users, so the theft looked like everyday noise.
The lesson for small teams: if your agent can read its own API key, anyone who can talk to the agent can try to get it. We covered why an agent’s permission settings matter more than its price in our OpenClaw review. These habits close most of the gaps:
- One key per app, used for one service. Google calls keys shared with other Google APIs “not recommended”. The tire-shop key did double duty.
- Keys live on a server. Google’s docs put it bluntly: “Never expose keys client-side in production.” Anything in web or app code can be pulled out.
- Keep the key out of the agent’s reach. Store it in the backend process that makes the API call, not in files, tools or prompts the agent can read back.
- Use the narrowest permission. On OpenAI, a Restricted key. On Google, a key restricted to the Gemini API.
- Rotate in the right order. Google’s docs say to create and deploy the new key first, confirm it works, then disable the old one.
- Treat a spike in rate-limit errors as a signal. METR’s own write-up says that signal was hidden from its dashboard.
If staff create keys on personal accounts, none of this is visible to you. Our pieces on shadow AI and a short AI usage policy cover that side. One line in the policy saying who may create API keys, and where, is enough.
Teach your app what a tripped limit looks like
Most code treats a 429 error as “slow down and retry”. A spend limit isn’t something retrying fixes, and providers report it in different ways:
| What tripped | What your app receives | Will retrying help? |
|---|---|---|
| OpenAI project or organization hard limit | HTTP 429, code project_spend_limit_exceeded or organization_spend_limit_exceeded | No. Raise the limit or wait for the monthly reset |
| OpenAI prepaid credits used up | Code credit_balance_exhausted | No. Add credits |
| Anthropic tier spend cap | HTTP 429 rate_limit_error, with error_code enforced_spend_limit_reached and no retry-after header | No. Blocked until 00:00 UTC on the 1st, or until the tier is raised |
| Anthropic limit you set yourself | HTTP 400 invalid_request_error, message starts “You have reached your specified…” | No. Raise or remove the limit |
| Google tier cap | Service paused for every linked project; the billing docs name no error code | No. Resumes on the 1st, or after a higher limit is granted |
| Mistral workspace budget | HTTP 429 Too Many Requests | No. Resumes next month or after an admin raises it |
Anthropic’s docs warn that its SDK’s automatic retries will keep failing until access resumes. Check the error code, stop retrying, show customers a plain message, and send the work to a fallback. A tripped cap is an outage you caused yourself, and the plan in our guide to handling an AI tool outage applies to it as much as to a provider failure.
Theft isn’t the only way to hit a limit. Reasoning models bill their thinking as output, as our reasoning-token pricing guide explains. A talkative model can double a bill with nobody attacking you. Artificial Analysis measured Mistral Large 4 using about two and a half times the median number of output tokens on its test suite. The alerts you set for theft will catch that too.
How low should the cap be?
No provider tells you what number to pick. This is our rule of thumb, not official guidance:
- Per-app cap: about twice that app’s normal month. Low enough to hurt an attacker, high enough that a busy week doesn’t take you offline.
- Alerts: at 50% and 80% of each cap, so a real problem reaches you while you can still act.
- Organization cap: the most you could absorb as a total loss this month. Then add the lag on top, because at the tire-shop pace 10 minutes was worth about $2,000.
- Monthly check: look at usage once a month, and remove any key nobody can name an owner for.
If most of your usage is one person chatting rather than an app calling the API, you may not need an API key at all. Our ChatGPT API vs Plus vs Business comparison explains when a flat subscription is the simpler way to keep a lid on costs.
This is general guidance, not security or legal advice. If you suspect a leaked key, revoke it first and contact your provider.
What we couldn’t confirm
- How long OpenAI and Anthropic take to enforce a limit. OpenAI says only “not instantaneous”; Anthropic’s page doesn’t say.
- The dollar amounts behind OpenAI’s tier-based monthly usage limits. They weren’t on the pages we read.
- Whether Mistral sends warnings before a limit is reached, and how quickly it enforces one.
- The tire-shop figures. They come from the owner’s own forum posts. Google hasn’t published its account. The thread doesn’t say which usage tier or billing type his account was on, so we can’t say why a tier cap didn’t stop the charges. As of 16 June 2026 he reported no cash refund.
- When Google started rejecting unrestricted standard keys. Its docs say they are rejected but give no date; an email quoted in the forum thread set a 19 June 2026 deadline.
- Which provider’s key METR lost, and whether that provider has since added per-key limits. METR doesn’t name it.
FAQ
Do API spend limits stop charges instantly?
No. OpenAI says enforcement isn’t instantaneous, Google documents about a 10-minute delay on AI Studio project caps, and Anthropic and Mistral don’t publish a figure. Set caps low enough that a short overrun is still affordable.
Is a Google Cloud budget a spending cap?
No. Google’s budget documentation says an alerts-only budget doesn’t automatically cap usage or spending. For the Gemini API, use AI Studio’s project spend cap and restrict your keys. Treat the budget as an alarm.
Can I set a spending limit on a single API key?
Not directly on any of the four platforms covered here. Do it through containment instead: one app, one key, inside its own OpenAI project, Anthropic workspace, Google Cloud project or Mistral workspace, each with its own limit. Anthropic’s Claude Code workspace is the exception, with limits per person.
What’s the difference between a spend limit and a rate limit?
A rate limit controls how fast you can send requests, per minute. A spend limit controls how much you can spend in a month. Anthropic returns the same error type for its tier spend cap and for rate limits, so check the error code before your app decides to retry.
What should I do if my AI API key leaks?
Create and deploy a new key, confirm it works, then disable the old one. Check usage and billing logs for unfamiliar activity, lower your caps, and contact the provider’s support. OpenAI’s prepaid billing help says used credits may qualify for a refund in cases of confirmed unauthorized use, so report it quickly. In the Google forum cases, outcomes ranged from partial adjustments to waits of over a month.
Do ChatGPT Plus or Claude Pro subscriptions carry the same risk?
This guide is about API keys, which bill per token. Flat chat subscriptions are billed differently, so a stolen login doesn’t run up a token bill in the same way. Check your plan for any pay-as-you-go add-ons and keep them capped.
Shurah is the founder of AI Tools Daily, tracking pricing, licensing and policy changes across AI tools so readers can make decisions without wading through marketing claims themselves.
One way to keep the bill down is picking a cheaper model in the first place β our Claude Haiku 5.5 review tests whether the $0.10-per-million-token rate holds up on real math workloads.