Skip to main content
Sazabi streams agent run and thread events over Server-Sent Events (SSE). Use streaming to render an agent’s output as it is produced instead of polling for the final result.

Endpoints

Two GET endpoints return a text/event-stream response: Both use the same authentication as the rest of the API — a secret key in the Authorization header — and enforce the same visibility as the corresponding GET endpoints for the run or thread.

Consuming the stream

Each SSE frame carries one JSON event with a type field. Event types include run_started, message_started, text_chunk, text_complete, reasoning_progress, reasoning_complete, tool_call_start, tool_call_complete, artifact, and error. Reasoning text is never streamed or returned; the reasoning events only mark progress and completion. Handle unknown type values by ignoring them so new event types do not break your client. The stream ends with a [DONE] sentinel frame. When you have it, close the connection.

Resuming after a disconnect

If the connection drops, reconnect to the same endpoint with a cursor query parameter set to the position you last processed to resume without replaying the whole stream: