OpenAI API 503 server_is_overloaded: Model temporarily overloaded
OpenAI API 503 server_is_overloaded is model capacity, not your limits. Wait for Retry-After and retry; the Python SDK already retries twice.
503 - Model temporarily overloadedType: service_unavailable_errorCode: server_is_overloadedThe requested model does not have enough capacity right now. It is not your request rate or billing, so there is nothing to change in your settings: wait as long as the Retry-After response header says and send the request again. If it keeps happening, check status.openai.com for an incident.
[1] Don't read it as a 429. The codes look alike but the fixes differ (official error codes guide).
| Response | Cause | Fix |
|---|---|---|
503 server_is_overloaded | Temporary model capacity shortage | Retry after Retry-After |
429 slow_down (rate_limit_error) | Request rate grew too fast, even within limits | Slow down, then ramp up gradually |
| 429 Rate limit reached | Your RPM or TPM limit | Pace requests, follow Retry-After |
429 credit_balance_exhausted, …_spend_limit_exceeded | Credits or spend limit | Retrying won't help; adjust credits or limits |
| 500 | Server error | Retry after a short wait; contact support if it persists |
For slow_down, the docs give a rule of thumb: once traffic reaches 1 million input tokens per minute, increase it by no more than 50% every 15 minutes.
[2] With an official SDK you are already retrying. The Python SDK retries 408, 409, 429 and 500-and-above twice by default and honors Retry-After when present. A local mock server returning 503 with Retry-After: 3 was called with client.models.list(). The first argument of client.py picks the mock's behavior (always503 always fails, twice503 fails twice), the second is max_retries.
$ python client.py always503 2InternalServerError status=503 code=server_is_overloaded after 6.0sopenai 3.39.0$ python client.py twice503 2success after 6.0sopenai 3.39.0$ python client.py always503 0InternalServerError status=503 code=server_is_overloaded after 0.0sopenai 3.39.0The server's log:
t= 1.69s always503 request 1 -> 503t= 4.69s always503 request 2 -> 503t= 7.70s always503 request 3 -> 503t= 8.79s twice503 request 1 -> 503t=11.79s twice503 request 2 -> 503t=14.80s twice503 request 3 -> 200t=15.74s always503 request 4 -> 503That is one request plus two retries, exactly 3 seconds apart, so Retry-After was honored. When the third attempt succeeds, the caller never sees an error. The SDK raises a 503 as InternalServerError (shared by all 500-and-above), so to handle overload separately check e.status_code == 503 or e.code == "server_is_overloaded". Don't log it as a "server bug" based on the class name alone.
client = OpenAI(api_key="sk-test", base_url=f"http://127.0.0.1:18941/{mode}/v1", max_retries=retries)[3] A long Retry-After changes what the SDK does. The same mock was tried with 120 and 180 seconds.
$ python client.py long503 2InternalServerError status=503 code=server_is_overloaded after 240.0sopenai 3.39.0$ python client.py huge503 2InternalServerError status=503 code=server_is_overloaded after 0.0sopenai 3.39.0With 120 seconds it waited twice and failed after 240 seconds; with 180 it failed at once without retrying. SDK 3.39.0 follows a server-requested delay only up to 2 minutes (MAX_RETRY_AFTER_DELAY = 2 * 60) and does not retry beyond that. The docs also say the Python library can stop automatic retries when a server delay exceeds its supported limit. Inside a web request, two 2-minute waits may already be too long, so set client.with_options(max_retries=…, timeout=…) per call.
[4] If your application retries on top, don't multiply the SDK's retries. The docs say to respect the original delay (Retry-After) and account for retries the SDK already made. Without Retry-After, back off exponentially with a little random jitter and cap the number of attempts. Work that can wait is better handed to a queue.
[5] With service_tier: "flex", a capacity shortage comes back as 429 Resource Unavailable, not a 503. You are not charged for it, and the Flex docs suggest re-sending with service_tier set to auto or removed to use the project's default mode. Which tier, and which price, that request gets depends on the project setting.
[6] If it lasts, check status.openai.com for the model. When contacting support, the docs ask for the model name, the error message and code, the request data and headers, and the timestamp with time zone.
For limit-related 429s, see OpenAI 429 Rate limit reached (TPM) and OpenAI API 429 exceeded your current quota.
Check it with the HTTP status codes tool ↗ — calculated in your browser.