Stream session events

GET/v1/sessions/{id}/events/stream
Backfills durable events after the cursor, emits a one-shot live frame at the end of backfill, then tails live events. from=live skips the backfill and opens at the head, which the live frame reports. Durable frames carry the event id as the SSE id for Last-Event-ID resume; ping frames are heartbeats.

Authorization

header

Authorization: Bearer <token>

An access token from Settings → Access tokens, with the scopes this call needs. Authentication

Path parameters

idstringrequired
TypeID with prefix "asess_".

Query parameters

afterstring
Return items after this cursor (numeric id, exclusive)
typesstring
Comma-separated event payload types to include (e.g. message.created,session.status), at most 64.
deltasstring | null
Include transient delta events (text/reasoning/tool-input deltas). Off by default.
Value in
"true" | "false"
fromstring | null
Open at the live head: the durable backfill is skipped and the live frame carries the head id. Wins over after and Last-Event-ID. Ignored with deltas=true, which needs the backfill to open by cursor.

Headers

last-event-idstring
Resume cursor sent by EventSource reconnects; takes precedence over after.

Responses

Successtext/event-stream

object