Error shape
Errors before the stream opens are JSON, in Anthropic’s shape:200
response:
Status codes
Why a workspace mismatch shows up as 404, not 403
Why a workspace mismatch shows up as 404, not 403
Agent lookup is scoped to the calling key’s workspace, and a miss is reported
the same way whether the agent doesn’t exist or lives somewhere you can’t see —
so no caller can probe for agent names in other workspaces. If you’re sure the
name is right, the key is almost always the problem.
Limits and timing
A long-running turn that is producing output or doing tool work stays alive; the
runtime only cancels a turn that has genuinely lost its network or exceeded the
ceiling. A turn cancelled that way keeps its resume pointer, so sending
"continue" on the same conversation picks up where it stopped.
Client configuration
- Set generous timeouts. Default HTTP client timeouts (30 s) will cut off normal agent work. Allow at least 10 minutes and read the stream incrementally.
- Disable buffering proxies. Any intermediary that buffers responses breaks
streaming. The endpoint sends
Cache-Control: no-cache, no-transform. - Retry on the conversation, not the request. Because a resumed turn appends
to durable history, a blind retry of a turn that partially succeeded can double
up work. Prefer sending a fresh instruction on the same
conversation_id. - Wait for the resume pointer between back-to-back turns. Sending the next message the moment a stream ends can resume a conversation before its session is recorded, and the agent loses the previous turn’s context silently. See Resuming.
Concurrency
Each conversation runs in one sandbox. Two simultaneous turns on the sameconversation_id share it and race on the transcript.