mosoodocs
简体中文API Reference

流式读取 Thread 事件

以 Server-Sent Events 形式流式返回公开 Thread 事件日志条目。每个 `thread.event` data payload 都使用与 GET /threads/{threadId}/events 相同的 ThreadEventLogEntry 结构。

GET/threads/{threadId}/events/stream

以 Server-Sent Events 形式流式返回公开 Thread 事件日志条目。每个 thread.event data payload 都使用与 GET /threads/{threadId}/events 相同的 ThreadEventLogEntry 结构。事件按稳定事件 ID 发出,流会抑制轮询期间观察到的重复 ID。此流用于长时间运行的消费端体验,不会暴露原始运行时 payload、内部诊断信息或私有转写内容。

Authorization

publicApiBearer
AuthorizationBearer <token>

使用 Authorization: Bearer mst_...。API token 用于识别账号,不携带 scope。

In: header

Path Parameters

threadId*string

create thread 返回的 Thread ID。v1 ID 是不带前缀的 ULID。

Match^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$
Formatulid

Query Parameters

limit?integer

要返回的最新 Thread 事件数量上限。

Range1 <= value <= 1000
Default100

Response Body

text/event-stream

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/threads/01J00000000000000000000009/events/stream?limit=100"
": connected\n\nevent: thread.event\nid: 01J00000000000000000000010\ndata: {\"id\":\"01J00000000000000000000010\",\"runId\":\"01J0000000000000000000000A\",\"type\":\"run.started\",\"status\":\"available\",\"content\":\"01J0000000000000000000000A\",\"occurredAt\":\"2026-05-19T00:00:01.000Z\",\"durationMs\":null,\"tokens\":null}\n\n"
{  "error": {    "code": "agent_not_published",    "message": "string"  }}
{  "error": {    "code": "agent_not_published",    "message": "string"  }}
{  "error": {    "code": "agent_not_published",    "message": "string"  }}
{  "error": {    "code": "agent_not_published",    "message": "string"  }}
{  "error": {    "code": "agent_not_published",    "message": "string"  }}
{  "error": {    "code": "agent_not_published",    "message": "string"  }}
{  "error": {    "code": "agent_not_published",    "message": "string"  }}