Email me

AI API errors / Anthropic (Claude)

Anthropic (Claude) · HTTP 504 · checked Oct 24, 2026

Anthropic 504 timeout_error: what it means and how to fix it

Retry: yes, with backoff
504 timeout_error

What it meansThe request took too long while processing. Long non-streaming requests with a large max_tokens are the usual cause.

How to fix it

  1. Stream the response for long outputs; the SDK can collect the stream into a final message for you.
  2. Use the Message Batches API for very long jobs.
  3. Enable TCP keep-alive if you call the API directly.

Is it down right now?

Check our live status page or the official one.

Retry it properly

import anthropic

# The SDK retries 429, 5xx and connection errors with exponential backoff and honors retry-after.
client = anthropic.Anthropic(max_retries=6)

try:
    msg = client.messages.create(model="claude-sonnet-5-5", max_tokens=1024,
                                 messages=[{"role": "user", "content": "Hello"}])
except anthropic.RateLimitError as e:      # 429 after all retries
    print("still rate limited", e.response.headers.get("retry-after"))
except anthropic.APIStatusError as e:      # 529 overloaded, 500, 504...
    print(e.status_code, e.response.headers.get("request-id"))

The official SDKs already retry connection errors, 429 and 5xx twice with exponential backoff and honor retry-after; raise max_retries for batch jobs.

Same kind of error at other providers

Other Anthropic (Claude) errors

Source

Paying too much per call while you are here? Compare AI model prices or estimate your bill.

Up next

Paste any errorEvery AI API error, retry or fixAnthropic, OpenAI and Gemini in one finder.Read it next →

Did this answer your question?

Up next

Get 3 picks for your job, volume and budgetPick an AI model for your jobLLM API pricing for 71 models per 1M tokens, checked at the source. Pick for me: your job, volume and budget give 3 models with the monthly cost. Filters, CSV.Read it next →

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Did this answer your question?

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