stream: true to receive Anthropic-style event streams.
Use this when your client already expects message_start, content_block_delta, and message_stop events.
Enable Streaming
Event Lifecycle
Per the protocol tests, a normal text stream begins withmessage_start and ends with message_stop.
Tool Streaming
Tool argument deltas appear ascontent_block_delta with type: input_json_delta.
Thinking Streaming
Thinking-related data can appear before text blocks, includingsignature_delta events.
What to listen for
message_startfor the initial message frame and input usagecontent_block_startandcontent_block_deltafor text, tool, and thinking blocksmessage_deltafor stop reason and final output usagemessage_stopfor stream completion
Common mistakes
- assuming every
content_block_deltais text - ignoring
message_deltaand losing final usage information - treating Messages streams like chat chunks or Responses semantic events