- Symptom
- 429 with error.type insufficient_quota429 Credit balance exhausted with code credit_balance_exhaustedBackoff loop retries for minutes on a brand new API key
- Cause
- Billing and quota errors share HTTP 429 with real rate limits. The API is prepaid, so an organization with no credits gets 429 on every call and waiting does not help.
- Fix
- Check error.code before retrying. Retry only rate limit codes, and surface credit or quota errors immediately so someone adds credits.
- Apply
except openai.RateLimitError as e: if e.code == "credit_balance_exhausted" or e.type == "insufficient_quota": raise # add credits, do not retry time.sleep(backoff)- Affected
- OpenAI API prepaid billing, error codes as documented October 2026
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders