Skip to main content

Stream session events

Subscribe to the Forward Session event stream via SSE.

Request Headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT>
AcceptYestext/event-stream
Last-Event-IDNoResume the subscription after this Event ID.

Path parameters

ParameterTypeRequiredDescription
session_idstringYesSession ID.

Query parameters

ParameterTypeRequiredDefaultDescription
typestringNo-Filter by Event type; comma-separated values are supported.
types[]stringNo-Array-form Event type filter.
include_tool_callsbooleanNotrueWhether to include tool call events.
include_thinkingbooleanNotrueWhether to include thinking events.

Example request

curl -s -X GET 'https://api.qoder.com.cn/api/v1/forward/sessions/sess_xxx/events/stream' \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Accept: text/event-stream"

Example response

HTTP 200 OK
id: evt_xxx
event: agent.message
data: {"id":"evt_xxx","type":"agent.message","session_id":"sess_xxx","content":[{"type":"text","text":"Here is the analysis result."}],"processed_at":"2026-06-22T11:00:03Z"}

Response Fields

FieldTypeDescription
idstringSSE event ID, equal to the Event ID.
eventstringEvent type.
dataobjectFiltered Forward Event JSON.

Errors

HTTPTypeCodeTrigger
400invalid_request_errorinvalid_event_cursorLast-Event-ID does not belong to the current Session.
404not_found_errorsession_not_foundSession does not exist.
401authentication_errorTOKEN_INVALIDPAT invalid or expired.

Notes

  • Incremental streaming is controlled by incremental_streaming_enabled at Session creation and cannot be temporarily enabled via this endpoint.
  • Unknown Event types are forwarded as envelope-only events when available.
  • include_thinking=false filters thinking events and recognizable thinking deltas.
  • include_tool_calls=false filters tool call events and recognizable tool input/output deltas.
  • Session and Event data structure
  • Create Session
  • List event history
Stream session events - Qoder CN