All interactions within a session are recorded as events and delivered in real time via Server-Sent Events (SSE) when subscribed to via the API.
Server-Sent Events
While an agent processes messages, the server pushes events of the following types:
| type | Description |
|---|---|
message | Assistant-generated message output; may be streamed in chunks (cumulatively ordered by sequence_number) |
tool_call / tool_call_output | Built-in tool invocation requests and their execution results |
mcp_call / mcp_call_output | MCP tool invocation requests and their execution results |
session_status | Session status change, including stop_reason (see Managing Sessions) |
Client-Sent Events
Send events to a session using POST /sessions/{session_id}/events.
| type | Description |
|---|---|
message | Sends a user message, triggering the agent to transition into the running state |
message event initiates agent processing. For full parameter details, see the Session API.
SSE Subscription
When sending a message event, include the header Accept: text/event-stream in your request. The response will then deliver all session events in real time using the SSE format. Without this header, the API returns the full list of events (requiring polling for incremental updates). See the Session API for details.
Event Filtering
In the Console’s Events panel, use the dropdown menu in the top-left corner to filter events by type. Supported filters include: All events, User, Agent, Tool, Tool_output, Error, Model, and System.
Next Steps
- Managing Sessions: Learn about the session state machine and tool invocation flow.
- Session API: Detailed documentation for the SSE event stream API.