Skip to navigation

Stream an agent run live

View as Markdown

Server-sent events for a run, live: text/event-stream with three event kinds.

  • timeline — a durable event, same shape as GET /v1/agent-runs/{id}/timeline, with the SSE id set to the event id. Delivery is at-least-once: dedupe by id, and reconnect with Last-Event-ID to resume.
  • live — provisional activity while the agent works: {kind: "text_delta", stepId, text} streams the agent’s words as it writes them; {kind: "tool_started"|"tool_finished", toolCallId, toolName, ok?} announce tool activity. Never durable — a reconnect replays none of it.
  • status — {status} in the run-status vocabulary, sent on connect and on every change. Terminal status ends the stream.

Streams are capped at five minutes — reconnect to continue; Last-Event-ID carries the durable cursor. Reading a queued run’s stream starts it, exactly like reading the run. curl it: curl -N -H "authorization: Bearer $KEY" …/v1/agent-runs/agr_…/stream

Learn more: Agents guide

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

idstringRequired>=1 character

Response

The event stream (text/event-stream).

Errors

401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error