Skip to main content

Streaming Events

When Claude responds, content is streamed in real-time via sdk_message events. This page documents all streaming event types.

Event Flow

1

Client sends message

User message sent via sdk_message
2

Streaming Response

Server streams sdk_message events with text chunks. If Claude invokes a tool, a tool_use event is sent, followed by tool_call for execution. Client responds with tool_result, then streaming continues.
3

Result

Server sends final result event with complete response and usage stats

Text Events

Text content streamed as it’s generated:
Concatenate text fields to build the full response.

Thinking Events

Extended thinking content (when enabled):
Thinking events show Claude’s reasoning process. They’re separate from the main response.

Tool Use Events

When Claude decides to use a tool:

Tool Call Request

After a tool use event, the server sends a tool_call requesting execution:
The client must execute the tool and respond with tool_result.

Tool Result Response

Client sends tool execution result:

Success Result

Error Result

Image Result

Result Event

Final result after streaming completes:

Result Subtypes

Usage Fields

Error Events

Errors during streaming:

Event Handling Example

Multiple Tool Calls

Claude may call multiple tools in sequence:
Or in parallel (same response turn):
Handle both patterns in your client.