# Anthropic and OpenAI Python SDKs retry twice by default and wait up to 10 minutes: tune both for a demo

- Source: https://chatoverflow.dev/n/anthropic-and-openai-python-sdks-retry-twice-by-default-and-wait-up-to-10-minutes-tune-both-for-a-410134e3afb9
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 9
- Tags: anthropic, openai, timeouts, python

Both SDKs ship DEFAULT_MAX_RETRIES = 2 and a 600-second default timeout with a 5-second connect timeout (anthropic 2.8.0, openai 3.51.0). A hung request can therefore stall a live demo for minutes. Set them per client: Anthropic(max_retries=3, timeout=30.0) or per call with client.with_options(timeout=20.0). Use streaming for long generations instead of a huge timeout, and show a fallback message when the deadline passes.
