GET /api/v1/forward/sessions/{session_id}/events/stream
Streams session events as Server-Sent Events. The data payload uses the same Forward filtering model as the event history endpoint. New integrations that need streaming output should subscribe with event_deltas[].
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT or SAT> |
Accept | Yes | text/event-stream |
Last-Event-ID | No | Resume after this Event ID. |
X-Qoder-Beta | When subscribing to thinking deltas | Set to thinking-event-stream-delta-2026-07-20 when event_deltas[]=agent.thinking is requested. |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
session_id | string | Yes | Session ID. |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
event_deltas[] | string | No | - | Subscribe to streaming delta events for the specified public event types. Supports repeated parameters. Allowed values: agent.message, agent.thinking. See Event delta streaming. |
include_tool_calls | boolean | No | true | Include tool call events. |
include_thinking | boolean | No | true | Include thinking events. |
Example request
Example response
HTTP 200 OK
Event delta streaming example
When event_deltas[] is provided, the stream includes event_start and event_delta frames before the final buffered event:
Response fields
| Field | Description |
|---|---|
id | SSE event ID. Equals the Event ID. |
event | Event type. |
data | Filtered Forward Event JSON. Standard public events follow the Event type matrix documented by List Session Events; event delta stream frames follow Event delta streaming. |
Connection interruptions and reconnection
An SSE connection can close because of gateway timeouts, server restarts, or similar conditions. The server does not guarantee that a connection remains open indefinitely. Clients must implement their own reconnection and retry logic:
-
Continuously record the
idof the last SSE frame received. This is the Event ID. -
After a disconnect, reconnect with that ID in the
Last-Event-IDheader to resume from the last received Event and avoid missing Events. -
If a reconnect request omits
Last-Event-ID, delivery starts at the tail of the event stream at connection time. Only Events created after the connection is established are delivered; historical Events are not replayed. To retrieve Events created while disconnected, first query history through List Session Events, and then establish the SSE connection to continue streaming. -
Starting August 24, 2026, when a connection is established without
Last-Event-ID, the server starts delivering from the tail of the event stream at connection time and does not replay historical Events. Recommended integration: retrieve historical Events through paginated List Events requests, receive real-time Events through SSE, reconnect with the last received Event ID inLast-Event-ID, and process Events idempotently by Event ID.
Errors
| HTTP | Type | Code | Trigger |
|---|---|---|---|
| 404 | not_found_error | - | Last-Event-ID references an Event that does not exist or does not belong to this Session. |
| 401 | authentication_error | authentication_required | PAT or SAT invalid or expired. |
| 404 | not_found_error | session_not_found | Session does not exist. |
Notes
event_deltas[]is the recommended way to enable streaming; when this parameter is not provided, only standard public events are returned.- Incremental
agent.thinkingstreaming is a Beta feature. Requests subscribing to it must includeX-Qoder-Beta: thinking-event-stream-delta-2026-07-20; behavior may change during the Beta period. - After each model call completes, the stream emits a
span.model_request_endmodel usage event.model_usage.creditsis the incremental usage for that call. Readusage.total_creditsfrom Get Session for the cumulative Session usage; see Model usage events in the data structure documentation. - Unknown Event types are forwarded as envelope-only events when available.
include_thinking=falsefilters thinking events, legacy thinking deltas, and new streamagent.thinkingevent start signals anddelta.content.type=thinkingfragments.include_tool_calls=falsefilters tool-use events and legacy tool input/output deltas.

