OPENAI WORKFLOW · 10 / 10
Diagnose OpenAI 429 rate limits and exhausted credits
Use the error body to distinguish a pacing problem from a billing or spending limit.
Documentation checked · Loomwell editorial guide · Examples have not been live API tested.
Steps
- For request rate limits, reduce concurrency and follow Retry-After when provided. Use bounded retry backoff rather than an immediate retry loop.
- credit_balance_exhausted requires adding credits. organization_spend_limit_exceeded and project_spend_limit_exceeded require resolving the applicable spend limit; waiting alone does not fix them.
Example
Python · Python API examples require OPENAI_API_KEY and OPENAI_MODEL in your server environment. API calls may incur OpenAI charges.
# In an HTTP error handler, inspect sanitized error metadata.
def classify_429(error_code):
if error_code in {"credit_balance_exhausted",
"organization_spend_limit_exceeded",
"project_spend_limit_exceeded"}:
return "Resolve billing or spending configuration"
return "Inspect error type/message and retry headers before retrying"Check the result
Keep retries finite and investigate unknown codes. A 429 status alone is insufficient to choose a remedy.
Official source
Check current provider documentation and model support before deployment. This guide is separate from the approved evidence records listed in the catalog.
Use Loomwell with your coding agent
Inspect the published record coverage before starting a trial or connecting MCP.