Blog

OpenAI API "credit_balance_exhausted" (429): What It Means and How to Fix It

Short answer

A 429 response with "code": "credit_balance_exhausted" means the OpenAI organization behind your API key has no prepaid credits left. OpenAI's error code guide lists it as 429 - Credit balance exhausted. The fix is to add credits in that organization's billing settings. Retrying won't help: every request with a key from that organization fails until the balance is topped up.

Check error.code, not just error.type. The type in this response can still be insufficient_quota, so code that only looks at the type can't tell an empty balance apart from other quota and spend-limit errors.

If you can't add credits, for example because your card is declined, you can call GPT models through TeamoRouter with the same OpenAI SDK. It's pay-per-use from $5, and you can top up by card or with USDT.

What the error looks like

This is a real response printed by the OpenAI Python SDK, from a public GitHub issue filed in October 2026:

text
Error code: 429 - {'error': {'message': 'You have no credits remaining. Add credits to continue using the API at https://platform.openai.com/settings/organization/billing/.', 'type': 'insufficient_quota', 'param': None, 'code': 'credit_balance_exhausted'}}

The Realtime API reports the same thing as an error event with the same message, type='insufficient_quota' and code='credit_balance_exhausted' (livekit/agents#7805). When the error arrives inside a stream, there may be no HTTP status to look at, so code is the field to check.

credit_balance_exhausted vs. insufficient_quota and other 429s

A 429 from OpenAI isn't always a rate limit. The error code guide lists these 429 errors:

Code What it means What fixes it
credit_balance_exhausted The organization has no prepaid credits left Add credits in billing settings
organization_spend_limit_exceeded The organization reached a spend limit it set Raise or remove the organization spend limit
project_spend_limit_exceeded A project reached its spend limit Raise or remove the limit in the project settings
organization_usage_limit_exceeded The organization reached its OpenAI-assigned usage limit Request a higher limit or contact OpenAI support
slow_down (type rate_limit_error) Your request rate went up too quickly Follow Retry-After, then ramp up gradually
"Rate limit reached for requests" You're sending requests too fast Pace requests and follow Retry-After

Only the last two get better with waiting. The guide says that retrying billing, spend or quota errors won't restore access; you have to change the credits or the limits first.

Where insufficient_quota fits. insufficient_quota is the broader error type that OpenAI billing errors can still carry. Older code and tutorials often check for it alone. If yours matches on code == "insufficient_quota", it won't recognize credit_balance_exhausted. One open-source project found that it classified the new code as an unknown error and retried every request five times (NeverEndingQuest#1169). For the older quota error and how Codex users run into it, see Codex API quota exceeded.

How to fix it on OpenAI's side

  1. Add credits to the right organization. Open billing settings for the organization the key belongs to and add credits. Credits are held by the organization. If you're in several organizations, a top-up in one doesn't help a key created in another.
  2. Check that it isn't a spend limit. If the balance is positive and requests still fail, read error.code. organization_spend_limit_exceeded and project_spend_limit_exceeded are limits you or an admin set, and raising them fixes the error.
  3. Stop retrying in a loop. The official Python SDK retries 429 responses twice by default, with backoff (openai-python README). That's useful for rate limits and wasted on billing errors. Handle the billing codes yourself:
python
import openai
from openai import OpenAI

client = OpenAI()

BILLING_CODES = {
    "credit_balance_exhausted",
    "organization_spend_limit_exceeded",
    "project_spend_limit_exceeded",
    "organization_usage_limit_exceeded",
}

try:
    resp = client.responses.create(model="gpt-5.6-sol", input="Hello")
except openai.RateLimitError as e:
    if e.code in BILLING_CODES:
        # Not a rate limit: alert someone and stop sending requests.
        raise RuntimeError(f"OpenAI billing error: {e.code}") from e
    raise  # a real rate limit: back off and try again later
  1. Alert on it. An empty balance stops every service that uses the organization's keys at the same time. Treat credit_balance_exhausted as an incident, not a transient error.

When you can't add credits

Adding credits needs a payment method that OpenAI accepts. If your card keeps getting "Your card has been declined." on the billing page, see OpenAI API "Your card has been declined": what to try. If someone else manages billing for your organization, they have to add the credits.

Call GPT through TeamoRouter instead

TeamoRouter is an API gateway with one key for GPT, Claude, Gemini and DeepSeek. It's OpenAI-compatible: /v1/chat/completions and /v1/responses (GPT models) work with the official SDKs, so you only change the base URL and the key. You don't need an OpenAI organization or OpenAI credits, and there's no subscription: you pay per use.

  1. Create an API key in the TeamoRouter console. It starts with sk-teamo-.
  2. Top up from $5. The top-up dialog takes cards. You can also click Pay with crypto and pay with USDT, USDC or ETH from Binance, OKX or any exchange app — the checkout shows which networks your amount supports (BEP20 works from $5). You don't need a wallet extension, and the invoice stays valid for 60 minutes. Step by step: Pay with USDT.
  3. Change the base URL and key:
python
from openai import OpenAI

client = OpenAI(
    api_key="sk-teamo-...",
    base_url="https://api.teamorouter.com/v1",
)

resp = client.responses.create(
    model="gpt-5.6-sol",
    input="Hello",
)
print(resp.output_text)

The key goes in Authorization: Bearer, as it does with OpenAI. GET /v1/models lists the model IDs you can use; the rest is in the API integration guide. For Codex, set a custom provider in ~/.codex/config.toml as shown in Install and connect Codex.

Fast mode ("service_tier": "fast") is billed at 2× the list price.

FAQ

Is credit_balance_exhausted a rate limit? No. It uses HTTP 429, like rate limits, but it means the balance is empty. Waiting doesn't fix it; adding credits does.

I added credits and still get the error. Why? Check that the key was created in the organization you topped up. A key from another organization draws on that organization's balance, not the one you just added to.

Does a ChatGPT Plus or Pro subscription cover API usage? No. OpenAI bills API key usage through your OpenAI Platform account at standard API rates, separately from ChatGPT plans (Codex authentication docs).

Will my OpenAI SDK code work with TeamoRouter? Yes. Change base_url to https://api.teamorouter.com/v1 and the key to your TeamoRouter key. Request and response formats stay the same.

Next steps

Ready to connect?Log in · top up · create an API key — three steps to start.