Search across all documentation pages
6 pages in this section.
Understand the SSE event types Claude sends as tokens generate incrementally, and the mental model behind streaming responses from the Messages API.
Stream a response and print incremental token deltas as they arrive.
Render streamed text_delta events into a live-updating chat interface, from a terminal prototype to a backend endpoint a frontend can consume.
Accumulate input_json_delta events safely before parsing a streamed tool_use input, and avoid the partial-JSON parsing mistakes that crash agentic code.
Reference table for message_start, content_block_delta, message_delta, and message_stop events, their fields, and when each one fires.
Practices for buffering, error handling, and reconnecting dropped streaming connections in production Claude API code.