Update Session
Call Create session first and replace the example session ID with its returned ID.
/anthropic/v1/sessions/{session_id}◐ PartialOfficial Claude documentation ↗
Request parameters
session_idstringrequiredpath: Session ID (path or query parameter).
agentobjectoptionalThe agent to run: an agent ID string, or an object {type, id, version?} (see subfields); the operation description says how the version is chosen and which overrides apply.
Expand sub-fields (2)
mcp_serversarrayoptional○ UnsupportedInline mcp_servers overrides are not supported and return 400; update the agent version instead.
toolsarrayoptional○ UnsupportedInline tools overrides are not supported and return 400; update the agent version instead.
budgetobjectoptionalA hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches
max_list_cost.Expand sub-fields (2)
max_list_costobjectrequiredLargest list-price cost the session may reach: {amount, currency: "USD"} where amount is in US dollars, an integer or up to 2 decimals on input ("0.50") and exactly 2 decimals on output ("20.00").
typestringrequiredBudget kind; always limit. Any other value, including max_list_cost, returns 400.
metadataobjectoptionalMetadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve.
titlestringoptionalHuman-readable session title.
vault_idsarrayoptionalVault IDs (
vlt_*) to attach to the session. Not yet supported; requests setting this field are rejected. Reserved for future use.
Returns
200
Supports title and metadata with the official patch semantics: a string value upserts the key, null deletes it, a whole-null object clears the bag, and untouched keys are preserved. The official agent override (tools/mcp_servers), budget are not supported and return 400 naming the field. Updating an archived session returns 409. Supports vault_ids, up to 50, owned by the current organization and not archived; secrets reach the session's machine as environment variables and are matched against its MCP servers.
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 https://api.deepraxis.com/anthropic/v1/sessions/sesn_123 \
-H "x-api-key: $PRAXIS_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: managed-agents-2026-04-01" \
-H "Content-Type: application/json" \
-d '{"title":"文档测试(已更新)","metadata":{"owner":"docs"}}'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.update("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.update("sample_id_123", {});
console.log(result);Response 200
{
"id": "sesn_d72b90b27a414fe5885adff0ac6b9b96",
"type": "session",
"agent": {
"id": "agent_57d15145-7ef6-4bd3-8b33-2b8ddca88ac0",
"type": "agent",
"name": "文档助手(已更新)",
"description": null,
"system": "用一句话简短回答。",
"model": {
"id": "deepseek-flash"
},
"version": 2,
"tools": [],
"skills": [],
"mcp_servers": [],
"multiagent": null
},
"environment_id": "env_deepraxis_text_v1",
"title": "文档测试(已更新)",
"metadata": {
"owner": "docs"
},
"created_at": "2026-09-26T07:16:14.796Z",
"updated_at": "2026-09-26T07:16:25.349Z",
"archived_at": null,
"status": "idle",
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"cache_read_input_tokens": 0,
"list_cost": null
},
"stats": {},
"budget": null,
"resources": [],
"vault_ids": [],
"outcome_evaluations": [],
"deployment_id": null
}Response
HTTP 200
Successful response
application/json
| Name | Type | Description |
|---|---|---|
| id | string | |
| agent | object | Resolved agent definition for a session. Snapshot of the agent at session creation time. |
| agent.id | string | |
| agent.description | null | string | |
| agent.mcp_servers | array<object> | |
| agent.model | object | Model identifier and configuration. |
| agent.multiagent | null | object | Resolved coordinator topology with full agent definitions for each roster member. |
| agent.name | string | |
| agent.skills | array<object> | |
| agent.system | null | string | |
| agent.tools | array<object> | |
| agent.type | string | |
| agent.version | number | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches max_list_cost. |
| budget.max_list_cost | object | A monetary amount in a specific currency. |
| budget.type | string | |
| created_at | string | A timestamp in RFC 3339 format |
| environment_id | string | |
| metadata | object | |
| outcome_evaluations | array<object> | Per-outcome evaluation state. One entry per define_outcome event sent to the session. |
| outcome_evaluations[].completed_at | null | string | A timestamp in RFC 3339 format |
| outcome_evaluations[].description | string | What the agent should produce. |
| outcome_evaluations[].explanation | null | string | Grader's verdict text from the most recent evaluation. For satisfied, explains why criteria are met; for needs_revision (intermediate), what's missing; for failed, why unrecoverable. |
| outcome_evaluations[].iteration | number | 0-indexed revision cycle the outcome is currently on. |
| outcome_evaluations[].outcome_id | string | Server-generated outc_ ID for this outcome. |
| outcome_evaluations[].result | string | Current evaluation state. pending before the agent begins work; running while producing or revising; evaluating while the grader scores; satisfied/max_iterations_reached/failed/interrupted are terminal. |
| outcome_evaluations[].type | string | |
| resources | array<object> | |
| resources[].id | string | |
| resources[].created_at | string | A timestamp in RFC 3339 format |
| resources[].mount_path | string | null | string | Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only. |
| resources[].type | string | |
| resources[].updated_at | string | A timestamp in RFC 3339 format |
| resources[].url | string | |
| resources[].checkout | null | object | |
| resources[].file_id | string | |
| resources[].memory_store_id | string | The memory store ID (memstore_...). Must belong to the caller's organization and workspace. |
| resources[].access | null | string | Access mode for an attached memory store. |
| resources[].description | string | Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description. |
| resources[].instructions | null | string | Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. |
| resources[].name | null | string | Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource. |
| stats | object | Timing statistics for a session. |
| stats.active_seconds | number | Cumulative time in seconds the session spent in running status. Excludes idle time. |
| stats.duration_seconds | number | Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update. |
| status | string | SessionStatus enum - rescheduling - Transient error occurred, retrying automatically. - running - Agent is actively executing. - idle - Agent is waiting for input, including user messages or tool confirmations. Sessions start in idle. - terminated - Session has ended, either due to an error or completion. |
| title | null | string | |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| usage | object | Cumulative token usage for a session across all turns. |
| usage.active_seconds | number | Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once, unlike stats.active_seconds, which sums each thread's own active time. This is the duration the session's runtime 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 | Session total list-price cost as an integer string in US cents. Includes model cost and all charged products attributed to this session. The budget reads the same total; in-flight work may finish after the limit is reached. |
| 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. |
| vault_ids | array<string> | Vault IDs attached to the session at creation. Empty when no vaults were supplied. |
| deployment_id | null | string | Deployment ID when the session was created from a deployment reference. Null otherwise. |