Long prompts sometimes time out with a 504-style failure.
Why this happens
The client or an intermediary gave up before the response completed. Slow generation, network instability, and a timeout set to only a few seconds are common causes.
Answer 1: Raise the client timeout to a realistic value
from anthropic import Anthropic
client = Anthropic(timeout=60.0)
