v1

latestOpenAPI 3.1.0MIT2026-08-0481194343.8 KB
runs

Stream run events (SSE)

Scope: runs:read. Free. An ordered at-least-once Server-Sent Events stream. Successfully persisted frames have an effectively unbounded replay window and resume with Last-Event-ID or ?after=<seq>. Intermediate appends are best-effort and can be absent after a transient storage failure; terminal status/done are transactionally admitted with Agent Run terminal state. The edge may rotate a connection after 300 seconds, so reconnect with the last sequence and reconcile authoritative state with GET /v1/runs/{run_id}.

A stream can close on any of THREE terminal frames, not just done:

  • event: done — the run reached a terminal state and the sentinel was delivered.
  • event: timeout with data: {"reason":"stream_max_duration"} — the server hit its own stream wall-clock ceiling. The RUN may still be going. Reconnect with the last sequence; do not treat this as a run outcome.
  • event: error with data: {"code":..., "message":...} — the event read failed. Reconnect with Last-Event-ID to replay from the cursor.

Each frame's data: field carries only the event's inner payload; seq is on the id: line and the event type is the event name. To read a finished run's whole trajectory as plain JSON, use GET /v1/runs/{run_id}/log instead.

get/v1/runs/{run_id}/events

Query parameters

afterinteger

Headers

Last-Event-IDinteger

Last processed SSE sequence number. Reconnect with this value to resume without gaps.

Response

SSE stream (text/event-stream).