← All guides

OpenAI spend alerts vs hard limits

If you use the OpenAI API Platform for coding agents or apps, these two controls do different jobs. Confusing them is how “I thought I had a cap” turns into a surprise invoice—or a production outage.

The difference (official behavior)

ControlAt the thresholdUse when
Spend alertSends a notification; API traffic continuesYou want warning time
Hard spend limitAffected requests return 429 with organization_spend_limit_exceeded or project_spend_limit_exceededYou need a hard monthly cap

Source: OpenAI API docs — Spend limits.

Important: Enforcement is not instantaneous—recorded spend can slightly exceed the configured amount while limit state propagates. OpenAI also assigns a separate approved monthly usage limit by usage tier; that is not the same as the spend limit you configure.

How to set a monthly spend limit

You need permission to manage org or project settings (see OpenAI API Platform permissions).

Organization

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

Project — Project settings → Limits → Edit spend limit → optional hard enforce → Save.

Org hard limits apply across projects; project hard limits apply only to that project’s billed traffic. Either can 429 a request.

Recommended pattern

If traffic already stopped

  1. Read error.code: organization_spend_limit_exceeded, project_spend_limit_exceeded, organization_usage_limit_exceeded (the OpenAI-approved limit), or credit_balance_exhausted.
  2. Raise or remove the spend limit you hit, request a higher approved usage limit, or add credits, depending on the code. Otherwise the spend limit resets with the next monthly cycle.
  3. Wait for propagation before assuming it’s fixed.

Need alerts across OpenAI + Anthropic + local CLI exports?

SpendLens is in development (waitlist only). It is planned as a hosted budget alarm that warns you before you run out, not another cost dashboard. Planned pricing Solo $9 / Pro $19; not charging yet.

Join the SpendLens waitlist

Night Shift Labs · Not affiliated with OpenAI.