Skip to content

529 overloaded_error

Cause: The Claude API is temporarily overloaded across all users, so it refused the request; nothing is wrong with your request or your limits.

Copy-paste fix

Retry briefly with jitter, then move to the next model in a fallback list instead of hammering the busy one.

import random, time
import anthropic

client = anthropic.Anthropic(max_retries=0)  # we handle retries here

def create_with_fallback(models, attempts_per_model=2, **kwargs):
    last = None
    for model in models:  # primary first, then fallbacks
        for attempt in range(attempts_per_model):
            try:
                return client.messages.create(model=model, **kwargs)
            except (anthropic.OverloadedError, anthropic.RateLimitError) as e:
                last = e
                time.sleep(random.uniform(0, 2 ** attempt))
    raise last

# models = [PRIMARY_MODEL, FALLBACK_MODEL]  # use exact ids from your provider

Compare the cost of your primary and fallback models on TokenCenter

What the error means

Anthropic's errors page lists 529 overloaded_error as “the API is temporarily overloaded” and says it can happen during high traffic across all users. In a streaming reply the same error can arrive as an event: error after a 200 response.

The Python SDK raises anthropic.OverloadedError for 529. OpenAI's equivalent is a 503 with code server_is_overloaded.

Checklist

  1. Keep at least one fallback model, tested with your prompts, ready in config.
  2. Retry overloads a few times only; then fall back or return a clear 'try again' to the user.
  3. Handle error events inside a stream, not just the HTTP status.
  4. Log which model finally answered so you can see how often you fall back.
  5. Check that the fallback model's context window fits your largest request.

Related

Sources

All guides · All errors