A 529 overloaded error from Claude means Anthropic's upstream capacity is temporarily full, so the request will usually succeed on a retry with exponential backoff; at https://api.uplinkswitch.com/v1 the gateway automatically retries eligible requests on another route and fails over to alternative hosts when available. Nothing about your key, balance or request body caused it. Anthropic's own error reference lists 529 as overloaded_error, "the API is temporarily overloaded", and warns it can happen when traffic is high across all users. The rest of this page covers what you receive through the gateway instead of a raw 529, how to tell it from a 402 or a 429, and a retry pattern that does not hammer a busy model.
What a direct 529 looks like
Per Anthropic's errors reference, every error is JSON with the same envelope: a top-level type of error, an error object holding a type and a message, and a request_id. The reference lists 529 as overloaded_error and 500 as api_error, an unexpected error inside Anthropic's systems, but prints no full 529 body, so treat the inner message as free text rather than a string to match. The one overload body Anthropic does print is in its streaming reference, where the error arrives as an event after a 200 has already started:
event: error
data: {"type": "error", "error": {"type": "overloaded_error", "message": "Overloaded"}}What you get through the gateway
The gateway never forwards a 529 status. When one route of a model answers overloaded, the request moves to the next route of that model, and then down any fallback list you sent, before a single byte has reached you. When no route is left that can answer, the refusal is HTTP 503 with the code upstream_unavailable. On the Messages endpoint it arrives in Anthropic's shape, whose type field reads overloaded_error:
{
"type": "error",
"error": {
"type": "overloaded_error",
"message": "The model is not answering right now. (upstream_unavailable)"
},
"request_id": "<request id>"
}The response carries a retry-after header, and nothing is charged for it. If instead the last route tried answered with a server error of its own, an upstream 529 included, the refusal is a 502 whose type is api_error and whose code is upstream_error, also with retry-after and also free. Handle the two alike: both mean every route failed this time. The code in parentheses is the stable part to match on; the sentence before it may be reworded.
529 is not 402 and not 429
The three look alike in a log line and need opposite responses.
| Status | Error type | Code in the message | What it means | Will a retry help? |
|---|---|---|---|---|
| 503 (529 direct) | overloaded_error | upstream_unavailable | Every route of the model is busy | Yes, after retry-after |
| 502 | api_error | upstream_error | The last route tried failed with a server error | Yes, after retry-after |
| 429 | rate_limit_error | rate_limited or upstream_rate_limited | Your key's own limit, or one busy route | Yes, after retry-after |
| 402 | billing_error | insufficient_balance or a limit code | The balance or a key limit is spent | No, top up or raise the limit |
A 402 retried in a loop stays a 402 until the balance changes, so never put it in the same retry branch as an overload.
Let the SDK retry first
Per the SDK's documentation, the Anthropic client already retries connection errors, 408, 409, 429 and every 5xx twice by default, with a short exponential backoff that honours retry-after. For a model under sustained load, raising that count is often the whole fix:
import anthropic
client = anthropic.Anthropic(
api_key="sk-uplink-live-...",
base_url="https://api.uplinkswitch.com/v1",
max_retries=5,
)On this gateway you can also hand the next choice to the server. A models list in the request body names up to five ids to try in order once every route of the first has failed, and the SDK sends it through extra_body:
msg = client.messages.create(
model="claude-sonnet-5-5",
max_tokens=512,
messages=[{"role": "user", "content": "Summarise this ticket in two lines."}],
extra_body={"models": ["deepseek-v4.1-flash"]},
)
print(msg.model) # the id that actually answered, and the one billedOn the 2026-11-23 catalog claude-sonnet-5-5 read ok and deepseek-v4.1-flash read ok; pick a fallback that also reads ok.
A manual retry, when you own the loop
If retries live in your own job runner, wait for the server's retry-after when it is present, and otherwise grow the wait each attempt. Stop after a fixed number of tries:
import time
import anthropic
client = anthropic.Anthropic(
api_key="sk-uplink-live-...",
base_url="https://api.uplinkswitch.com/v1",
max_retries=0, # this loop does the retrying
)
def create_with_backoff(**kwargs):
for attempt in range(5):
try:
return client.messages.create(**kwargs)
except anthropic.InternalServerError as e: # every status of 500 and above
wait = e.response.headers.get("retry-after")
time.sleep(float(wait) if wait else 2 ** attempt)
return client.messages.create(**kwargs)Catching InternalServerError alone leaves 402 and 400 errors to surface at once, which is what you want. Failover happens only before the first byte, so a stream already sending tokens cannot switch routes under you. Per Anthropic's streaming docs, a failure after that point arrives as an error event inside the 200; discard the partial text and retry the whole request. The LLM failover post explains where else that logic can live.