insufficient_quota Error Explained: Balance, Budget Cap, Rate Limit

Blog / Troubleshooting

insufficient_quota Error Explained: Balance, Budget Cap, Rate Limit

insufficient_quota means this account or project has no billable quota left. It has nothing to do with how fast you send requests. Waiting a few seconds and retrying usually won't help. You need to add credit, raise the budget cap, or switch to a key that still has quota.

This error trips up newcomers because it often arrives with HTTP status 429, and most people read 429 as "rate limited." Below, the three easily confused cases are separated, followed by a troubleshooting order you can follow step by step.

When does insufficient_quota show up?

Using the OpenAI API as the example, a typical response looks like this:

{
  "error": {
    "message": "You exceeded your current quota, please check your plan and billing details.",
    "type": "insufficient_quota",
    "code": "insufficient_quota"
  }
}

The key is the code field. Both are 429s, but rate_limit_exceeded means you hit a rate limit, while insufficient_quota means a quota problem. The phrase "you exceeded your current quota" is about quota, not request frequency.

Other providers use different wording but follow a similar idea: some return a dedicated insufficient-balance error code, others use a different 4xx status and explain in the response body. Field names and status codes are defined in each provider's official docs, so don't draw conclusions from the HTTP status alone.

What is the difference between low balance, a budget cap, and a rate limit?

TypeTypical symptomWhat it really isDoes waiting help?What to do
Insufficient balanceinsufficient_quota, fails on every modelPrepaid balance or free credit is used upNoAdd credit, or confirm which account the key belongs to
Budget capThe account still has money, but a project or organization hit its monthly limitA spending cap you (or an admin) setNo; wait for the next cycle or raise it manuallyAdjust the budget or limit settings
Rate limitrate_limit_exceeded, appears at peak times, clears after a few secondsRequests per minute or tokens per minute exceeded your tierYesBack off and retry, lower concurrency, upgrade your tier

A rough rule of thumb: if it recovers after a few seconds, it is probably a rate problem. If it fails the same way no matter how many times you retry, it is probably a quota problem. The error code in the response body is the final word.

Budget caps are especially easy to overlook. Many platforms let you set a spending cap per organization or project. The account balance may be fine while one project's key keeps returning quota errors. In that case, look at the project the key belongs to, not the total account balance. Where to find these settings, and what they are called, is covered in the official docs.

What order should you troubleshoot insufficient_quota in?

  1. Check the error code, not just the status code. Print the full response body and see whether code or type is insufficient_quota. If it is rate_limit_exceeded, see 429 Too Many Requests: how to troubleshoot LLM API rate limits.
  2. Confirm which account and project the key belongs to. Many people hold several keys, and a key copied from an old project may belong to an account that ran out of quota long ago. Check the organization and project the key lives in, in the console.
  3. Open the usage and billing pages. Look at your balance, the quota you have used, and whether there are unpaid invoices. Whether free trial credit expires, and what the API returns afterward, is covered in the official docs.
  4. Check the project or organization budget cap. If the account has balance but you still get the error, look at whether a monthly limit is set and whether you have reached it this month.
  5. After adding credit or changing settings, wait a moment and test again. Credit may take a while to show up. Verify with one minimal request instead of rerunning the whole batch.

A minimal curl check looks like this (the key is passed through an environment variable so it stays out of your shell history):

curl -s https://api.openai.com/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"<your model name>","messages":[{"role":"user","content":"ping"}],"max_tokens":5}'

Use a model your account can access. The name here is only a placeholder.

How should your code handle these two kinds of 429?

Don't retry every 429 the same way. Retrying a quota error only wastes time, and under high concurrency it can add log noise. A more robust approach:

  • Parse the error code in the response body. Send rate_limit_exceeded through exponential backoff and retry.
  • Fail insufficient_quota immediately, raise an alert, and notify whoever owns billing.
  • Count the two separately in monitoring. Otherwise a "429 spike" metric mixes billing problems with traffic problems.

For how to set alert thresholds, see How to set LLM API alert thresholds: treating 429, 5xx, timeouts, and P95 latency separately.

One more case is worth ruling out first: the service itself may be having an outage and returning abnormal responses. You can check the probe results for the official API endpoint on cdnping's OpenAI status page, or use Is it down? for an overall status view. Note that these pages reflect service availability. They cannot tell you anything about your own account's quota.

Are there other options for beginners in China who hit quota problems?

For users in China, a quota problem with an overseas provider is often more than "just add credit." You may need an international payment method, and your account's region must be within the provider's officially supported range. All of this follows each provider's official policy. Please use these services in line with their terms and local regulations, and don't try to get around payment or region restrictions in ways that aren't compliant.

If your goal is to use models reliably in tools like Claude Code and Codex, you can look at AGI Plan. AGI Plan is a commercial partner of cdnping. What follows lists only facts published on its official site:

  • A multi-provider LLM aggregation gateway, sold as a monthly subscription, billed in RMB, with no overseas credit card required.
  • The quota in one subscription can be switched between multiple capability groups.
  • Tools such as Claude Code and Codex only need one endpoint address changed.
  • Some models are marked "overseas only." See the model list for specifics.
  • The site states that it is not an officially authorized channel. Whether it suits you is for you to judge.

For setup steps and plans, see the AGI Plan beginner guide.

What to do next

  1. Print the full response body and confirm that code is insufficient_quota.
  2. Check which organization and project the key belongs to, then look at the balance and budget cap.
  3. After fixing it, verify with one minimal request.
  4. In your code, handle quota errors and rate errors separately.

If the account's quota is fine and requests still fail, move on to the network layer, for example the Developer network self-check checklist (2026 edition), or test connectivity to each AI API from the home page.

Related articles

Keep reading