Archive Thread
Call Create session first and replace the example session ID with its returned ID.
POST
/anthropic/v1/sessions/{session_id}/threads/{thread_id}/archive◐ PartialOfficial Claude documentation ↗
Request parameters
session_idstringrequiredpath: Session ID (path or query parameter).
thread_idstringrequiredpath: Path parameter: the thread ID.
session_idstringrequiredquery: Session ID (path or query parameter).
Returns
200
Archiving the primary thread uses session archival. Archiving a child archives only that child session, leaving the parent and siblings intact. Archived children have status terminated and archived_at; their history remains readable.
Errors follow the Claude Managed Agents format — see error codes
Request
curl
# Call Create session first and replace the example session ID with its returned ID.
curl -X POST https://api.deepraxis.com/anthropic/v1/sessions/sesn_123/threads/sthr_123/archive \
-H "x-api-key: $PRAXIS_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: managed-agents-2026-04-01"Python
# Call Create session first and replace the example session ID with its returned 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.archive("thread_123", {"session_id": "sample_id_123"})
print(result)TypeScript
// Call Create session first and replace the example session ID with its returned 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.archive("thread_123", { session_id: "sample_id_123" });
console.log(result);Response 200
{
"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": "2026-09-26T07:16:50.754Z",
"created_at": "2026-09-26T07:16:14.796Z",
"updated_at": "2026-09-26T07:16:50.754Z",
"status": "idle",
"stats": null,
"usage": null
}Response
HTTP 200
Successful response
application/json
| Name | Type | Description |
|---|---|---|
| id | string | Unique identifier for this thread. |
| agent | object | The resolved agent a session_thread runs. |
| agent.model | string | object | The advisor model id. / Model identifier and configuration. |
| agent.type | string | |
| agent.id | string | |
| agent.description | null | string | |
| agent.mcp_servers | array<object> | |
| agent.name | string | |
| agent.skills | array<object> | |
| agent.system | null | string | |
| agent.tools | array<object> | |
| agent.version | number | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| parent_thread_id | null | string | Parent thread that spawned this thread. Null for the primary thread. |
| session_id | string | The session this thread belongs to. |
| stats | null | object | Timing statistics for a session thread. |
| stats.active_seconds | number | Cumulative time in seconds the thread spent actively running. Excludes idle time. |
| stats.duration_seconds | number | Elapsed time since thread creation in seconds. For archived threads, frozen at the final update. |
| stats.startup_seconds | number | Time in seconds for the thread to begin running. Zero for child threads, which start immediately. |
| status | string | SessionThreadStatus enum |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| usage | null | object | Cumulative token usage for a session thread across all turns. |
| usage.active_seconds | number | Cumulative time in seconds this thread spent in running status. Equal to stats.active_seconds; surfaced here so a thread's usage carries every quantity its cost is priced on. |
| usage.cache_creation | object | Prompt-cache creation token usage broken down by cache lifetime. |
| usage.cache_read_input_tokens | number | Total tokens read from prompt cache. |
| usage.input_tokens | number | Total input tokens consumed across all turns. |
| usage.list_cost | null | object | A monetary amount in a specific currency. |
| usage.output_tokens | number | Total output tokens generated across all turns. |
| usage.server_tool_use | null | object | Cumulative count of server-executed tool invocations, broken down by tool. |