Independent, documentation-based guides to AI tools and smart home tech. How we research

Home › AI Coding & APIs › How to Set API Spending Limits for OpenAI and Claude

How to Set API Spending Limits for OpenAI and Claude

📚 Part of our AI API pricing guide · all coding guides

Checked November 12, 2026 against the OpenAI API spend limits guide and the Claude Platform rate limits docs. This is a documentation-based guide, not a hands-on test.

Quick verdict

OpenAI: set a monthly spend limit for the organization and each project, and switch on Enforce a hard limit. Alerts alone don't stop traffic.

Anthropic: your usage tier already has a monthly cap. Set your own lower limit in the Claude Console, and add workspace limits for each app.

Both: caps reset monthly, and your code should handle the specific error each one returns.

Flat illustration of a pastel gauge dial with a cap marker beside a code window and a small stack of coins with a padlock

Illustration: AI Tool Audit, created with Google Gemini

On this page
  1. Why set a spending limit?
  2. OpenAI: step by step
  3. Anthropic (Claude API): step by step
  4. What happens when you hit the limit
  5. Limits are not the same as rate limits
  6. A sensible setup
  7. FAQ

Why set a spending limit?

API bills follow usage, not a flat fee. A loop that retries forever, a leaked key or a busy agent can run up charges fast. A spend limit stops requests once a dollar amount is reached. It is the simplest guardrail you can add, and it takes a few minutes.

OpenAI: step by step

OpenAI separates limits you set from limits OpenAI sets. You configure monthly spend limits. OpenAI also assigns an approved usage limit based on your usage tier.

Set an organization limit

  1. Open Organization limits in the API platform settings.
  2. Under Spend, select Edit spend limit.
  3. Enter your Monthly spend limit.
  4. Turn on Enforce a hard limit if you want requests to stop at that amount.
  5. Select Save.

Set a project limit

  1. Open Project settings for the project.
  2. Select Limits.
  3. Under Spend, follow the same steps as above.

An organization limit covers traffic from all projects. A project limit covers only traffic billed to that project. Both can apply to the same request. You need permission to manage the organization or project to change them.

Alerts vs hard limits

Spend alerts send a notification. They do not cap spend. Set them early, such as at half your budget, so you have time to react. A hard limit is what actually blocks requests. OpenAI notes that enforcement "is not instantaneous," so recorded spend can run slightly past your limit.

Anthropic (Claude API): step by step

Every Claude API organization sits on a usage tier, and each tier has a monthly spend cap. New organizations may start in an Evaluation tier with lower limits, which rise as usage history builds.

Usage tierMonthly spend cap
Start$500
Build$1,000
Scale$200,000
CustomNo cap; arranged with an account team

Set your own organization limit

  1. Go to Settings > Spend limits in the Claude Console (platform.claude.com/settings/spend-limits).
  2. Next to Monthly spend limit, click Adjust limit or Set limit.
  3. Enter a value. It can't be higher than your tier's cap.

Set workspace limits

Workspaces let you split one organization by app, team or environment. You can give each workspace its own spend and rate limits, so a test project can't eat the production budget. Two rules apply. You can't set a spend limit on the default workspace. And organization limits always apply, even if workspace limits add up to more. Unset workspace limits match the organization limit.

Need more than your tier allows? Use Request tier increase on the Rate limits page in the Console.

What happens when you hit the limit

SituationResponseHow access returns
OpenAI org hard limit429, organization_spend_limit_exceededRaise or remove the limit, or wait for the next monthly cycle
OpenAI project hard limit429, project_spend_limit_exceededSame as above
OpenAI approved usage limit429, organization_usage_limit_exceededRequest a higher limit from OpenAI
OpenAI prepaid credits used upcredit_balance_exhaustedAdd credits on the billing page
Claude limit you set400, invalid_request_errorRaise or remove your limit
Claude tier cap429, enforced_spend_limit_reached00:00 UTC on the 1st of next month, or a higher tier

One trap on the Claude side: the tier-cap 429 has the same error type as a normal rate limit, but no retry-after header. Anthropic says retries, including SDK auto-retries, keep failing until access resumes. Check error.details.error_code and stop retrying when you see the spend-cap code.

Limits are not the same as rate limits

Both providers also have rate limits, which cap requests and tokens per minute. Those protect capacity, not your wallet. A rate limit slows a runaway script; only a spend limit puts a ceiling on the bill. Anthropic's docs describe both on one page, and its Usage page in the Console charts your token use against your rate limits.

A sensible setup

  • Solo developer: one organization limit near your real monthly budget, with an alert at 50%.
  • Several apps: one OpenAI project or Claude workspace per app, each with its own limit.
  • Production: keep production limits higher and test limits low, so experiments fail first.
  • Code: catch the spend-limit error codes and show a clear message instead of retrying.

To plan the budget itself, see OpenAI API pricing explained, Anthropic API pricing explained, Gemini API pricing, Claude Code explained, and the AI tool price table.

FAQ

Do OpenAI spend alerts stop API requests?

No. Alerts only notify you. To block requests at a set amount, turn on Enforce a hard limit for the organization or project.

Can I set a Claude API limit above my tier's cap?

No. Your own spend limit can't exceed your tier's monthly cap. Request a tier increase in the Console if you need more.

When does a Claude spend cap reset?

At 00:00 UTC on the first day of the next month, unless you move to a higher tier sooner.

Can I limit spending per app?

Yes. Use OpenAI project limits or Claude workspace limits. Claude's default workspace can't have its own spend limit, so put each app in a named workspace.

Sources