Guide · OpenAI

OpenAI spend limits: alerts vs. enforced hard limits

A spend alert only notifies you. Traffic stops after the configured amount only when Enforce a hard limit is on, and even then the recorded total can land a little over the line.

Last checked against OpenAI's spend-limits guide and the two Help Center articles linked below.

The short answer

A spend alert sends a notification. API traffic continues. A hard spend limit makes affected requests return 429 with organization_spend_limit_exceeded or project_spend_limit_exceeded once tracked spend reaches the amount. Enforcement is not instantaneous, so recorded spend can slightly exceed the configured amount. [1]

Alerts stay active after you add a hard limit, so you can be notified before the hard limit interrupts traffic. OpenAI's approved monthly usage limit, which comes from your usage tier, is a separate control. [1]

How to turn it on

You need permission to manage the organization or project settings you are changing. [1]

Organization

  1. Go to Organization limits.
  2. In Spend, select Edit spend limit.
  3. Enter the Monthly spend limit.
  4. To make API responses fail after the organization reaches the limit, turn on Enforce a hard limit.
  5. Select Save.

Project

  1. Go to Project settings.
  2. Select Limits.
  3. In Spend, select Edit spend limit.
  4. Enter the Monthly spend limit.
  5. To make API responses fail after the project reaches the limit, turn on Enforce a hard limit.
  6. Select Save.

Those are the steps on OpenAI's spend-limits page. [1] An organization hard limit applies to API traffic across all projects. A project hard limit applies only to API traffic billed to that project. [1]

The error codes

Check error.code. A billing-related error may still use the broader error.type value insufficient_quota. Retrying these four codes does not restore access. Fix the limit or the credit balance first. [2] [3]

error.codeWhat it meansFix
organization_spend_limit_exceededThe organization reached a configured hard spend limit.Raise or remove the organization limit if traffic should resume before the monthly reset.
project_spend_limit_exceededThe project reached a configured hard spend limit.Raise or remove that project's limit, or wait for the monthly reset.
organization_usage_limit_exceededThe organization reached its OpenAI-assigned usage limit.Request a higher approved usage limit.
credit_balance_exhaustedThe organization has no prepaid credits remaining.Add credits.

The meanings are from OpenAI's usage-and-spend article. The fixes for the two spend-limit codes and for credit_balance_exhausted and organization_usage_limit_exceeded are the restore steps on the spend-limits page: raise or remove a reached spend limit if traffic should resume before the monthly reset, request a higher approved usage limit, or add credits. [1] [2] Raising or removing a reached spend limit lets traffic resume after the update propagates. Otherwise the limit resets with the next monthly cycle. Changes to enforced spend limits can take time to apply. [1] [3]

A 429 can also be a request or token rate limit. That one is temporary. Check for a Retry-After header, and if it is missing, use exponential backoff with jitter. Official OpenAI SDKs already retry eligible rate-limit errors. Continuously resending the same request can prolong the problem. Do not treat that retry path as the fix for a spend-limit or credit-balance code. [3]

const code = error.code;

if (
  code === "organization_spend_limit_exceeded" ||
  code === "project_spend_limit_exceeded" ||
  code === "organization_usage_limit_exceeded" ||
  code === "credit_balance_exhausted"
) {
  // error.type may still be "insufficient_quota".
  // Retrying does not restore access.
  return;
}

Set it via the API

OpenAI's Administration API reference documents a project hard spend limit at POST /organization/projects/{project_id}/spend_limit, with GET and DELETE on the same path. The object type is project.spend_limit. [4]

  • threshold_amount is the hard spend limit in cents. [4]
  • currency is USD. The reference says only USD is supported. [4]
  • interval is month. The reference says only month is supported. [4]
  • enforcement.status is inactive or enforcing. [4]

These admin routes use an Admin API key. An Admin API key cannot call the non-administration endpoints. [5] The published curl in the Admin APIs guide is for the organization limit, POST https://api.openai.com/v1/organization/spend_limit, with threshold_amount, currency, and interval. That guide does not print a project curl. Use the project path from the API reference above. [5] [4]

Why I was charged past my limit

  • The limit was an alert. Alerts do not enforce a cap. Traffic continues at the configured amount unless Enforce a hard limit is on. [1]
  • Enforcement lagged. The API can process a small amount of extra usage while the limit state propagates, so recorded spend can slightly exceed the amount. [1]
  • The limit is monthly, and it covers an organization or a project. It is not a daily cap on one key. A loop or a copied key can spend until that monthly amount. [1] If the key was copied, revoke it at OpenAI. The leaked-key guide is the provider checklist, and the Railway breach guide is the dated one for keys that lived in a host's environment variables.

The gap

A hard limit caps a month of spend for the organization or for one project. One project per key keeps a looping key from sharing that ceiling with everything else. It still does not email you the hour a quiet key wakes up. The per-key spend guide is why OpenAI's project budget is too coarse for that, and the daily budget guide is what a daily check looks like on OpenAI, Anthropic, and OpenRouter.

BillCurfew watches per-key spend at the provider. It is not a proxy, and prompts stay with the provider. The check runs about every five minutes. It emails you when a daily cap or a spike rule trips. A manual kill works on every plan, including Free. On OpenAI that kill is a delete, and OpenAI does not offer an undo. Auto-kill is on Solo, Team, and Agency only, and it stays off until you turn it on. The same product covers Anthropic and OpenRouter. This page's hard limit is OpenAI's. How that compares with a provider limit and with a gateway is on the spend limits vs proxies page, and the plan prices are on pricing.

Start free with one key, no card.

FAQ

Does an OpenAI spend alert stop API calls?

No. A spend alert sends a notification, and API traffic continues. Only a hard spend limit with Enforce a hard limit turned on makes affected requests return a 429. [1]

Why did OpenAI charge more than my spend limit?

Either the limit was an alert, so traffic never stopped, or enforcement lagged. OpenAI says enforcement is not instantaneous, so recorded spend can slightly exceed the configured amount. [1]

What does project_spend_limit_exceeded mean?

The project reached its enforced hard spend limit. Raise or remove that limit, or wait for the monthly reset. Retrying does not restore access. [2] [3]

Is there a daily limit per key?

The hard spend limits on OpenAI's spend-limits page are monthly, and they apply to the organization or to one project. They are not a daily cap on a single API key. [1]

Will retrying fix a 429?

Not when the code is organization_spend_limit_exceeded, project_spend_limit_exceeded, organization_usage_limit_exceeded, or credit_balance_exhausted. A 429 from a request or token rate limit is a different error: wait for Retry-After, or back off, and do not keep resending the same request. [2] [3]

Sources

  1. OpenAI, Spend limits. https://developers.openai.com/api/docs/guides/spend-limits
  2. OpenAI Help Center, Troubleshooting API usage and spend limits. https://help.openai.com/en/articles/6614457-troubleshooting-api-usage-and-spend-limits
  3. OpenAI Help Center, Troubleshooting API rate limits and 429 errors. https://help.openai.com/en/articles/5955604-troubleshooting-api-rate-limits-and-429-errors
  4. OpenAI API reference, Organization admin (project spend limit). https://developers.openai.com/api/reference/go/resources/admin/subresources/organization
  5. OpenAI, Admin APIs. https://developers.openai.com/api/docs/guides/admin-apis