Fix · AI feature fails in production: 429, 403, quota or retired model

OpenAI 429 insufficient_quota error in production

Your AI features work locally, then calls in production fail with an HTTP 429 whose error type is insufficient_quota. Usually the organization behind the production key has no prepaid credits left, or has hit a spend or usage limit.

Likely causes, most common first

Cause 1

The organization's prepaid credit balance is depleted

OpenAI reports an empty prepaid balance as a 429 with the code credit_balance_exhausted. The error.type can still read insufficient_quota, so the type alone does not tell you the cause. The balance belongs to the organization, not to an individual key.

How to tell: error.code in the response body is credit_balance_exhausted.

Cause 2

A spend limit or usage limit was reached

A balance can be positive while a limit still blocks the request. OpenAI documents separate codes for an organization spend limit, a project spend limit and an OpenAI-assigned usage limit. Each has its own fix, and retrying does not clear any of them.

How to tell: error.code is organization_spend_limit_exceeded, project_spend_limit_exceeded or organization_usage_limit_exceeded rather than credit_balance_exhausted.

Cause 3

The production key belongs to a different organization or project than the one you checked

Local and production often use different keys. A key is assigned to an organization or project, so the credits and limits you inspected in the dashboard may not be the ones your deployed key draws on.

How to tell: The dashboard for your usual organization or project shows credit and no limit reached, but the deployed key was created somewhere else.

Check and fix it, step by step

  1. Log the status, error.type and error.code from the failing response

    The docs say to inspect error.code for billing-related errors, because error.type can still be insufficient_quota. Log all three fields where you handle the 429 so production logs show the cause.

    const body = await res.json();
    console.log(res.status, body.error?.type, body.error?.code);

    Docs: developers.openai.com →

  2. Check the prepaid credit balance of the organization that owns the production key

    If error.code is credit_balance_exhausted, the organization has no prepaid credits remaining. The error-codes page lists one fix: add credits to continue using the API.

    Docs: developers.openai.com →

  3. Check spend and usage limits at organization and project level

    If the code names a spend or usage limit, check that limit for the organization or project it names. The documented fixes are to increase or remove the organization or project spend limit, or to request a higher approved usage limit or contact support.

    Docs: developers.openai.com →

  4. Confirm which key, organization and project production is using

    Read the environment variables of the deployed service, not your local .env, and find which organization and project that key was created in. The docs list a key from a different organization or project as a cause of authentication errors. The same mismatch can send you to the wrong credits and limits here, so rule it out.

    Docs: developers.openai.com →

  5. Fix the credit or limit, then send one test request before restoring traffic

    The docs say to update the relevant credits or limits before sending another request. Send a single request with the production key and check that error.code is gone before you re-enable queued jobs or retries.

    Docs: developers.openai.com →

  6. Treat billing and quota codes as non-retryable in your client

    Retrying a billing stop adds load and delay, and access stays blocked. Fail fast on these codes and surface them to whoever owns the account. Keep backoff with Retry-After for genuine rate limits.

    const STOP = new Set([
      "credit_balance_exhausted",
      "organization_spend_limit_exceeded",
      "project_spend_limit_exceeded",
      "organization_usage_limit_exceeded",
    ]);
    if (res.status === 429 && STOP.has(body.error?.code)) {
      throw new Error(`billing stop: ${body.error.code}`); // no retry
    }

    Docs: developers.openai.com →

Quick check: Log error.code on the 429. If it is credit_balance_exhausted, the organization has no prepaid credits and retrying will not fix it.

With Gemmein

On Gemmein the OpenAI key is set per environment on the AI page. Going live copies AI tools without provider keys, so a tool with no Live key waits paused, answering ai_not_configured with nothing spent, until your human adds a key or chooses Development's. When the provider answers g.ai.text or g.ai.runText with a non-2xx, the err.code is provider_error, carrying the provider's own status and message.

How often this shows up in our data

1 of the 950 verified cases from the last 12 months in our data match this symptom (0.1%). How we collect and verify cases.

Questions

Is insufficient_quota the same as a rate limit error?

No. A rate limit error means requests are arriving too quickly. Pace them and follow the Retry-After header when present. A billing or quota error needs a change to credits or limits first.


Should I retry a 429 with insufficient_quota?

No. The docs say not to retry quota, billing or other errors that require you to take action. Retrying will not restore access, so surface the error to whoever manages the account.


Which field tells me the exact cause?

Use error.code. The error.type can still read insufficient_quota, while error.code separates an empty prepaid balance from an organization or project spend limit.


Why does it fail in production but not locally?

The two environments may use different keys. If those keys belong to different organizations or projects, each has its own credits and limits, so one can work while the other is blocked.


Sources

Every cause and step above was checked against these pages on 17 Nov 2026.

The broader pattern

This is one symptom of a wider failure pattern: AI feature fails in production: 429, 403, quota or retired model. The guide covers every cause we see for it, on any stack.

Get a heads-up when OpenAI breaks something

OpenAI

Leave your email and we'll let you know when something big changes for OpenAI. Unsubscribe any time by replying. Gemmein Limited. Research terms · Privacy

← All fixes