Skip to main content
Events are how you talk to a running session. You post input events to send messages, tool results, and cancellations, and you subscribe to output events to watch progress live. Events are the live view; the stored record is in items and turns. For a walkthrough, see the streaming guide. Paths are relative to /v1.

Input event types

Behavior

A submitted message can start a turn; do not infer completion from the 204. Follow status events or retrieve turns. Closing a GET subscription does not cancel the turn. For SSE reconnection, send Last-Event-ID with a previously received event ID; the stream emits id, event, and JSON data fields. Treat IDs as opaque. Invalid cursors can return 400. A stream closes after 60 minutes, between events; reconnect with Last-Event-ID. A key or person can have 32 streams open at once and an organization 64; past that, opening one returns 429 rate_limit_exceeded. See streaming.

Output event names

The pinned event inventory records the following output type names, not full validated event payload definitions: For text, concatenate delta from agent.session.turn.output_text.delta; use agent.session.turn.completed or failed to decide a turn’s outcome. Handle event types you do not recognize without assuming this table is exhaustive. Stream failures may arrive as error events after HTTP headers have already succeeded; see Errors.