列出线程
先调用「创建会话」,用返回的会话 ID 替换示例 ID。
GET
/anthropic/v1/sessions/{session_id}/threads◐ 部分支持请求参数
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 格式返回,参见 错误码
请求示例
curl
# 先调用「创建会话」,用返回的会话 ID 替换示例 ID。
curl https://api.deepraxis.com/anthropic/v1/sessions/sesn_123/threads \
-H "x-api-key: $PRAXIS_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: managed-agents-2026-04-01"Python
# 先调用「创建会话」,用返回的会话 ID 替换示例 ID。
from anthropic import Anthropic
client = Anthropic(
base_url="https://api.deepraxis.com/anthropic",
api_key="$PRAXIS_API_KEY",
)
# 官方有、平台未支持:调用得到 501(not_implemented_error),无副作用。
result = client.beta.sessions.threads.list("sample_id_123")
print(result)TypeScript
// 先调用「创建会话」,用返回的会话 ID 替换示例 ID。
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://api.deepraxis.com/anthropic",
apiKey: "$PRAXIS_API_KEY",
});
// 官方有、平台未支持:调用得到 501(not_implemented_error),无副作用。
const result = await client.beta.sessions.threads.list("sample_id_123");
console.log(result);响应示例 200
{
"data": [
{
"id": "sthr_d72b90b27a414fe5885adff0ac6b9b96",
"type": "session_thread",
"parent_thread_id": null,
"session_id": "sesn_d72b90b27a414fe5885adff0ac6b9b96",
"agent": {
"id": "agent_57d15145-7ef6-4bd3-8b33-2b8ddca88ac0",
"type": "agent",
"name": "文档助手(已更新)",
"description": null,
"system": "用一句话简短回答。",
"model": {
"id": "deepseek-flash"
},
"version": 2,
"tools": [],
"skills": [],
"mcp_servers": []
},
"archived_at": null,
"created_at": "2026-09-26T07:16:14.796Z",
"updated_at": "2026-09-26T07:16:35.522Z",
"status": "idle",
"stats": null,
"usage": null
}
],
"next_page": null
}响应
HTTP 200
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Unique identifier for this thread. |
| data[].agent | object | The resolved agent a session_thread runs. |
| data[].archived_at | null | string | A timestamp in RFC 3339 format |
| data[].created_at | string | A timestamp in RFC 3339 format |
| data[].parent_thread_id | null | string | Parent thread that spawned this thread. Null for the primary thread. |
| data[].session_id | string | The session this thread belongs to. |
| data[].stats | null | object | Timing statistics for a session thread. |
| data[].status | string | SessionThreadStatus enum |
| data[].type | string | |
| data[].updated_at | string | A timestamp in RFC 3339 format |
| data[].usage | null | object | Cumulative token usage for a session thread across all turns. |
| next_page | string | null |