All Products
Search
Document Center

Qoder CN Series:Stream session events

Last Updated:Jul 03, 2026

Subscribe to a Forward session event stream with SSE.

Request headers

Header

Required

Description

Authorization

Yes

Bearer <PAT>

Accept

Yes

text/event-stream

Last-Event-ID

No

Resume after this Event ID.

Path parameters

Parameter

Type

Required

Description

session_id

string

Yes

Session ID.

Query parameters

Parameter

Type

Required

Default

Description

type

string

No

-

Filter by Event type. Comma-separated values are supported.

types[]

string

No

-

Array-style Event type filter.

include_tool_calls

boolean

No

true

Include tool call events.

include_thinking

boolean

No

true

Include thinking events.

Example request

curl -N -X GET 'https://api.qoder.com.cn/api/v1/forward/sessions/sess_xxx/events/stream?include_thinking=false' \
  -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"}

Incremental streaming example

When the Session was created with incremental_streaming_enabled=true, the stream can include incremental events before the final agent.message.

id: evt_start_xxx
event: agent.message_start
data: {"id":"evt_start_xxx","type":"agent.message_start","session_id":"sess_xxx","message_id":"msg_xxx","created_at":"2026-06-22T11:00:01Z"}

id: evt_delta_xxx
event: agent.content_block_delta
data: {"id":"evt_delta_xxx","type":"agent.content_block_delta","session_id":"sess_xxx","message_id":"msg_xxx","index":0,"delta":{"type":"text_delta","text":"Here"},"created_at":"2026-06-22T11:00:01Z"}

Response fields

Field

Description

id

SSE event ID. Equals the Event ID.

event

Event type.

data

Filtered Forward Event JSON.

Errors

HTTP

Type

Code

Trigger

400

invalid_request_error

invalid_event_cursor

Last-Event-ID does not belong to this Session.

401

authentication_error

TOKEN_INVALID

PAT invalid or expired.

404

not_found_error

session_not_found

Session does not exist.

Notes

  • Incremental streaming is controlled by the Session create request and cannot be enabled with 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-use events and recognizable tool input/output deltas.