Skip to content

AI API spending limits, and what happens when you hit one

These 7 providers can all stop requests at a limit you set, but none has a setting for one of your app's users. So one heavy user can trip a limit that stops the app for everyone.

Every limit here stops your whole app at once. The template checks a daily budget for each user before every AI call, so one user can't spend everyone's share. Buy the template →

What happens at the limit, provider by provider

Every row was read on the provider's own docs on 26 Nov 2026, and words in quotes are theirs.

OpenAI

A monthly spend limit for the organization or for one project

Stops requests?
Only with "Enforce a hard limit" turned on. A spend alert alone "sends a notification; API traffic continues"
At the limit
429 errorproject_spend_limit_exceeded or organization_spend_limit_exceeded
Can spend run over it?
Not instant: "recorded spend can slightly exceed the configured amount"

Spend limits guide

Anthropic (Claude API)

A monthly spend limit for the organization or a workspace, below your tier's monthly cap (Start $500, Build $1,000, Scale $200,000)

Stops requests?
Yes. The tier cap is always on; your own limit is optional
At the limit
Your limit: 400 "You have reached your specified API usage limits". The tier cap: 429, paused until 00:00 UTC on the 1stinvalid_request_error / enforced_spend_limit_reached
Can spend run over it?
Not stated

Spend limitsWorkspaces

Google Gemini API (AI Studio)

A monthly spend cap per project (experimental), under the billing account's monthly tier cap (Tier 1 $250, Tier 2 $2,000, Tier 3 from $20,000 to $100,000)

Stops requests?
Yes. The tier cap is always on; the project cap is optional
At the limit
Tier cap: "service is paused for all projects linked to that billing account" until the 1st. Prepaid balance at $0: every key stops with a 402
Can spend run over it?
About 10 minutes of billing delay: "You may experience overages beyond your project cap"

Billing docs

Google Cloud (Vertex AI or Gemini API on a Cloud project)

A spend cap budget for one project and one service, such as the Gemini API or Vertex AI

Stops requests?
Only a spend cap budget. An ordinary budget is alerts only and "doesn't automatically cap" usage
At the limit
"All new usage for the specific service in the specified project is paused" until the next month or until you lift it. Requests already running finish
Can spend run over it?
Not instant: "any cost overages are billed as normal"

Spend capsBudgets

OpenRouter

A credit limit per API key (daily, weekly, monthly or lifetime), plus workspace budgets and guardrail budgets per member or key

Stops requests?
Yes, once you set one
At the limit
403 Forbidden with a "Key limit exceeded" message
Can spend run over it?
Not stated

Spend controlsKey limits

Vercel AI Gateway

Budgets for the team, a project, an API key or a team member, each with a refresh period

Stops requests?
Yes, once you set one. Without a budget, spend is unlimited
At the limit
HTTP 402, with a message naming the budget, its spend and its limitquota_for_entity_exceeded
Can spend run over it?
Not instant: "A budget is a soft cap, not a hard limit." The request that crosses it still completes, so spend "can end up slightly over the budget"

Budgets docs

Replit (if your app runs there)

A monthly usage limit on usage-based services, organization budgets in $500 steps, and limits per member on Enterprise

Stops requests?
Yes: "usage-based services are blocked until the next billing cycle"
At the limit
Blocked until the next billing cycle or until you raise the limit
Can spend run over it?
Not stated

Spend docs

Who a limit can single out

What each provider's limit can count, from the same docs.

Which scopes each provider's spending limit can apply to
ProviderOne of your app's usersWhole accountOne project or workspaceOne API keyOne teammate
OpenAINoYesYesNoNo
AnthropicNoYesYesNoClaude Code users only
Google Gemini APINoYesYesNoNo
Google CloudNoNoYesNoNo
OpenRouterOnly with a key per userNoYesYesYes
Vercel AI GatewayOnly with a key per userYesYesYesYes
ReplitNoYesNoNoEnterprise only

