How to control OpenAI API billing with a hard spend limit
Last checked 2026-10-20 (ET). Tick each step as you go. Your progress is saved in this browser only.
OpenAI API billing has two controls that matter for surprise bills. The first is a monthly spend limit for your organization or a project. It only alerts you until you turn on Enforce a hard limit. The second is auto-reload on prepaid credits, which is on by default when you first buy credits. See all 9 providers.
Official doc: Spend limits
Before you start
You need permission to manage organization or project settings. See OpenAI's API Platform permissions.
Cap the whole organization
Cap a single project
Tip: a per-project cap lets you give a risky side project or an agent its own small budget without touching production.
What the cap does
- When tracked spend reaches a hard limit, API requests return a 429 error with the code
organization_spend_limit_exceededorproject_spend_limit_exceeded. - An organization limit covers all projects. A project limit covers only that project's traffic. Both can apply at once.
- Traffic resumes when you raise or remove the limit, or at the next monthly cycle.
- Spend alerts keep working alongside a hard limit, so you can get a warning before traffic stops.
What it does not do
- It is not instant. OpenAI says "Enforcement is not instantaneous, so recorded spend can slightly exceed the configured amount." Set your number a little below your true maximum.
- It can stop production traffic. Make sure your app handles a 429 with these codes gracefully.
- It is separate from the usage limit OpenAI assigns your organization by usage tier. Hitting that one returns
organization_usage_limit_exceeded. - It does not let you choose who gets alert emails. OpenAI's help center says "the organization owner(s) and project owner(s) will always receive these messages and this cannot be customized." (source)
Prepaid credits and auto-reload
New API accounts use prepaid billing. When you first buy credits, OpenAI says auto-reload "is turned on by default during setup. Turn it off if you do not want automatic credit purchases." If you keep it on, you can set an optional monthly reload limit.
- A reload limit is not a spend cap. OpenAI says: "A recharge limit is not an API usage limit. It controls automatic credit purchases, not the amount of existing credits you can use."
- When credits run out, requests return an error with the code
credit_balance_exhausted. - Usage can run past zero. OpenAI says "API access may not stop immediately after your credits run out" and "Do not rely on the prepaid balance as an instantaneous spending cutoff." That is why the hard limit above still matters.
Official doc: How can I set up prepaid billing?
Using Claude too? Set the Anthropic spend limit.
Where CapBrake helps
OpenAI already has a cap you can turn on, so the job is to make sure it is on. Use the free CapBrake checklist to tick off each step above. Your progress is saved in your browser. No account and no API key.