Anthropic API · sdk · fg-0476

SDK throws 'Streaming is required for operations that may take longer than 10 minutes' before sending

Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details

Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100

Cause

The SDKs estimate a non-streaming call's duration from max_tokens and refuse when it could pass 10 minutes. In the TypeScript SDK the estimate is 3600 times max_tokens divided by 128,000 seconds, so max_tokens above about 21,333 trips it, and some models set a lower non-streaming token cap.

Fix

Use the streaming helper and read the final message, or move long jobs to the Message Batches API. On old TypeScript SDKs set the timeout on the client rather than per request, or upgrade to 0.117.0 or later.

Apply

const msg = await client.messages.stream({ model, max_tokens: 64000, messages }).finalMessage();
# Python: with client.messages.stream(model=model, max_tokens=64000, messages=messages) as s: msg = s.get_final_message()

Affects: @anthropic-ai/sdk and anthropic Python SDK, non-streaming messages.create, as of 2026-10; request-level timeout fix in @anthropic-ai/sdk 0.117.0

Sources

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp