Stream public Session events over Server-Sent Events.
GET /api/v1/cloud/sessions/{session_id}/events/stream
Streams public Session events as Server-Sent Events.
Path parameters
| Parameter | Type | Description |
|---|---|---|
session_id | string | Session ID with the sess_ prefix |
Query parameters
| Parameter | Type | Description |
|---|---|---|
event_deltas[] | string | Optional, repeatable. Allowed values are agent.message and agent.thinking. Selects event types to stream incrementally on this connection. |
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer $QODER_ACCESS_TOKEN |
Accept | No | Use text/event-stream |
Last-Event-ID | No | Resumes after the specified buffered event ID. When it equals an in-progress event delta ID, historical deltas for that event are skipped and only future output is sent. |
Example request
Response
The response uses text/event-stream. Each data: payload is one of:
- a complete public Event object, called a buffered event below, which is recorded in Session event history and includes an SSE
id:cursor; - a stream-only event delta frame, whose SSE
id:is the ID of the event being streamed.
Stream format
Each event is emitted with standard SSE fields:
: heartbeat comment lines periodically to keep the connection alive.
Event delta frames
Incremental agent.message output emits event_start followed by one or more event_delta frames. Incremental agent.thinking output emits only event_start.
id: is the ID of the event being streamed. Its JSON payload does not include top-level id or processed_at fields. Event delta frames do not appear in list/history responses. Retained deltas are available for reconnect only while the event is still in progress; after the buffered agent.message is written, historical deltas are no longer replayed.
Reconnection
For normal buffered events, Last-Event-ID resumes after the specified event. An in-progress incrementally streamed event has additional behavior because its event_start, all event_delta frames, and final buffered event share one ID:
- A cursor before the current
event_startreplays its retained start and historical deltas while generation is still in progress. - A cursor equal to the in-progress event ID skips its historical deltas and receives only future deltas and the final buffered event.
- After generation completes, reconnecting from an earlier buffered event returns the final
agent.message, not historical deltas.
event_start and reprocess frames keyed by their shared event ID. See SSE Event Stream for the complete client guidance.
Errors
| HTTP | Type | Trigger |
|---|---|---|
| 400 | invalid_request_error | Last-Event-ID identifies an archived or non-public event, or event_deltas[] contains an unsupported value |
| 401 | authentication_error | PAT or SAT invalid or expired |
| 404 | not_found_error | Session or the event referenced by Last-Event-ID does not exist |