Every “per user” limit in these docs means someone on your own team: people using Claude Code at Anthropic, team members at Vercel and OpenRouter, and Enterprise members at Replit.

OpenRouter and Vercel AI Gateway can limit a single API key, and both can create keys through their API, so a key for each user is as close as a provider gets. It means creating, storing and rotating a key for every user. Without that, the first user who loops a long prompt can spend the budget, and the limit then stops the app for everyone until it resets or you raise it.

App builders don't add one either

We read the docs of 5 app builders on 12 Nov 2026, and Lovable's again on 24 Nov 2026: Lovable, Bolt, v0, Replit and Base44. Not one documents a spending limit for a user of the app you build. The closest are Lovable, which can pause AI for a whole project, and Base44, which can limit a member of your workspace.

Sources: Lovable: usage limits and alerts; Bolt: server functions; v0: Vercel AI Gateway budgets; Replit: managing your spend; Base44: credits.

What to set before you launch

Turn on a provider limit at an amount you could afford to lose in a bad month, with alerts below it. On OpenAI that means switching on Enforce a hard limit, since alerts alone let traffic continue. On Google Cloud it means a spend cap budget, since an ordinary budget only emails.

Then give each user an allowance in your own server code: before each AI call, add up what that user has spent today and refuse the call when it's over. Expect a little overshoot from calls already running, which is why the provider limit stays as the backstop.

Questions

Does the OpenAI API have a hard spending limit?

Yes, if you turn it on. In the API platform's settings, open Limits, then under Spend select Edit spend limit, enter the monthly limit and turn on Enforce a hard limit. Do it for the organization or for each project. Once spend reaches it, requests return a 429 error with project_spend_limit_exceeded or organization_spend_limit_exceeded. Enforcement isn't instant, so recorded spend can slightly exceed the limit (OpenAI's spend limits guide, checked 26 Nov 2026).

Can I set a spending cap on the Gemini API?

Yes. In AI Studio, open the Spend page and choose Monthly spend cap, then Edit spend cap. You need the project editor, owner or admin role. The project cap is experimental, and billing data can lag about 10 minutes, so spend can run over it. Separately, every billing account has a tier cap (Tier 1 is $250 a month), and at that cap Google pauses the Gemini API for all its projects until the 1st (Google AI Studio billing docs).

How do I limit what one Anthropic API key can spend?

Anthropic's limits apply to the organization or to a workspace, and a key can be scoped to one workspace. So put the key in its own workspace and set that workspace's monthly limit. Go to Spend limits in the Claude Console (platform.claude.com/settings/spend-limits). Set the organization's monthly limit, or pick a workspace under Workspace limits. Email notifications are set on the same page. At a workspace's limit, requests return 400 with "You have reached your specified workspace API usage limits" (checked 26 Nov 2026).

What happens when an OpenRouter key hits its credit limit?

Requests on that key fail with 403 Forbidden and a "Key limit exceeded" message until the limit resets or you raise it. In the key's dialog, set Key limit: a credit limit and how often it resets. Workspace budgets and guardrails are under the workspace settings. The Management API can create keys (POST /api/v1/keys) and set a key's limit. (OpenRouter's docs, checked 26 Nov 2026.)

Does Vercel AI Gateway stop requests at a budget?

Yes. At the limit it returns HTTP 402 with the type quota_for_entity_exceeded. It's a soft cap: the request that crosses the limit still completes, so spend can end up slightly over. Budgets are optional, so a team, project, key or member without one has unlimited spend. In AI Gateway's Budgets & Spend page, set a team or project budget, an API key budget, or a user budget. Email alerts at 50%, 75% and 100% are off by default. Keys with a budget can also be created through Vercel's API. (Vercel's docs, checked 26 Nov 2026.)

Can I limit AI spending for each user of my app?

No provider setting on this page does it directly. OpenRouter and Vercel AI Gateway can limit one API key, so a key per user works if you create and store one for each user. The simpler route is your own code: store what each AI call cost against the user who made it, and check that user's total before the next call.

More for AI app builders