Troubleshooting API usage and spend limits

Identify the limit or credit balance affecting your API requests and find the right next step.

Updated: 7 hours ago

Overview

An API billing or quota error can mean that you’ve reached an approved usage limit, reached a configured spend limit, or used your prepaid credits. Check the error before changing your settings. If the error identifies an API key, review that key’s limit in Check configured spend controls.

Identify the error

Check error.code in the API response. A billing-related error may still use the broader error.type value insufficient_quota.

Error codeWhat it meansNext step
organization_usage_limit_exceededYour organization reached its OpenAI-assigned usage limit.Review your approved limit and options for an increase.
organization_spend_limit_exceededYour organization reached a configured hard spend limit.Review the organization’s spend controls.
project_spend_limit_exceededYour project reached a configured hard spend limit.Review that project’s spend controls.
credit_balance_exhaustedYour organization has no prepaid credits remaining.Add credits to your API balance.
api_key_spend_limit_exceededThe API key reached its configured monthly hard spend limit.Review that key’s spend limit.

Retrying these errors won’t restore access without addressing the relevant credits or limits. For details, see the API error codes guide.

Review your approved usage limit

Go to your organization’s Limits page to check its current approved monthly usage limit and usage tier.

Paid API usage tiers are Build, Launch, and Grow. Your organization upgrades automatically when its total credit purchases reach $5, $100, and $500, respectively. Higher tiers generally provide higher rate limits. Check your organization’s Limits page for its current tier and limits.

Existing paid organizations move automatically from Tiers 1–2 to Build, Tiers 3–4 to Launch, and Tier 5 to Grow. You don’t need to make an additional payment for this migration. API pricing and custom rate limits are unchanged.

For tier details, see the API rate limits guide.

Check configured spend controls

Spend alerts send notifications without stopping API traffic. Hard spend limits can stop affected requests when tracked spend reaches the configured amount.

Both organization and project limits can apply. An organization limit covers its projects; a project limit covers traffic billed to that project. These controls are separate from your OpenAI-approved usage limit. An API key limit covers requests using that key. All applicable hard spend limits can apply at the same time.

If a hard limit caused the error, someone with permission to manage the relevant settings can raise or remove it if spending should continue. Otherwise, it resets with the next monthly cycle. Changes and enforcement aren’t instantaneous, so recorded spend can slightly exceed the configured amount.

Recover from an API key spend limit

If error.code is api_key_spend_limit_exceeded, review the affected key in the project's API Keys settings. Someone who can edit the key can raise or remove the limit if spending should continue. You can also wait for the start of the next calendar month. Allow changes time to apply, then check the error again. A separate project or organization limit can still block the request.

If spending and the key's enforcement status appear out of sync, compare the same key and month in your API usage and costs. Usage reporting and enforcement can update at different times. For setup and replacement keys, see Managing projects in the API platform.

For settings and instructions, see the API spend limits guide.

Check your prepaid balance

If you’ve used your prepaid credits, go to the API billing portal and select Buy credits or Add to credit balance, whichever appears, to purchase more. Your updated balance may take a few minutes to appear.

For setup and recharge guidance, see: Setting up prepaid billing.

Check whether the error is a rate limit

Request and token rate limits control how quickly you can use the API. They’re different from monthly usage limits, spend controls, and your prepaid balance.

For request or token rate-limit errors, see: Troubleshooting API rate-limit errors.

Was this article helpful?