💳

OpenAI: You Have No Credits Remaining

'You have no credits remaining. Add credits to continue using the API at https://platform.openai.com/settings/organization/billing/' is OpenAI's billing error for API usage. It comes back as HTTP 429 with the code credit_balance_exhausted, which means the OpenAI Platform organization behind the API key has no prepaid credits left. In Codex you see it as 'stream disconnected before completion: You have no credits remaining', and it surprises people because they pay for ChatGPT Plus or Pro. The reason is that Codex has two separate ways to sign in. Sign in with ChatGPT uses your subscription's included Codex usage. Sign in with an API key bills the OpenAI Platform account at standard API rates, and a ChatGPT subscription does not add API credits. So the fix is either to switch Codex back to ChatGPT sign-in, or to add credits to the correct API organization. Retrying never helps, because every request with that key fails until the balance changes.

Recommended toolLovableBuild apps and websites by chatting, no coding required.Start building

Affiliate link, we may earn a commission at no extra cost to you.

Symptoms You Might See

⚠️

Codex stops every turn with 'You have no credits remaining'

⚠️

Your app or SDK returns 429 with code credit_balance_exhausted and type insufficient_quota

⚠️

You pay for ChatGPT Plus or Pro but Codex still says you have no credits

⚠️

The OpenAI Platform will not let you create or reactivate an API key

⚠️

The error continues after you added credits

Common Causes

Codex is signed in with an API key

OpenAI's Codex documentation says API key sign-in uses standard API pricing instead of included ChatGPT plan usage. If an OPENAI_API_KEY was used to log in, your subscription is not being used at all.

The API organization's prepaid balance is empty

API usage is prepaid per organization. When the balance reaches zero, all keys in that organization fail with credit_balance_exhausted until credits are added.

Credits were added to a different organization

Credits belong to the organization, not to you as a person. A top-up in one organization does nothing for a key created in another.

A spend limit, not an empty balance

If the balance is positive, the 429 may be a project or organization spend limit instead. Those carry different codes (project_spend_limit_exceeded, organization_spend_limit_exceeded) and are fixed by raising the limit.

Step-by-Step Fixes

1

Check how Codex is signed in

When to try: First, if you have a ChatGPT subscription

Run codex login status in the terminal, or open the profile menu in the app or IDE extension. If it says you are signed in with an API key and you meant to use your ChatGPT plan, that is the cause.

2

Switch Codex to Sign in with ChatGPT

When to try: When you want to use included plan usage

Run codex logout, then codex login and complete the browser sign-in with your ChatGPT account. In the app or IDE extension, log out from the profile menu and choose Sign in with ChatGPT. Remove OPENAI_API_KEY from your shell profile if it keeps being picked up.

3

Add credits to the right organization

When to try: When you intend to pay for API usage

If you do want API billing, open platform.openai.com, confirm the organization selector matches the one the key was created in, then add credits under Settings, Billing.

4

Rule out spend limits

When to try: When you have credits but still get 429

If the balance is positive and requests still fail, read error.code in the response. Raise the project or organization spend limit if that is what it names.

5

Stop automatic retries on billing errors

When to try: For production apps

SDKs retry 429s by default, which wastes time on billing errors. Treat credit_balance_exhausted and the spend-limit codes as stop conditions and alert someone instead of retrying.

How to Prevent This

✓

Keep one sign-in method per machine and know which one Codex is using

✓

Turn on auto-recharge or a low-balance alert for API organizations

✓

Check error.code, not only error.type, in your error handling

✓

Create keys in the organization that actually holds the credits

When to Contact Support

Contact OpenAI support if credits show on the billing page of the same organization as your key but requests still fail, or if a payment completed without the balance updating. Include the organization ID, the time, and the request ID from the error.

Frequently Asked Questions

Does ChatGPT Plus or Pro give me API credits?▼

No. ChatGPT plans include Codex usage when you sign in with ChatGPT, but API key usage is billed separately through the OpenAI Platform at standard API rates.

Why does Codex say no credits when I have a subscription?▼

Codex is almost certainly signed in with an API key. Run codex login status, then log out and sign in with ChatGPT to use your plan's included usage.

What is credit_balance_exhausted?▼

It is the error code OpenAI returns, with HTTP 429, when the API organization has no prepaid credits left. Unlike a rate limit, waiting does not fix it; adding credits does.

I added credits and still get the error. Why?▼

The key probably belongs to a different organization than the one you topped up. Check the organization selector on the Platform and the organization the key was created under.

Is this the same as Codex usage limits?▼

No. Usage limits apply to ChatGPT sign-in and show as hitting your 5-hour or weekly limit. 'No credits remaining' is specific to API key billing.

Other Common AI Errors

⚠️

ChatGPT Not Working

Service Issues

🚦

Rate Limit Exceeded

Usage Limits

📏

Context Length Exceeded

Input Limits

🔥

Model Overloaded

Service Issues

Don't stop here

What to read next

Hand-picked guides our readers explore right after this one.