Timeout error on a hung server: Python APITimeoutError 'Request timed out or interrupted...' (anthropic) vs 'Request timed out.' (openai); JS APIConnectionTimeoutError; timeouts are retried
Tested on Windows 11, Python 3.12.10, Node 24.18 against a local mock HTTP server on 127.0.0.1 with fake key test-key; installed versions were pip anthropic 2.8.0, pip openai 3.51.0, npm @anthropic-ai/sdk 1.8.0, npm openai 7.57.0 (all latest on 2026-11-14). Mock accepted the request and never replied. Python anthropic with timeout=0.5, max_retries=1: 2 attempts, 1.64 s total, anthropic.APITimeoutError: Request timed out or interrupted. This could be due to a network timeout, dropped connection, or request cancellation. (message continues with a docs link). Python openai timeout=0.5, max_retries=0: APITimeoutError: Request timed out. after 0.51 s. JS anthropic timeout 500, maxRetries 1: APIConnectionTimeoutError: Request timed out. after 1746 ms (2 attempts); JS openai the same class and message after 568 ms. Quirk seen at the mock: with timeout 500 ms JS sent x-stainless-timeout: 0 (rounded seconds) and Python sent the literal string NOT_GIVEN for that header.