通过 SSE 订阅单个 Thread 的事件流。
HTTP 200 OK
请求头
| Header | 是否必填 | 说明 |
|---|---|---|
| Authorization | 是 | Bearer <PAT> |
| Accept | 是 | text/event-stream |
| Last-Event-ID | 否 | 从该 Thread Event ID 之后恢复订阅。 |
路径参数
| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
session_id | string | 是 | Session ID。 |
thread_id | string | 是 | Thread ID。 |
查询参数
| 参数 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
type | string | 否 | - | 按 Event 类型过滤,支持逗号分隔。 |
types[] | string | 否 | - | 数组形式的 Event 类型过滤。 |
include_tool_calls | boolean | 否 | true | 是否包含工具调用类事件。 |
include_thinking | boolean | 否 | true | 是否包含思考过程事件。 |
示例请求
示例响应
HTTP 200 OK
响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | SSE event ID,等于 Event ID。 |
event | string | Event 类型。 |
data | object | 该 Thread 的过滤后 Forward Event JSON。 |
错误
| HTTP | Type | Code | 触发条件 |
|---|---|---|---|
| 400 | invalid_request_error | invalid_event_cursor | Last-Event-ID 不属于当前 Thread。 |
| 404 | not_found_error | session_not_found | Session 不存在。 |
| 404 | not_found_error | thread_not_found | Thread 不存在。 |
| 401 | authentication_error | authentication_required | PAT 无效或已过期。 |
备注
- Thread SSE 使用与 Session SSE 相同的字段级过滤策略。
- 未知 Event 类型可用时会降级为 envelope-only 事件。