AnthropicClaude 托管智能体

列出线程

列出一个会话的全部执行线程。

先调用「创建会话」,用返回的会话 ID 替换示例 ID。

GET /anthropic/v1/sessions/{session_id}/threads◐ 部分支持

Claude 官方文档 ↗

请求参数

  • session_idstring必填

    path: 会话 ID(路径或查询参数)。

  • limitnumber可选

    query: 每页返回的条数上限。

  • pagestring可选

    query: 分页游标,取自上一页响应的 next_page。

返回

200

按 created_at 升序返回主线程及全部子线程。线程 id 为 sthr_ 加所属会话 id 的后缀;子线程的 parent_thread_id 指向主线程,session_id 始终为父会话。agent 是实际运行的定义,内置类型的 name 为类型名,未注册的 id/version 为 null。归档子线程的 status 为 terminated,archived_at 为归档时间;stats/usage 无线程级追踪时如实为 null。

错误按 Claude Managed Agents 格式返回,参见 错误码

响应

HTTP 200

Successful response

application/json

名称类型说明
dataarray<object>
data[].idstringUnique identifier for this thread.
data[].agentobjectThe resolved agent a `session_thread` runs.
data[].archived_atnull | stringA timestamp in RFC 3339 format
data[].created_atstringA timestamp in RFC 3339 format
data[].parent_thread_idnull | stringParent thread that spawned this thread. Null for the primary thread.
data[].session_idstringThe session this thread belongs to.
data[].statsnull | objectTiming statistics for a session thread.
data[].statusstringSessionThreadStatus enum
data[].typestring
data[].updated_atstringA timestamp in RFC 3339 format
data[].usagenull | objectCumulative token usage for a session thread across all turns.
next_pagestring | null