Q&A: should you retry a 429, a 503, or an insufficient-balance error?
Read error.code before acting. A 429 may mean throttling, exhausted credits, or a spend limit, while a 503 usually means temporary model overload; each needs a different response.
The conclusion first
When an API call fails, the most useful fields are not “request failed,” but the HTTP status, error.type, error.code, Retry-After, and request ID. OpenAI's official guide separates rate limits, exhausted credits, spend limits, server errors, and model overload. SalpX's documentation likewise distinguishes keys, balances, models, rate limits, and upstream failures.12
Remember: temporary capacity problems can be retried after waiting; balance, permission, and parameter problems cannot.
Q: What does 429 mean?
429 means the request was limited, but it has several possible causes:
- Requests or tokens were sent too quickly.
credit_balance_exhausted: prepaid credits are gone.organization_spend_limit_exceeded: the organization spend limit was reached.project_spend_limit_exceeded: the project spend limit was reached.organization_usage_limit_exceeded: the approved organization usage limit was reached.- On SalpX, token concurrency or rate limits may return
rate_limit_exceeded.12
Do not start a retry loop merely because the status is 429. Read error.code or the response message first.
Q: How should a throttling 429 be handled?
If the error says traffic is too fast, reduce the sending rate and follow Retry-After. When it is absent, use exponential backoff with jitter—for example, wait 1, 2, and 4 seconds—then enforce a maximum attempt count and total deadline.
Do not let every worker retry immediately. That turns one limit into a retry storm. Use a shared limiter for concurrency, requests per minute, and tokens per minute; when traffic recovers, ramp it up gradually.
Q: Can an insufficient-balance error be retried?
No. OpenAI says billing, spend, and quota errors are not fixed by retrying; credits or limits must be handled first.1
Through a relay, also distinguish three balances: the user's wallet balance on the site, the token's quota, and the upstream account balance. Topping up a relay account does not necessarily restore an upstream account, and one failed model does not prove every model is out of funds.
Use this order:
- Save the complete error response and request ID.
- Determine whether the client, SalpX, or the provider returned it.
- Check the user balance, token quota, and current group.
- After a top-up or limit change is confirmed, send one minimal request.
Q: What is the difference between 503 and 500?
OpenAI defines 503 server_is_overloaded as insufficient temporary capacity for the requested model. Follow Retry-After, or increase the delay gradually when it is missing.1
A 500 means the server had an error processing the request. A short wait and retry may help, while the status page should be checked. If it persists, keep the model, error code, request time, timezone, and request data for support.
SalpX also documents that some upstream 5xx failures are treated as failures and automatically refunded. The client should still avoid duplicate submissions, especially for images, videos, and tool calls. Automatic refunds do not make infinite replay safe.2
Q: Should 401, 403, and 404 be retried?
Usually not blindly.
- 401: check the API key, whether it expired or was revoked, and whether the organization and project match.
- 403: check region, permissions, user quota, and model group. On SalpX,
insufficient_quotameans insufficient quota or a restricted token. - 404: check the model, base URL, and path. Treating a complete endpoint as a base URL often duplicates a path segment.
Fixing the configuration and then sending a request is a meaningful retry.
Q: What if a video request returns 200 but no video is ready?
Video is usually asynchronous. SalpX documents the sequence as submit, receive a task_id, poll status, and extract the video URL after success; the client timeout should cover upstream generation and polling.2
HTTP 200 may mean that a task was accepted or that a status query succeeded; it does not necessarily mean the video is finished. Check status, preserve the task_id, poll with backoff, and handle failure, timeout, and no-result states. Do not create a second task merely because the first response has no URL.
Q: Which fields should a relay user save?
At minimum:
- Request time and timezone.
- Model, endpoint, and client version.
- HTTP status,
error.type,error.code, andmessage. Retry-After, request ID, and task ID.- Reservation, successful usage, and refund or release result.
These fields answer three important questions: who rejected the request, should it be retried, and was it charged?
The first rule of error handling is not “make it succeed.” It is “do not turn a non-retryable problem into ten duplicate requests.”
A minimal decision list
- Read the status and
error.codefirst.
- 429 throttling: back off, lower concurrency, and ramp gradually.
- 429 balance or limits: stop retrying and fix the quota.
- 503: wait according to
Retry-After, then use a safe fallback route if needed.
- 500: retry briefly and check status; preserve evidence if it continues.
- 401/403/404: check the key, permission, group, model, and path.
- Async task: preserve the task ID and poll; do not create duplicates.
- After any failure: reconcile billing and refunds before deciding what to do next.
1: OpenAI Developers, “Error codes”: https://developers.openai.com/api/docs/guides/error-codes 2: SalpX, “SalpX API reference”: https://www.salpx.com/api-docs/
Sources & attribution
This article references the public materials listed below. Analysis and wording are SalpX's own; quoted material remains the property of its original authors and publishers.
- Error codes — OpenAI Developers · accessed 2026-11-22Note:OpenAI's official error-code guide explains the causes and handling of 401, 429, 500, and 503 errors.
- SalpX API 参考 · 单页文档 — SalpX · accessed 2026-11-22Note:SalpX's official documentation covers the base URL, authentication, error codes, and asynchronous task handling.
One key for Claude, GPT and 50+ models
The SalpX gateway is OpenAI-SDK compatible. Point base_url at https://www.salpx.com/v1 and you are done.