Agent API

2026-10-22

Agent API

Agent runs versioned agents and conversations through /agent/v1. Concepts and behavior follow Anthropic Managed Agents (agents, environments, sessions and events), so Anthropic Managed Agents experience applies. Differences: omitting environment_id selects a light machine unless a Computer is selected, and self-hosted environments are unavailable; the native toolset includes codemode, Skill and subagents, while /anthropic/v1 sessions expose only the eight official tools; nonempty skills attachments and custom tools are rejected; native events include steering, withdrawal, notifications, forks and goals, with remembered permissions and question answers on approvals. Start with praxis.agent.agents.create, then open a session and read its events for the result.

Base URL

Loading…

Get started

Loading…

See Agent for the domain overview; see Authentication for how keys work.

Endpoints

Computers (10 endpoints, 10 available)

MethodPathDescriptionSupport
POST/v1/computersComputersCreate● Supported
GET/v1/computersComputersList● Supported
GET/v1/computers/{computer_id}ComputersRetrieve● Supported
POST/v1/computers/{computer_id}ComputersUpdate● Supported
POST/v1/computers/{computer_id}/archiveComputersArchive● Supported
DELETE/v1/computers/{computer_id}Delete Archived Computer● Supported
GET/v1/computers/{computer_id}/filesComputersFilesList● Supported
GET/v1/computers/{computer_id}/files/contentComputersFilesContent● Supported
POST/v1/computers/{computer_id}/connectConnect computer● Supported
POST/v1/computers/{computer_id}/attachmentsUpload Computer Attachment● Supported

Session resources (4 endpoints, 4 available)

MethodPathDescriptionSupport
POST/v1/sessions/{session_id}/resourcesAdd Session Resource◐ Partial
GET/v1/sessions/{session_id}/resourcesList Session Resources◐ Partial
GET/v1/sessions/{session_id}/resources/{resource_id}Get Session Resource◐ Partial
DELETE/v1/sessions/{session_id}/resources/{resource_id}Delete Session Resource◐ Partial

Agents (6 endpoints, 6 available)

MethodPathDescriptionSupport
GET/v1/agentsList Agents● Supported
POST/v1/agentsCreate Agent◐ Partial
GET/v1/agents/{agent_id}Get Agent● Supported
POST/v1/agents/{agent_id}Update Agent◐ Partial
GET/v1/agents/{agent_id}/versionsList Agent Versions● Supported
POST/v1/agents/{agent_id}/archiveArchive Agent● Supported

Sessions & events (16 endpoints, 16 available)

MethodPathDescriptionSupport
GET/v1/sessionsList Sessions◐ Partial
POST/v1/sessionsCreate Session◐ Partial
GET/v1/sessions/{session_id}Get Session● Supported
POST/v1/sessions/{session_id}/forkFork Session (Extension)● Supported
GET/v1/sessions/{session_id}/contextGet Session Context (Extension)● Supported
GET/v1/sessions/{session_id}/background_tasksList Session Background Tasks (Extension)● Supported
GET/v1/sessions/{session_id}/background_tasks/{task_id}/outputGet Background Task Output (Extension)● Supported
POST/v1/sessions/{session_id}/background_tasks/{task_id}/stopStop Background Task (Extension)● Supported
POST/v1/sessions/{session_id}/compactCompact Session (Extension)● Supported
GET/v1/sessions/{session_id}/compact/{operation_id}Get Session Compaction (Extension)● Supported
GET/v1/sessions/{session_id}/compactionsList Session Compactions (Extension)● Supported
GET/v1/sessions/{session_id}/eventsList Events● Supported
POST/v1/sessions/{session_id}/eventsSend Events◐ Partial
GET/v1/sessions/{session_id}/events/streamStream Events◐ Partial
POST/v1/sessions/{session_id}Update Session◐ Partial
POST/v1/sessions/{session_id}/archiveArchive Session● Supported

Session threads (5 endpoints, 5 available)

MethodPathDescriptionSupport
GET/v1/sessions/{session_id}/threadsList Threads◐ Partial
GET/v1/sessions/{session_id}/threads/{thread_id}Get Thread◐ Partial
GET/v1/sessions/{session_id}/threads/{thread_id}/eventsList Thread Events◐ Partial
GET/v1/sessions/{session_id}/threads/{thread_id}/streamStream Thread Events◐ Partial
POST/v1/sessions/{session_id}/threads/{thread_id}/archiveArchive Thread◐ Partial

Environments (5 endpoints, 5 available)

MethodPathDescriptionSupport
POST/v1/environmentsCreate Environment◐ Partial
POST/v1/environments/{environment_id}Update Environment◐ Partial
POST/v1/environments/{environment_id}/archiveArchive Environment◐ Partial
GET/v1/environmentsList Environments◐ Partial
GET/v1/environments/{environment_id}Get Environment◐ Partial

Toolsets (1 endpoints, 1 available)

MethodPathDescriptionSupport
GET/v1/toolsetsList Toolsets● Supported

Differences from Claude Managed Agents

  • This face declares only the 30 listed endpoints, including the toolset catalog, context snapshot, compaction operations and background tasks: the other official Managed Agents operations are not on this face and answer 404. For Anthropic-protocol compatible access use the /anthropic compat face, where operations the platform has not implemented answer 501 (not_implemented_error) with no side effects.
  • Create Environment:Supports tenant-owned cloud environments, configuration updates and soft archival; built-ins are read-only. Lists accept limit, page and include_archived. Limited networking applies at sandbox creation; package installation failure terminates the session with ENVIRONMENT_PACKAGE_INSTALL_FAILED. self_hosted, scope and cross-session package caching are not supported.
  • Update Environment:Supports tenant-owned cloud environments, configuration updates and soft archival; built-ins are read-only. Lists accept limit, page and include_archived. Limited networking applies at sandbox creation; package installation failure terminates the session with ENVIRONMENT_PACKAGE_INSTALL_FAILED. self_hosted, scope and cross-session package caching are not supported.
  • Archive Environment:Supports tenant-owned cloud environments, configuration updates and soft archival; built-ins are read-only. Lists accept limit, page and include_archived. Limited networking applies at sandbox creation; package installation failure terminates the session with ENVIRONMENT_PACKAGE_INSTALL_FAILED. self_hosted, scope and cross-session package caching are not supported.
  • ComputersCreate:Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
  • ComputersList:Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
  • ComputersRetrieve:Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
  • ComputersUpdate:Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
  • ComputersArchive:Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
  • Delete Archived Computer:Own-face superset: Managed Agents has no persistent Computer deletion lifecycle. Only archived computers can be deleted. Active computers return 400 COMPUTER_ACTIVE (archive first). Destroy storage before removing registration. Success returns id and type=computer_deleted; missing or foreign computers return 404.
  • ComputersFilesList:Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
  • ComputersFilesContent:Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
  • Connect computer:Own-face extension: Managed Agents has no persistent Computer connection. Returns the public SDK sandbox_id, envd_access_token and template_id. Archived computers remain accessible; foreign or absent computers return 404. Never cache credentials.
  • Upload Computer Attachment:Own-face superset: Managed Agents has no persistent Computer attachment directory. User uploads overwrite the same name; agents retain read-only access. Run-token uploads return 403 READ_ONLY. name is one filename of at most 255 UTF-8 bytes; MIME is inferred from the extension; custom Content-Type is not persisted and digest may be absent. Limit 16 MiB (413); invalid names return 400. Archived computers accept uploads; foreign computers return 404.
  • Add Session Resource:Supports persistence, retrieval and removal of file resource references, up to 500 per session. Files must be live and owned by the current tenant. Paths default to /mnt/session/uploads/<file_id>; custom paths are rooted there and parent traversal is rejected. File content is immutable through this API. Sandbox synchronization is not implemented in this batch.
  • List Session Resources:Supports persistence, retrieval and removal of file resource references, up to 500 per session. Files must be live and owned by the current tenant. Paths default to /mnt/session/uploads/<file_id>; custom paths are rooted there and parent traversal is rejected. File content is immutable through this API. Sandbox synchronization is not implemented in this batch.
  • Get Session Resource:Supports persistence, retrieval and removal of file resource references, up to 500 per session. Files must be live and owned by the current tenant. Paths default to /mnt/session/uploads/<file_id>; custom paths are rooted there and parent traversal is rejected. File content is immutable through this API. Sandbox synchronization is not implemented in this batch.
  • Delete Session Resource:Supports persistence, retrieval and removal of file resource references, up to 500 per session. Files must be live and owned by the current tenant. Paths default to /mnt/session/uploads/<file_id>; custom paths are rooted there and parent traversal is rejected. File content is immutable through this API. Sandbox synchronization is not implemented in this batch.
  • Create Agent:agent_toolset_20260401 is the native toolset: bash, edit, glob, grep, read, write, web_search, web_fetch, TaskOutput, TaskStop, Monitor, Agent and SendMessage. New agents enable all tools by default. Configure each tool through name, enabled and permission_policy in configs; omitted tools follow default_config (enabled by default). Background tasks, Monitor and subagents require bash. Enabling any background tool exposes bash run_in_background. The /anthropic compatibility API accepts and returns only the eight official tools, and sessions created there receive only those tools. Supports text prompts, models, metadata and built-in tools. Optional model.settings.reasoning accepts low, medium, high, xhigh or none as the session default. Explicit session thinking takes precedence; unsupported agent defaults fall back to the model default_effort. Example model: {id: "deepseek-v4-flash", settings: {reasoning: "high"}}. Skills and other additional model controls are not supported and return 400. Set up to 100 allow, ask and deny rules in toolset permissions for future conversations. multiagent accepts null or a coordinator roster of 1–20 agent IDs, {type:"agent",id,version?} references or at most one {type:"self"}. Versions are pinned on create/update. Members must be distinct, exist, be unarchived and have no multiagent topology. A roster can enable Agent while bash is enabled; SendMessage follows its tool configuration. Each coordinator permits at most one advisor whose model must be available and differ from the agent model; only the primary session can consult it, each consultation uses a separate advisor thread, and advice returns via agent.thread_message_received. The /agent/v1 top-level subagent_model is a nullable model ID stored in each revision: omit to preserve, null to clear. The model must exist. Priority: call model > subagent_model > roster member model (parent session model for built-ins). /anthropic neither accepts nor returns this field.
  • Get Agent:tools returns all resolved native tool configurations in one agent_toolset_20260401 entry, ready for an update round trip. Replace example resource IDs with IDs from resources you created.
  • Update Agent:Use agent_toolset_20260401.configs to enable each native tool and set its permission policy. Omitted tools follow default_config; background tasks, Monitor and subagents require bash. Use version for optimistic concurrency; conflicts return 409 and unchanged updates preserve the version. Skills are not supported. Update toolset permissions to save allowed operations in a new agent version for future conversations. multiagent accepts null or a coordinator roster of 1–20 agent IDs, {type:"agent",id,version?} references or at most one {type:"self"}. Versions are pinned on create/update. Members must be distinct, exist, be unarchived and have no multiagent topology. A roster can enable Agent while bash is enabled; SendMessage follows its tool configuration. Each coordinator permits at most one advisor whose model must be available and differ from the agent model; only the primary session can consult it, each consultation uses a separate advisor thread, and advice returns via agent.thread_message_received. The /agent/v1 top-level subagent_model is a nullable model ID stored in each revision: omit to preserve, null to clear. The model must exist. Priority: call model > subagent_model > roster member model (parent session model for built-ins). /anthropic neither accepts nor returns this field.
  • List Agent Versions:Replace example resource IDs with IDs from resources you created.
  • Archive Agent:Archived agents remain readable, including versions, but cannot be updated. Only archive your own test agent.
  • List Sessions:Supports limit, page and agent_id. agent_version, time ranges, deployment_id, memory_store_id, include_archived, order and statuses are not supported and return 400.
  • Create Session:Create with optional model (an ID string in models.allowed; only the default if no list) and thinking ({effort: "low|medium|high|xhigh|none"} or null), saved before initial_events execute. Omitted or null thinking inherits the agent default, then the model default. Efforts must be in model.thinking.efforts; none requires can_disable. Invalid selections return 400 invalid_request_error. The response includes thinking and model.thinking: {efforts, can_disable, default_effort}; unknown capability and an unspecified default_effort are null. Example: {"agent":"agent_123", "model":"deepseek-v4-flash","thinking":{"effort":"xhigh"}}. These selection fields belong only to /agent/v1. Create an agent first and replace agent_123 with its returned id. Omit environment_id to get a light machine, unless an explicit or agent-default computer_id selects a Computer. Select node22 or a tenant-owned cloud environment for a sandbox recipe. Responses omit environment_id when no recipe is selected. Inline agent overrides, budgets and vaults are not supported. File resources are persisted, up to 500 per session; sandbox synchronization is not implemented in this batch.
  • Get Session:Replace example resource IDs with IDs from resources you created.
  • Fork Session (Extension):Available only on /agent/v1. Use the message_id field from own-face events, not the event id. Copies every message and part through the target, including tool calls and results. The parent is unchanged; another running turn does not prevent forking an earlier completed turn. The new root session appears in the session list with the same agent version, current model and thinking settings, and cwd working directory. Its title is the parent title plus “ 的分支”. If the parent has a sandbox, the new session owns an independent fork including a memory snapshot. Inherited running tasks are terminated, ring targets are replaced with the new session only, and its background-task table starts empty. Without a parent sandbox, creation remains lazy. Returns 201 with the same Session shape as retrieval. forked_from is {session_id, message_id}, or null for ordinary sessions. Imported history ends with session.forked containing forked_from_session_id and forked_from_message_id. These fields and this event are own-face only. Invalid requests return 400; ineligible targets return 409 FORK_TARGET_INVALID; missing sessions or sessions belonging to another caller return 404. Initialization failures leave the child unpublished and reclaim the forked sandbox.
  • Get Session Context (Extension):Praxis extension available only on /agent/v1, following Claude Agent SDK getContextUsage() with snake_case fields. detail is summary: the latest actual model usage takes precedence, and local estimates apportion source totals; used categories sum to total_tokens. Only nonzero sources appear. Classify rows by kind (used/free/buffer/deferred). key is a stable source identifier extension; clients must tolerate unknown keys and new sources, falling back to name. MCP tools group by server, plugin blocks by id, and compaction summaries are counted separately. excluded_items is currently zero. Before measurement, total_tokens, total_tokens_source and measured_at are null, categories is empty, and details are zero or empty arrays. Model selection recalculates max_tokens, auto_compact_threshold and free/buffer while preserving the latest measurement. is_auto_compact_enabled is false for unknown capacity or a tripped compaction breaker. For example model.thinking is {efforts: [high, xhigh], can_disable: true, default_effort: high}. model.thinking contains efforts, can_disable and nullable default_effort; the entire thinking value is null when capability is unknown. Missing or inaccessible sessions return 404.
  • List Session Background Tasks (Extension):Own-face extension. Returns { data: BackgroundTask[] }. Each task has id, kind, title, thread_id, status, started_at, ended_at, cancellable, notified_at and trigger_count. Subagent rows link to their child thread via thread_id; other kinds have null. kind is an open string; tolerate unknown kinds. Status is running, result_pending, completed, failed, cancelled or lost. Only completed tasks with pending delivery are result_pending. Timestamps are RFC3339; ended_at is null while running. notified_at is the admission time of the latest system notification batch, or null. trigger_count counts admitted monitor event batches, or is null without records and for other kinds. Only supported running tasks without stop intent are cancellable. Missing or inaccessible sessions return 404.
  • Get Background Task Output (Extension):Own-face extension. offset defaults to 0; max_bytes defaults to 65536 and must be between 1 and 262144. Returns text, next_offset and eof. Offsets count UTF-8 bytes, not characters; partial trailing characters are retained for the next read. eof describes the current log, which may grow while running. A paused or missing sandbox returns empty text, the original offset, eof=true and unavailable=true, without waking it. Reading does not acknowledge model result delivery. Missing or inaccessible sessions or tasks return 404; invalid ranges return 400.
  • Stop Background Task (Extension):Own-face extension. No request body is required. Uses the same stop implementation as TaskStop: records stop_requested_at and signals the process group. Returns BackgroundTask with the same fields as the list operation. Until termination is observed, status may remain running with cancellable=false. An ended or unsupported task returns 409. Missing or inaccessible sessions or tasks return 404.
  • Compact Session (Extension):Available only on /agent/v1. The body may be omitted or {}. Optional instructions must be a string and is forwarded unchanged. Idempotency-Key is forwarded unchanged; a UUID is generated when absent. Returns { type: session_compaction, id, status, reason? }, where id is the operation ID. queued/running return 202; skipped/succeeded/failed return 200. Non-string instructions return 400 invalid_request_error. Missing or inaccessible managed sessions return 404 not_found_error.
  • Get Session Compaction (Extension):Available only on /agent/v1. Returns { type: session_compaction, id, status, reason? } with HTTP 200 for every status. A missing operation or inaccessible session returns 404 not_found_error.
  • List Session Compactions (Extension):Available only on /agent/v1. Returns { data: [...] }. Each entry contains type, id, event_id, trigger, status, model, compacted_message_count, input_tokens_before, input_tokens_after, summary, error and created_at, as recorded by the service. Missing or inaccessible managed sessions return 404 not_found_error.
  • List Events:Send a message before reading history. Until processing finishes, only admitted input may be visible. Pagination, event type and time filters are supported. A session waiting for tool approval pauses on session.status_idle with stop_reason requires_action, whose event_ids list the agent.tool_use events to confirm. A failed run emits session.error before session.status_terminated. agent.thinking carries the thinking text in content. When searching or reading web pages, tool results use official search_result blocks on both API surfaces. Answer text blocks carry citations as an /agent/v1 extension; /anthropic renders answer references as [n] in the text.
  • Send Events:Each user.message accepts exactly one nonempty text block. Replace sesn_123 with your session id. Text user.message, user.interrupt and tool confirmation are supported. To guide a running turn, send a user.steer event with event_id referencing a queued user.message. Current tools continue; the message enters the next model request. The user.steer receipt has its own processed_at; repeated marking returns the same receipt. Processing or withdrawn inputs return 409; missing events return 404. Pending approvals defer injection. If the turn ends first, the input runs normally from the queue. Ordinary messages remain queued by default. This extension is unavailable on /anthropic. The response acknowledges inputs; read replies from event history or the stream. A user.message sent while the session waits for tool approval is queued: the returned event has processed_at null and runs in order once the approval is resolved. When allowing a tool call, copy its permission_suggestions into updated_permissions to remember similar operations for this conversation; dangerous operations offer no suggestions to remember. When searching or reading web pages, tool results use official search_result blocks on both API surfaces. Answer text blocks carry citations as an /agent/v1 extension; /anthropic renders answer references as [n] in the text.
  • Stream Events:Keep the SSE connection open and send a message in another request after replacing sesn_123. Stopping the stream disconnects the subscription, not the agent. SDK 0.124.0 filters session.usage; read history for full usage. Pass event_deltas[]=agent.message or event_deltas[]=agent.thinking to receive incremental previews (event_start and event_delta) before the final event. Pass event_deltas[]=agent.tool_use to receive input_json_delta fragments while tool arguments are being generated. When searching or reading web pages, tool results use official search_result blocks on both API surfaces. Answer text blocks carry citations as an /agent/v1 extension; /anthropic renders answer references as [n] in the text.
  • Update Session:Optional model is an ID in the pinned version allowed list; thinking is {effort: "low|medium|high|xhigh|none"} or null. Omission preserves the selection; null restores inheritance. A model-only change clears unsupported session thinking. Combined updates validate against the new model; invalid choices return 400 and preserve the previous selection. Changes affect the next turn, not an in-flight turn. Example: {"model":"deepseek-v4-flash","thinking":{"effort":"xhigh"}}. Responses include thinking and model.thinking: {efforts, can_disable, default_effort}; unknown capability is null. These fields are available only on /agent/v1. 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 and vault_ids are not supported and return 400 naming the field. Updating an archived session returns 409.
  • Archive Session:Archived sessions refuse new messages with 400 invalid_request_error naming the archived session; retrieval and event history stay readable. Re-archiving is idempotent and archived_at keeps the first archive time.
  • List Threads:Returns the primary thread and every child thread in created_at order. Thread ids use sthr_ plus the owning session suffix; children reference the primary parent_thread_id and retain the parent session_id. agent describes the actual running definition; built-in types use their type name and null for unregistered id/version. Archived children have status terminated and archived_at. stats/usage remain null without thread-level tracking.
  • Get Thread:Returns a primary or child thread belonging to this session, field-for-field identical to its list item. Foreign, unknown and malformed thread ids uniformly return 404 without revealing existence.
  • List Thread Events:Reads the selected thread ledger: the primary session for the primary thread, or the child session for a child thread. Uses the session event query parameters, public event types and data + next_page envelope. Web tools return search_result blocks on both APIs; answer citations are an /agent/v1 extension, rendered as [n] on /anthropic.
  • Stream Thread Events:Subscribes to the selected thread live ledger using the session SSE implementation; the /agent API also supports a read-only WebSocket. The parent stream includes child creation, status and message events. Child approvals carry session_thread_id; confirmations and interrupts targeting that id are routed to the owned child.
  • Archive Thread: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.
  • List Environments:Supports tenant-owned cloud environments, configuration updates and soft archival; built-ins are read-only. Lists accept limit, page and include_archived. Limited networking applies at sandbox creation; package installation failure terminates the session with ENVIRONMENT_PACKAGE_INSTALL_FAILED. self_hosted, scope and cross-session package caching are not supported.
  • Get Environment:Supports tenant-owned cloud environments, configuration updates and soft archival; built-ins are read-only. Lists accept limit, page and include_archived. Limited networking applies at sandbox creation; package installation failure terminates the session with ENVIRONMENT_PACKAGE_INSTALL_FAILED. self_hosted, scope and cross-session package caching are not supported.
  • List Toolsets:Returns toolset descriptions, plugin names and versions, and each tool’s name, description, input schema, read-only status and default permission policy. Available at /agent/v1/toolsets. Reading the catalog does not change agent configuration. agent_toolset_20260401 contains all 13 native tools. TaskOutput, TaskStop, Monitor, Agent and SendMessage support individual enablement and permission policies and require bash. The compatibility API provides only the eight official tools.

For native tools and parameters, use these endpoint pages and /meta/v1/openapi.yaml; the Claude Managed Agents documentation describes the official fields supported by the compatibility API.

Errors follow the Anthropic error format (type / message / request_id), see errors; quotas and response headers are covered in rate limits.

POST /agent/v1/environments◐ Partial

Request body

  • namestring必填

    Human-readable name for the environment

  • metadataobject可选

    User-provided metadata key-value pairs

  • configobject可选

    Environment configuration

    ▸ 展开子字段(3)
    • typestring必填

      Self-hosted environment selector; unsupported here and rejected with 400. Use a cloud environment instead.

      取值 self_hosted
    • networkingobject可选

      Network configuration policy. Omit on update to preserve the existing value.

    • packagesobject可选

      Specify packages (and optionally their versions) available in this environment. When versioning, use the version semantics relevant for the package manager, e.g. for `pip` use `package==1.0.0`. You are responsible for validating the package and version exist. Unversioned installs the latest. Under `limited` networking, requires `networking.allow_package_managers` to be `true`.

  • descriptionstring可选

    Optional description of the environment

  • scopestring可选

    The visibility scope for this environment. 'organization' makes the environment visible to all accounts. 'account' restricts visibility to the owning account only. API organizations support only 'organization'; 'account' is rejected. If not specified, defaults based on organization type.

Returns

200

Supports tenant-owned cloud environments, configuration updates and soft archival; built-ins are read-only. Lists accept limit, page and include_archived. Limited networking applies at sandbox creation; package installation failure terminates the session with ENVIRONMENT_PACKAGE_INSTALL_FAILED. self_hosted, scope and cross-session package caching are not supported.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
idstringEnvironment identifier (e.g., 'env_...')
archived_atnull | stringRFC 3339 timestamp when environment was archived, or null if not archived
configobjectEnvironment configuration (either Anthropic Cloud or self-hosted)
config.networkingobjectNetwork configuration policy.
config.packagesobjectPackage manager configuration.
config.typestringEnvironment type
created_atstringRFC 3339 timestamp when environment was created
descriptionnull | stringUser-provided description for the environment; null when unset
metadataobjectUser-provided metadata key-value pairs
namestringHuman-readable name for the environment
typestringThe type of object (always 'environment')
updated_atstringRFC 3339 timestamp when environment was last updated
scopestringThe visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account.

Call Create environment first and replace env_123 with its returned ID.

POST /agent/v1/environments/{environment_id}◐ Partial

Request parameters

  • environment_idstring必填

    path: Environment id, as returned by environments.create or environments.list. Built-in environments can be read but not changed.

  • namestring可选

    Updated name for the environment

  • metadataobject可选

    User-provided metadata key-value pairs. Set a value to null or empty string to delete the key.

  • configobject可选

    Updated environment configuration

    ▸ 展开子字段(3)
    • typestring必填

      Self-hosted environment selector; unsupported here and rejected with 400. Use a cloud environment instead.

      取值 self_hosted
    • networkingobject可选

      Network configuration policy. Omit on update to preserve the existing value.

    • packagesobject可选

      Specify packages (and optionally their versions) available in this environment. When versioning, use the version semantics relevant for the package manager, e.g. for `pip` use `package==1.0.0`. You are responsible for validating the package and version exist. Unversioned installs the latest. Under `limited` networking, requires `networking.allow_package_managers` to be `true`.

  • descriptionstring可选

    Updated description of the environment. Omit to preserve; null clears to null; an empty string is stored as an empty string.

  • scopestring可选

    The visibility scope for this environment. 'organization' makes the environment visible to all accounts. 'account' restricts visibility to the owning account only.

Returns

200

Supports tenant-owned cloud environments, configuration updates and soft archival; built-ins are read-only. Lists accept limit, page and include_archived. Limited networking applies at sandbox creation; package installation failure terminates the session with ENVIRONMENT_PACKAGE_INSTALL_FAILED. self_hosted, scope and cross-session package caching are not supported.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
idstringEnvironment identifier (e.g., 'env_...')
archived_atnull | stringRFC 3339 timestamp when environment was archived, or null if not archived
configobjectEnvironment configuration (either Anthropic Cloud or self-hosted)
config.networkingobjectNetwork configuration policy.
config.packagesobjectPackage manager configuration.
config.typestringEnvironment type
created_atstringRFC 3339 timestamp when environment was created
descriptionnull | stringUser-provided description for the environment; null when unset
metadataobjectUser-provided metadata key-value pairs
namestringHuman-readable name for the environment
typestringThe type of object (always 'environment')
updated_atstringRFC 3339 timestamp when environment was last updated
scopestringThe visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account.

Call Create environment first and replace env_123 with its returned ID.

POST /agent/v1/environments/{environment_id}/archive◐ Partial

Request parameters

  • environment_idstring必填

    path: Environment id, as returned by environments.create or environments.list. Built-in environments can be read but not changed.

Returns

200

Supports tenant-owned cloud environments, configuration updates and soft archival; built-ins are read-only. Lists accept limit, page and include_archived. Limited networking applies at sandbox creation; package installation failure terminates the session with ENVIRONMENT_PACKAGE_INSTALL_FAILED. self_hosted, scope and cross-session package caching are not supported.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
idstringEnvironment identifier (e.g., 'env_...')
archived_atnull | stringRFC 3339 timestamp when environment was archived, or null if not archived
configobjectEnvironment configuration (either Anthropic Cloud or self-hosted)
config.networkingobjectNetwork configuration policy.
config.packagesobjectPackage manager configuration.
config.typestringEnvironment type
created_atstringRFC 3339 timestamp when environment was created
descriptionnull | stringUser-provided description for the environment; null when unset
metadataobjectUser-provided metadata key-value pairs
namestringHuman-readable name for the environment
typestringThe type of object (always 'environment')
updated_atstringRFC 3339 timestamp when environment was last updated
scopestringThe visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account.

ComputersCreate

POST /agent/v1/computers● Supported

Request body

  • namestring必填

    Name of the entry or object.

  • environment_idstring可选

    Environment recipe id; null or omitted when none was selected.

Returns

201

Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 201

Computer result

application/json

NameTypeDescription
typestringAlways `computer`. A computer.
idstringComputer id (cmp_...), the computer_id of computer calls.
namestringDisplay name of the computer, 1 to 255 characters.
sandbox_idstring | nullPublic id of the sandbox that backs the computer, usable with the sandbox API; null while none has been created.
environment_idstring | nullEnvironment recipe the computer was created with; null when none.
statusstringactive computers can be used by new sessions; archived ones keep their files readable but cannot start new sessions.
created_atstringRFC 3339 time at which the computer was created.
updated_atstringRFC 3339 time at which the computer was last modified.
archived_atstring | nullRFC 3339 time at which the computer was archived; null while active.

ComputersList

GET /agent/v1/computers● Supported

Request parameters

  • limitinteger可选
    默认 20

    query: Maximum number of items to return in this page: a positive integer, at most 100 (default 20; for session resources default and maximum are 1000). A larger value returns 400.

  • pagestring可选

    query: Opaque pagination cursor: pass the next_page value of the previous response unchanged. Omit it for the first page. A cursor from a different query or a malformed one returns 400.

Returns

200

Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Computer result

application/json

NameTypeDescription
dataarray<object>Items of this page, in the order requested by the call.
data[].typestringAlways `computer`. A computer.
data[].idstringComputer id (cmp_...), the computer_id of computer calls.
data[].namestringDisplay name of the computer, 1 to 255 characters.
data[].sandbox_idstring | nullPublic id of the sandbox that backs the computer, usable with the sandbox API; null while none has been created.
data[].environment_idstring | nullEnvironment recipe the computer was created with; null when none.
data[].statusstringactive computers can be used by new sessions; archived ones keep their files readable but cannot start new sessions.
data[].created_atstringRFC 3339 time at which the computer was created.
data[].updated_atstringRFC 3339 time at which the computer was last modified.
data[].archived_atstring | nullRFC 3339 time at which the computer was archived; null while active.
has_morebooleanWhether more items exist beyond this page.
next_pagestring | nullOpaque cursor for the next page: pass it unchanged as page to continue. Null when this is the last page.

ComputersRetrieve

Call Create computer first and replace cmp_123 with its returned ID.

GET /agent/v1/computers/{computer_id}● Supported

Request parameters

  • computer_idstring必填

    path: Computer id (cmp_...), as returned by computers.create or computers.list.

Returns

200

Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Computer result

application/json

NameTypeDescription
typestringAlways `computer`. A computer.
idstringComputer id (cmp_...), the computer_id of computer calls.
namestringDisplay name of the computer, 1 to 255 characters.
sandbox_idstring | nullPublic id of the sandbox that backs the computer, usable with the sandbox API; null while none has been created.
environment_idstring | nullEnvironment recipe the computer was created with; null when none.
statusstringactive computers can be used by new sessions; archived ones keep their files readable but cannot start new sessions.
created_atstringRFC 3339 time at which the computer was created.
updated_atstringRFC 3339 time at which the computer was last modified.
archived_atstring | nullRFC 3339 time at which the computer was archived; null while active.
implementationstringHow the computer is backed: a virtual file store or a real sandbox.
storage_bytesintegerBytes stored on the computer.
file_countintegerNumber of files stored on the computer.

ComputersUpdate

Call Create computer first and replace cmp_123 with its returned ID.

POST /agent/v1/computers/{computer_id}● Supported

Request parameters

  • computer_idstring必填

    path: Computer id (cmp_...), as returned by computers.create or computers.list.

  • namestring必填

    Name of the entry or object.

Returns

200

Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Computer result

application/json

NameTypeDescription
typestringAlways `computer`. A computer.
idstringComputer id (cmp_...), the computer_id of computer calls.
namestringDisplay name of the computer, 1 to 255 characters.
sandbox_idstring | nullPublic id of the sandbox that backs the computer, usable with the sandbox API; null while none has been created.
environment_idstring | nullEnvironment recipe the computer was created with; null when none.
statusstringactive computers can be used by new sessions; archived ones keep their files readable but cannot start new sessions.
created_atstringRFC 3339 time at which the computer was created.
updated_atstringRFC 3339 time at which the computer was last modified.
archived_atstring | nullRFC 3339 time at which the computer was archived; null while active.

ComputersArchive

Call Create computer first and replace cmp_123 with its returned ID.

POST /agent/v1/computers/{computer_id}/archive● Supported

Request parameters

  • computer_idstring必填

    path: Computer id (cmp_...), as returned by computers.create or computers.list.

Returns

200

Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Computer result

application/json

NameTypeDescription
typestringAlways `computer`. A computer.
idstringComputer id (cmp_...), the computer_id of computer calls.
namestringDisplay name of the computer, 1 to 255 characters.
sandbox_idstring | nullPublic id of the sandbox that backs the computer, usable with the sandbox API; null while none has been created.
environment_idstring | nullEnvironment recipe the computer was created with; null when none.
statusstringactive computers can be used by new sessions; archived ones keep their files readable but cannot start new sessions.
created_atstringRFC 3339 time at which the computer was created.
updated_atstringRFC 3339 time at which the computer was last modified.
archived_atstring | nullRFC 3339 time at which the computer was archived; null while active.

Delete Archived Computer

Call Create computer first and replace cmp_123 with its returned ID.

DELETE /agent/v1/computers/{computer_id}● Supported

Request parameters

  • computer_idstring必填

    path: Computer id (cmp_...), as returned by computers.create or computers.list.

Returns

200

Own-face superset: Managed Agents has no persistent Computer deletion lifecycle. Only archived computers can be deleted. Active computers return 400 COMPUTER_ACTIVE (archive first). Destroy storage before removing registration. Success returns id and type=computer_deleted; missing or foreign computers return 404.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Computer result

application/json

NameTypeDescription
idstringId of the deleted computer.
typestringAlways `computer_deleted`. Confirms that a computer was deleted.

ComputersFilesList

Call Create computer first and replace cmp_123 with its returned ID.

GET /agent/v1/computers/{computer_id}/files● Supported

Request parameters

  • computer_idstring必填

    path: Computer id (cmp_...), as returned by computers.create or computers.list.

  • pathstring可选
    默认 "/"

    query: Directory on the computer to list; absolute path as returned in the path field of an earlier listing. Omit it to list from the computer's root.

Returns

200

Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Computer result

application/json

NameTypeDescription
dataarray<object>Items of this page, in the order requested by the call.
data[].pathstringAbsolute path of the entry on the computer.
data[].namestringName of the entry or object.
data[].typestringKind of entry: a file, a directory or a symbolic link.
data[].sizeintegerSize in bytes.
data[].mime_typestringMIME type of the file.
data[].read_onlybooleanTrue when the entry cannot be modified through the API.
data[].digeststring | nullContent digest of the file; null when not computed.
data[].updated_atstring | nullRFC 3339 time at which the object was last modified.
has_morebooleanWhether more items exist beyond this page.

ComputersFilesContent

Call Create computer first and replace cmp_123 with its returned ID.

GET /agent/v1/computers/{computer_id}/files/content● Supported

Request parameters

  • computer_idstring必填

    path: Computer id (cmp_...), as returned by computers.create or computers.list.

  • pathstring必填

    query: Absolute path of the file whose content to download, as returned in the path field of computers.files.list.

Returns

200

Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Raw file bytes (at most 16 MiB); Content-Type is inferred from the extension. ETag is present only when a digest is available. Larger files require the sandbox connection issued by connect.

application/octet-stream

NameTypeDescription
$string (binary)

HTTP 206

Single byte range

application/octet-stream

NameTypeDescription
$string (binary)

Connect computer

Call Create computer first and replace cmp_123 with its returned ID.

POST /agent/v1/computers/{computer_id}/connect● Supported

Request parameters

  • computer_idstring必填

    path: Computer id (cmp_...), as returned by computers.create or computers.list.

Returns

200

Own-face extension: Managed Agents has no persistent Computer connection. Returns the public SDK sandbox_id, envd_access_token and template_id. Archived computers remain accessible; foreign or absent computers return 404. Never cache credentials.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Computer result

application/json

NameTypeDescription
sandbox_idstringPublic id of the sandbox that backs the computer, usable with the sandbox API; null while none has been created.
envd_access_tokenstringAccess token for the sandbox's environment daemon, returned by the connect call; treat it as a secret.
template_idstringSandbox template the computer's sandbox was created from.

Upload Computer Attachment

Call Create computer first and replace cmp_123 with its returned ID.

POST /agent/v1/computers/{computer_id}/attachments● Supported

Request parameters

  • computer_idstring必填

    path: Computer id (cmp_...), as returned by computers.create or computers.list.

  • namestring必填

    query: Single filename, at most 255 UTF-8 bytes, excluding slash, dot segments and control characters.

Returns

201

Own-face superset: Managed Agents has no persistent Computer attachment directory. User uploads overwrite the same name; agents retain read-only access. Run-token uploads return 403 READ_ONLY. name is one filename of at most 255 UTF-8 bytes; MIME is inferred from the extension; custom Content-Type is not persisted and digest may be absent. Limit 16 MiB (413); invalid names return 400. Archived computers accept uploads; foreign computers return 404.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 201

Computer result

application/json

NameTypeDescription
pathstringAbsolute path of the entry on the computer.
namestringName of the entry or object.
typestringKind of entry: a file, a directory or a symbolic link.
sizeintegerSize in bytes.
mime_typestringMIME type of the file.
read_onlybooleanTrue when the entry cannot be modified through the API.
digeststring | nullContent digest of the file; null when not computed.
updated_atstring | nullRFC 3339 time at which the object was last modified.

Upload a file first, then replace the example file ID with its returned ID. Call Create session first and replace the example session ID with its returned ID.

POST /agent/v1/sessions/{session_id}/resources◐ Partial

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • typestring必填

    query: Resource type selector for the body; only file resources are supported. Normally you send type inside the JSON body and omit this parameter.

    取值 file
  • file_idstring必填

    ID of a previously uploaded file.

  • mount_pathstring可选

    Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.

Returns

200

Supports persistence, retrieval and removal of file resource references, up to 500 per session. Files must be live and owned by the current tenant. Paths default to /mnt/session/uploads/<file_id>; custom paths are rooted there and parent traversal is rejected. File content is immutable through this API. Sandbox synchronization is not implemented in this batch.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
idstringResource id, the resource_id of sessions.resources calls.
created_atstringA timestamp in RFC 3339 format
file_idstringId of the uploaded file; it must exist and belong to your tenant.
mount_pathstringPath inside the machine where the file is mounted; defaults to /mnt/session/uploads/<file_id>, and custom paths are rooted there.
typestringAlways `file`. A file resource: an uploaded file mounted into the session's machine.
updated_atstringA timestamp in RFC 3339 format

Call Create session first and replace the example session ID with its returned ID.

GET /agent/v1/sessions/{session_id}/resources◐ Partial

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • limitnumber可选

    query: Number of items per page.

  • pagestring可选

    query: Opaque pagination cursor: pass the next_page value of the previous response unchanged. Omit it for the first page. A cursor from a different query or a malformed one returns 400.

Returns

200

Supports persistence, retrieval and removal of file resource references, up to 500 per session. Files must be live and owned by the current tenant. Paths default to /mnt/session/uploads/<file_id>; custom paths are rooted there and parent traversal is rejected. File content is immutable through this API. Sandbox synchronization is not implemented in this batch.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
dataarray<object>Items of this page, in the order requested by the call.
data[].idstringResource id, the resource_id of sessions.resources calls.
data[].created_atstringA timestamp in RFC 3339 format
data[].mount_pathstring | null | stringPath inside the machine where the file is mounted; defaults to /mnt/session/uploads/<file_id>, and custom paths are rooted there. / 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.
data[].typestringAlways `github_repository`. A GitHub repository resource; not supported on this platform. / Always `file`. A file resource: an uploaded file mounted into the session's machine. / Always `memory_store`. A memory store resource; not supported on this platform.
data[].updated_atstringA timestamp in RFC 3339 format
data[].urlstringRepository URL.
data[].checkoutnull | objectBranch or commit to check out.
data[].file_idstringId of the uploaded file; it must exist and belong to your tenant.
data[].memory_store_idstringThe memory store ID (memstore_...). Must belong to the caller's organization and workspace.
data[].accessnull | stringAccess mode for an attached memory store.
data[].descriptionstringDescription of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.
data[].instructionsnull | stringPer-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.
data[].namenull | stringDisplay name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.
next_pagestring | nullOpaque cursor for the next page: pass it unchanged as page to continue. Null when this is the last page.

Call Create session first and replace the example session ID with its returned ID. Call Add session resource first and replace sesrsc_123 with its returned ID.

GET /agent/v1/sessions/{session_id}/resources/{resource_id}◐ Partial

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • resource_idstring必填

    path: Id of a resource attached to the session, as returned by sessions.resources.add or sessions.resources.list.

  • session_idstring必填

    query: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

Returns

200

Supports persistence, retrieval and removal of file resource references, up to 500 per session. Files must be live and owned by the current tenant. Paths default to /mnt/session/uploads/<file_id>; custom paths are rooted there and parent traversal is rejected. File content is immutable through this API. Sandbox synchronization is not implemented in this batch.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
idstringResource id, the resource_id of sessions.resources calls.
created_atstringA timestamp in RFC 3339 format
mount_pathstring | null | stringPath inside the machine where the file is mounted; defaults to /mnt/session/uploads/<file_id>, and custom paths are rooted there. / 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.
typestringAlways `github_repository`. A GitHub repository resource; not supported on this platform. / Always `file`. A file resource: an uploaded file mounted into the session's machine. / Always `memory_store`. A memory store resource; not supported on this platform.
updated_atstringA timestamp in RFC 3339 format
urlstringRepository URL.
checkoutnull | objectBranch or commit to check out.
checkout.namestringBranch name to check out.
checkout.typestringAlways `branch`. Check out the named branch. / Always `commit`. Check out the commit with the given SHA.
checkout.shastringFull commit SHA to check out.
file_idstringId of the uploaded file; it must exist and belong to your tenant.
memory_store_idstringThe memory store ID (memstore_...). Must belong to the caller's organization and workspace.
accessnull | stringAccess mode for an attached memory store.
descriptionstringDescription of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.
instructionsnull | stringPer-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.
namenull | stringDisplay name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.

Call Create session first and replace the example session ID with its returned ID. Call Add session resource first and replace sesrsc_123 with its returned ID.

DELETE /agent/v1/sessions/{session_id}/resources/{resource_id}◐ Partial

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • resource_idstring必填

    path: Id of a resource attached to the session, as returned by sessions.resources.add or sessions.resources.list.

  • session_idstring必填

    query: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

Returns

200

Supports persistence, retrieval and removal of file resource references, up to 500 per session. Files must be live and owned by the current tenant. Paths default to /mnt/session/uploads/<file_id>; custom paths are rooted there and parent traversal is rejected. File content is immutable through this API. Sandbox synchronization is not implemented in this batch.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
idstringIdentifier of the object, as returned by the API; pass it in the path of follow-up calls on the same resource.
typestringAlways `session_resource_deleted`. Confirms that a resource was detached from the session.

List Agents

GET /agent/v1/agents● Supported

Official Claude documentation ↗

Request parameters

  • created_at[gte]string可选

    query: Return agents created at or after this time (inclusive).

  • created_at[lte]string可选

    query: Return agents created at or before this time (inclusive).

  • include_archivedboolean可选

    query: Include archived agents in results. Defaults to false.

  • limitnumber可选

    query: Number of items per page.

  • pagestring可选

    query: Opaque pagination cursor: pass the next_page value of the previous response unchanged. Omit it for the first page. A cursor from a different query or a malformed one returns 400.

Returns

200

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
dataarray<object>Items of this page, in the order requested by the call.
data[].idstringAgent id (agent_...). Pass it as agent when creating a session and as agent_id in agent calls.
data[].archived_atnull | stringA timestamp in RFC 3339 format
data[].created_atstringA timestamp in RFC 3339 format
data[].descriptionnull | stringFree-text description of what the agent is for; null when none was set.
data[].mcp_serversarray<object>URL MCP servers the agent can call, paired one-to-one with mcp_toolset entries in tools and saved with the agent version. No credentials are stored here.
data[].metadataobjectFree-form string key/value pairs stored with the agent for your own bookkeeping.
data[].modelobjectModel identifier and configuration.
data[].multiagentnull | objectResolved coordinator topology with a concrete agent roster.
data[].namestringDisplay name of the agent, as set on create or update. It is a label, not a unique key.
data[].skillsarray<object>Skill attachments are not supported: a nonempty skills array returns 400. Omit this field or send an empty array. The native Skill tool loads available runtime skills independently of this field.
data[].systemnull | stringSystem prompt given to the model at the start of every session of this agent; null when none was set.
data[].toolsarray<object>Tools of the agent: one agent_toolset_20260401 entry for the native tools (all resolved settings are returned, ready to send back on update), plus mcp_toolset entries; custom tool definitions are rejected with 400. Keep bash enabled to use codemode, Skill and subagents.
data[].typestringAlways `agent`. An agent definition.
data[].updated_atstringA timestamp in RFC 3339 format
data[].versionnumberThe agent's current version. Starts at 1 and increments when the agent is modified.
data[].computer_idstringPraxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. computer_id selects a tenant-owned active computer. Session selection overrides the agent default; a sandbox environment_id and computer_id cannot be combined. Omitted when no computer is selected.
data[].subagent_modelstring | nullPraxis extension: default subagent model ID, pinned in the agent revision. Call model overrides this; otherwise it overrides the roster member model or the parent model for built-ins. Null clears the default. /agent/v1 only.
data[].modelsobjectPraxis extension: switchable model ids on /agent/v1 only. The default model must be included. When omitted, only the default model is selectable.
next_pagestring | nullOpaque cursor for the next page: pass it unchanged as page to continue. Null when this is the last page.

POST /agent/v1/agents◐ Partial

Official Claude documentation ↗

Request body

  • namestring必填

    Human-readable agent name, 1-255 characters, unique within the workspace.

  • modelstring | object必填

    The model powering the agent: a model name string (e.g. claude-opus-5) or an object for extra configuration (see subfields).

    ▸ 展开子字段(5)
    • idstring必填

      The model name string, e.g. claude-opus-5.

    • effortstring | object可选

      How hard the model works per inference: a bare level string (e.g. high) or a {type: high} object. On create, omitted resolves the per-model default; on update, omitting preserves it.

    • inference_geostring可选

      Geographic region for inference; unset falls through to the workspace default. model is replaced wholesale — omitting the subfield on update clears it.

    • speedstring可选

      Inference speed mode: fast generates output notably quicker at premium pricing. Not all models support it; invalid combinations are rejected at create time.

    • settingsobject可选

      Platform model settings. Only reasoning is supported; other model controls return 400.

  • systemstring可选

    The agent's system prompt.

  • metadataobject可选

    Custom metadata key-value pairs; up to 16 keys of at most 512 characters each.

  • descriptionstring可选

    What the agent does.

  • mcp_serversarray可选

    MCP servers the agent connects to; up to 20 with unique names. Every server must be referenced by an mcp_toolset in tools, or the request is rejected.

    ▸ 展开子字段(3)
    • typestring必填

      Server type; only url is supported today.

      取值 url
    • namestring必填

      Name unique within this list, 1-255 characters, referenced by mcp_toolset configurations.

    • urlstring必填

      The MCP server's endpoint URL.

  • multiagentobject可选◐ 部分支持

    Multiagent topology: the session's primary thread orchestrates work by spawning session threads drawn from the agents roster.

    ▸ 展开子字段(2)
    • agentsarray必填

      A roster of 1-20 agent IDs, {type: agent, id, version?} references or at most one {type: self}. Versions are pinned on create/update. Members must be distinct, exist, be unarchived and have no multiagent topology. Each coordinator permits at most one advisor whose model must be available and differ from the agent model; only the primary session can consult it, each consultation uses a separate advisor thread, and advice returns via agent.thread_message_received.

    • typestring必填

      Topology type; only coordinator today.

      取值 coordinator
  • skillsarray可选

    Skills available to the agent.

  • toolsarray可选

    Tool configurations for the agent; up to 128 tools across all toolsets.

  • computer_idstring可选

    Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. computer_id selects a tenant-owned active computer. Session selection overrides the agent default; a sandbox environment_id and computer_id cannot be combined.

  • ▸ 更多参数(2)
    • subagent_modelstring可选

      Own-face extension: revision-pinned default subagent model ID. Omit to preserve; null clears it. Priority: call model, this field, then the roster member model or the parent model for built-ins. Not accepted or returned on the compatibility face.

    • modelsobject可选

      Extension: selectable models, available only on /agent/v1.

      ▸ 展开子字段(1)
      • allowedarray必填

        Must include the default model. Omit on creation to allow only the default; omit on update to preserve the list. Sessions use their pinned version’s list.

Returns

200

agent_toolset_20260401 is the native toolset: bash, edit, glob, grep, read, write, web_search, web_fetch, TaskOutput, TaskStop, Monitor, Agent and SendMessage. New agents enable all tools by default. Configure each tool through name, enabled and permission_policy in configs; omitted tools follow default_config (enabled by default). Background tasks, Monitor and subagents require bash. Enabling any background tool exposes bash run_in_background. The /anthropic compatibility API accepts and returns only the eight official tools, and sessions created there receive only those tools. Supports text prompts, models, metadata and built-in tools. Optional model.settings.reasoning accepts low, medium, high, xhigh or none as the session default. Explicit session thinking takes precedence; unsupported agent defaults fall back to the model default_effort. Example model: {id: "deepseek-v4-flash", settings: {reasoning: "high"}}. Skills and other additional model controls are not supported and return 400. Set up to 100 allow, ask and deny rules in toolset permissions for future conversations. multiagent accepts null or a coordinator roster of 1–20 agent IDs, {type:"agent",id,version?} references or at most one {type:"self"}. Versions are pinned on create/update. Members must be distinct, exist, be unarchived and have no multiagent topology. A roster can enable Agent while bash is enabled; SendMessage follows its tool configuration. Each coordinator permits at most one advisor whose model must be available and differ from the agent model; only the primary session can consult it, each consultation uses a separate advisor thread, and advice returns via agent.thread_message_received. The /agent/v1 top-level subagent_model is a nullable model ID stored in each revision: omit to preserve, null to clear. The model must exist. Priority: call model > subagent_model > roster member model (parent session model for built-ins). /anthropic neither accepts nor returns this field.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
idstringAgent id (agent_...). Pass it as agent when creating a session and as agent_id in agent calls.
archived_atnull | stringA timestamp in RFC 3339 format
created_atstringA timestamp in RFC 3339 format
descriptionnull | stringFree-text description of what the agent is for; null when none was set.
mcp_serversarray<object>URL MCP servers the agent can call, paired one-to-one with mcp_toolset entries in tools and saved with the agent version. No credentials are stored here.
mcp_servers[].typestringAlways `url`. An MCP server reached over a URL.
mcp_servers[].namestringName of the MCP server; the mcp_toolset entry that refers to it uses the same name in mcp_server_name.
mcp_servers[].urlstringhttp(s) endpoint of the MCP server, at most 2048 characters.
metadataobjectFree-form string key/value pairs stored with the agent for your own bookkeeping.
modelobjectModel identifier and configuration.
model.idstringThe model that will power your agent. See models for additional details and options.
model.effortobjectHow hard Claude works on each turn. Sets `output_config.effort` on every Messages call the session makes.
model.inference_geostringGeographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.
model.speedstringInference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.
model.settingsobjectPlatform model settings. Only reasoning is supported; other model controls return 400.
multiagentnull | objectResolved coordinator topology with a concrete agent roster.
multiagent.agentsarray<object>Agents the coordinator may spawn as session threads, each resolved to a specific version.
multiagent.typestringAlways `coordinator`. The agent coordinates the roster in agents and can delegate to its members.
namestringDisplay name of the agent, as set on create or update. It is a label, not a unique key.
skillsarray<object>Skill attachments are not supported: a nonempty skills array returns 400. Omit this field or send an empty array. The native Skill tool loads available runtime skills independently of this field.
skills[].skill_idstringId of the skill to attach.
skills[].typestringAlways `anthropic`. A skill provided by Anthropic, identified by skill_id. / Always `custom`. A skill created by you, identified by skill_id.
skills[].versionstringVersion of the skill; a string.
systemnull | stringSystem prompt given to the model at the start of every session of this agent; null when none was set.
toolsarray<object>Tools of the agent: one agent_toolset_20260401 entry for the native tools (all resolved settings are returned, ready to send back on update), plus mcp_toolset entries; custom tool definitions are rejected with 400. Keep bash enabled to use codemode, Skill and subagents.
tools[].configsarray<object> | array | nullPer-tool settings that override default_config. Tools that are not listed follow default_config.
tools[].default_configobject | object | nullResolved default configuration for agent tools. / Settings applied to every tool of this toolset that configs does not name. When omitted, tools are enabled with the always_allow policy.
tools[].typestringAlways `agent_toolset_20260401`. The native toolset entry (bash, edit, glob, grep, read, write, web_search, web_fetch, TaskOutput, TaskStop, Monitor, Agent, SendMessage). / Always `mcp_toolset`. An entry that exposes the tools of one MCP server from mcp_servers. / Always `custom`. A custom tool defined by name, description and input_schema; its calls are answered by the client with user.custom_tool_result.
tools[].mcp_server_namestringName of the MCP server in mcp_servers whose tools this entry exposes.
tools[].descriptionstringWhat the custom tool does and when the model should call it.
tools[].input_schemaobjectJSON Schema for custom tool input parameters.
tools[].namestringName of the custom tool, as the model sees and calls it.
typestringAlways `agent`. An agent definition.
updated_atstringA timestamp in RFC 3339 format
versionnumberThe agent's current version. Starts at 1 and increments when the agent is modified.
computer_idstringPraxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. computer_id selects a tenant-owned active computer. Session selection overrides the agent default; a sandbox environment_id and computer_id cannot be combined. Omitted when no computer is selected.
subagent_modelstring | nullPraxis extension: default subagent model ID, pinned in the agent revision. Call model overrides this; otherwise it overrides the roster member model or the parent model for built-ins. Null clears the default. /agent/v1 only.
modelsobjectPraxis extension: switchable model ids on /agent/v1 only. The default model must be included. When omitted, only the default model is selectable.
models.allowedarray<string>Model ids a session may select with its model field; it must be non-empty and must contain the agent's default model.

Get Agent

Call Create agent first and replace the example agent ID with its returned ID.

GET /agent/v1/agents/{agent_id}● Supported

Official Claude documentation ↗

Request parameters

  • agent_idstring必填

    path: Agent id, as returned by agents.create or agents.list (for a session filter, the agent the session was created with). Not the agent name.

  • versionnumber可选

    query: Agent version to read; omit for the latest. Integer of at least 1; versions are listed by agents.versions.list.

Returns

200

tools returns all resolved native tool configurations in one agent_toolset_20260401 entry, ready for an update round trip. Replace example resource IDs with IDs from resources you created.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
idstringAgent id (agent_...). Pass it as agent when creating a session and as agent_id in agent calls.
archived_atnull | stringA timestamp in RFC 3339 format
created_atstringA timestamp in RFC 3339 format
descriptionnull | stringFree-text description of what the agent is for; null when none was set.
mcp_serversarray<object>URL MCP servers the agent can call, paired one-to-one with mcp_toolset entries in tools and saved with the agent version. No credentials are stored here.
mcp_servers[].typestringAlways `url`. An MCP server reached over a URL.
mcp_servers[].namestringName of the MCP server; the mcp_toolset entry that refers to it uses the same name in mcp_server_name.
mcp_servers[].urlstringhttp(s) endpoint of the MCP server, at most 2048 characters.
metadataobjectFree-form string key/value pairs stored with the agent for your own bookkeeping.
modelobjectModel identifier and configuration.
model.idstringThe model that will power your agent. See models for additional details and options.
model.effortobjectHow hard Claude works on each turn. Sets `output_config.effort` on every Messages call the session makes.
model.inference_geostringGeographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.
model.speedstringInference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.
model.settingsobjectPlatform model settings. Only reasoning is supported; other model controls return 400.
multiagentnull | objectResolved coordinator topology with a concrete agent roster.
multiagent.agentsarray<object>Agents the coordinator may spawn as session threads, each resolved to a specific version.
multiagent.typestringAlways `coordinator`. The agent coordinates the roster in agents and can delegate to its members.
namestringDisplay name of the agent, as set on create or update. It is a label, not a unique key.
skillsarray<object>Skill attachments are not supported: a nonempty skills array returns 400. Omit this field or send an empty array. The native Skill tool loads available runtime skills independently of this field.
skills[].skill_idstringId of the skill to attach.
skills[].typestringAlways `anthropic`. A skill provided by Anthropic, identified by skill_id. / Always `custom`. A skill created by you, identified by skill_id.
skills[].versionstringVersion of the skill; a string.
systemnull | stringSystem prompt given to the model at the start of every session of this agent; null when none was set.
toolsarray<object>Tools of the agent: one agent_toolset_20260401 entry for the native tools (all resolved settings are returned, ready to send back on update), plus mcp_toolset entries; custom tool definitions are rejected with 400. Keep bash enabled to use codemode, Skill and subagents.
tools[].configsarray<object> | array | nullPer-tool settings that override default_config. Tools that are not listed follow default_config.
tools[].default_configobject | object | nullResolved default configuration for agent tools. / Settings applied to every tool of this toolset that configs does not name. When omitted, tools are enabled with the always_allow policy.
tools[].typestringAlways `agent_toolset_20260401`. The native toolset entry (bash, edit, glob, grep, read, write, web_search, web_fetch, TaskOutput, TaskStop, Monitor, Agent, SendMessage). / Always `mcp_toolset`. An entry that exposes the tools of one MCP server from mcp_servers. / Always `custom`. A custom tool defined by name, description and input_schema; its calls are answered by the client with user.custom_tool_result.
tools[].mcp_server_namestringName of the MCP server in mcp_servers whose tools this entry exposes.
tools[].descriptionstringWhat the custom tool does and when the model should call it.
tools[].input_schemaobjectJSON Schema for custom tool input parameters.
tools[].namestringName of the custom tool, as the model sees and calls it.
typestringAlways `agent`. An agent definition.
updated_atstringA timestamp in RFC 3339 format
versionnumberThe agent's current version. Starts at 1 and increments when the agent is modified.
computer_idstringPraxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. computer_id selects a tenant-owned active computer. Session selection overrides the agent default; a sandbox environment_id and computer_id cannot be combined. Omitted when no computer is selected.
subagent_modelstring | nullPraxis extension: default subagent model ID, pinned in the agent revision. Call model overrides this; otherwise it overrides the roster member model or the parent model for built-ins. Null clears the default. /agent/v1 only.
modelsobjectPraxis extension: switchable model ids on /agent/v1 only. The default model must be included. When omitted, only the default model is selectable.
models.allowedarray<string>Model ids a session may select with its model field; it must be non-empty and must contain the agent's default model.

Call Create agent first and replace the example agent ID with its returned ID.

POST /agent/v1/agents/{agent_id}◐ Partial

Official Claude documentation ↗

Request parameters

  • agent_idstring必填

    path: Agent id, as returned by agents.create or agents.list (for a session filter, the agent the session was created with). Not the agent name.

  • namestring可选

    Agent name; omit to preserve. Cannot be cleared.

  • modelstring | object可选

    The model powering the agent: a model name string (e.g. claude-opus-5) or an object for extra configuration (see subfields).

    ▸ 展开子字段(5)
    • idstring必填

      The model name string, e.g. claude-opus-5.

    • effortstring | object可选

      How hard the model works per inference: a bare level string (e.g. high) or a {type: high} object. On create, omitted resolves the per-model default; on update, omitting preserves it.

    • inference_geostring可选

      Geographic region for inference; unset falls through to the workspace default. model is replaced wholesale — omitting the subfield on update clears it.

    • speedstring可选

      Inference speed mode: fast generates output notably quicker at premium pricing. Not all models support it; invalid combinations are rejected at create time.

    • settingsobject可选

      Platform model settings. Only reasoning is supported; other model controls return 400.

  • systemstring可选

    System prompt; omit to preserve, send an empty string or null to clear.

  • versionnumber可选

    The agent's current version for concurrency control: must match the version returned by the latest create or retrieve, or the call answers a conflict.

  • metadataobject可选

    Metadata patch: set a key to a string to upsert it, or to null to delete it; omit the field to preserve. Up to 16 keys of at most 512 characters.

  • descriptionstring可选

    Description; omit to preserve, send an empty string or null to clear.

  • mcp_serversarray可选

    Full-replacement MCP server list; omit to preserve, send an empty array or null to clear.

  • multiagentobject可选◐ 部分支持

    Multiagent topology: the session's primary thread orchestrates work by spawning session threads drawn from the agents roster.

    ▸ 展开子字段(2)
    • agentsarray必填

      A roster of 1-20 agent IDs, {type: agent, id, version?} references or at most one {type: self}. Versions are pinned on create/update. Members must be distinct, exist, be unarchived and have no multiagent topology. Each coordinator permits at most one advisor whose model must be available and differ from the agent model; only the primary session can consult it, each consultation uses a separate advisor thread, and advice returns via agent.thread_message_received.

    • typestring必填

      Topology type; only coordinator today.

      取值 coordinator
  • skillsarray可选

    Full-replacement skill list; omit to preserve, send an empty array or null to clear.

  • ▸ 更多参数(4)
    • toolsarray可选

      Full-replacement tool configuration; omit to preserve, send an empty array or null to clear.

    • computer_idstring可选

      Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. computer_id selects a tenant-owned active computer. Session selection overrides the agent default; a sandbox environment_id and computer_id cannot be combined.

    • subagent_modelstring可选

      Own-face extension: revision-pinned default subagent model ID. Omit to preserve; null clears it. Priority: call model, this field, then the roster member model or the parent model for built-ins. Not accepted or returned on the compatibility face.

    • modelsobject可选

      Extension: selectable models, available only on /agent/v1.

      ▸ 展开子字段(1)
      • allowedarray必填

        Must include the default model. Omit on creation to allow only the default; omit on update to preserve the list. Sessions use their pinned version’s list.

Returns

200

Use agent_toolset_20260401.configs to enable each native tool and set its permission policy. Omitted tools follow default_config; background tasks, Monitor and subagents require bash. Use version for optimistic concurrency; conflicts return 409 and unchanged updates preserve the version. Skills are not supported. Update toolset permissions to save allowed operations in a new agent version for future conversations. multiagent accepts null or a coordinator roster of 1–20 agent IDs, {type:"agent",id,version?} references or at most one {type:"self"}. Versions are pinned on create/update. Members must be distinct, exist, be unarchived and have no multiagent topology. A roster can enable Agent while bash is enabled; SendMessage follows its tool configuration. Each coordinator permits at most one advisor whose model must be available and differ from the agent model; only the primary session can consult it, each consultation uses a separate advisor thread, and advice returns via agent.thread_message_received. The /agent/v1 top-level subagent_model is a nullable model ID stored in each revision: omit to preserve, null to clear. The model must exist. Priority: call model > subagent_model > roster member model (parent session model for built-ins). /anthropic neither accepts nor returns this field.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
idstringAgent id (agent_...). Pass it as agent when creating a session and as agent_id in agent calls.
archived_atnull | stringA timestamp in RFC 3339 format
created_atstringA timestamp in RFC 3339 format
descriptionnull | stringFree-text description of what the agent is for; null when none was set.
mcp_serversarray<object>URL MCP servers the agent can call, paired one-to-one with mcp_toolset entries in tools and saved with the agent version. No credentials are stored here.
mcp_servers[].typestringAlways `url`. An MCP server reached over a URL.
mcp_servers[].namestringName of the MCP server; the mcp_toolset entry that refers to it uses the same name in mcp_server_name.
mcp_servers[].urlstringhttp(s) endpoint of the MCP server, at most 2048 characters.
metadataobjectFree-form string key/value pairs stored with the agent for your own bookkeeping.
modelobjectModel identifier and configuration.
model.idstringThe model that will power your agent. See models for additional details and options.
model.effortobjectHow hard Claude works on each turn. Sets `output_config.effort` on every Messages call the session makes.
model.inference_geostringGeographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.
model.speedstringInference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.
model.settingsobjectPlatform model settings. Only reasoning is supported; other model controls return 400.
multiagentnull | objectResolved coordinator topology with a concrete agent roster.
multiagent.agentsarray<object>Agents the coordinator may spawn as session threads, each resolved to a specific version.
multiagent.typestringAlways `coordinator`. The agent coordinates the roster in agents and can delegate to its members.
namestringDisplay name of the agent, as set on create or update. It is a label, not a unique key.
skillsarray<object>Skill attachments are not supported: a nonempty skills array returns 400. Omit this field or send an empty array. The native Skill tool loads available runtime skills independently of this field.
skills[].skill_idstringId of the skill to attach.
skills[].typestringAlways `anthropic`. A skill provided by Anthropic, identified by skill_id. / Always `custom`. A skill created by you, identified by skill_id.
skills[].versionstringVersion of the skill; a string.
systemnull | stringSystem prompt given to the model at the start of every session of this agent; null when none was set.
toolsarray<object>Tools of the agent: one agent_toolset_20260401 entry for the native tools (all resolved settings are returned, ready to send back on update), plus mcp_toolset entries; custom tool definitions are rejected with 400. Keep bash enabled to use codemode, Skill and subagents.
tools[].configsarray<object> | array | nullPer-tool settings that override default_config. Tools that are not listed follow default_config.
tools[].default_configobject | object | nullResolved default configuration for agent tools. / Settings applied to every tool of this toolset that configs does not name. When omitted, tools are enabled with the always_allow policy.
tools[].typestringAlways `agent_toolset_20260401`. The native toolset entry (bash, edit, glob, grep, read, write, web_search, web_fetch, TaskOutput, TaskStop, Monitor, Agent, SendMessage). / Always `mcp_toolset`. An entry that exposes the tools of one MCP server from mcp_servers. / Always `custom`. A custom tool defined by name, description and input_schema; its calls are answered by the client with user.custom_tool_result.
tools[].mcp_server_namestringName of the MCP server in mcp_servers whose tools this entry exposes.
tools[].descriptionstringWhat the custom tool does and when the model should call it.
tools[].input_schemaobjectJSON Schema for custom tool input parameters.
tools[].namestringName of the custom tool, as the model sees and calls it.
typestringAlways `agent`. An agent definition.
updated_atstringA timestamp in RFC 3339 format
versionnumberThe agent's current version. Starts at 1 and increments when the agent is modified.
computer_idstringPraxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. computer_id selects a tenant-owned active computer. Session selection overrides the agent default; a sandbox environment_id and computer_id cannot be combined. Omitted when no computer is selected.
subagent_modelstring | nullPraxis extension: default subagent model ID, pinned in the agent revision. Call model overrides this; otherwise it overrides the roster member model or the parent model for built-ins. Null clears the default. /agent/v1 only.
modelsobjectPraxis extension: switchable model ids on /agent/v1 only. The default model must be included. When omitted, only the default model is selectable.
models.allowedarray<string>Model ids a session may select with its model field; it must be non-empty and must contain the agent's default model.

List Agent Versions

Call Create agent first and replace the example agent ID with its returned ID.

GET /agent/v1/agents/{agent_id}/versions● Supported

Official Claude documentation ↗

Request parameters

  • agent_idstring必填

    path: Agent id, as returned by agents.create or agents.list (for a session filter, the agent the session was created with). Not the agent name.

  • limitnumber可选

    query: Number of items per page.

  • pagestring可选

    query: Opaque pagination cursor: pass the next_page value of the previous response unchanged. Omit it for the first page. A cursor from a different query or a malformed one returns 400.

Returns

200

Replace example resource IDs with IDs from resources you created.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
dataarray<object>Items of this page, in the order requested by the call.
data[].idstringAgent id (agent_...). Pass it as agent when creating a session and as agent_id in agent calls.
data[].archived_atnull | stringA timestamp in RFC 3339 format
data[].created_atstringA timestamp in RFC 3339 format
data[].descriptionnull | stringFree-text description of what the agent is for; null when none was set.
data[].mcp_serversarray<object>URL MCP servers the agent can call, paired one-to-one with mcp_toolset entries in tools and saved with the agent version. No credentials are stored here.
data[].metadataobjectFree-form string key/value pairs stored with the agent for your own bookkeeping.
data[].modelobjectModel identifier and configuration.
data[].multiagentnull | objectResolved coordinator topology with a concrete agent roster.
data[].namestringDisplay name of the agent, as set on create or update. It is a label, not a unique key.
data[].skillsarray<object>Skill attachments are not supported: a nonempty skills array returns 400. Omit this field or send an empty array. The native Skill tool loads available runtime skills independently of this field.
data[].systemnull | stringSystem prompt given to the model at the start of every session of this agent; null when none was set.
data[].toolsarray<object>Tools of the agent: one agent_toolset_20260401 entry for the native tools (all resolved settings are returned, ready to send back on update), plus mcp_toolset entries; custom tool definitions are rejected with 400. Keep bash enabled to use codemode, Skill and subagents.
data[].typestringAlways `agent`. An agent definition.
data[].updated_atstringA timestamp in RFC 3339 format
data[].versionnumberThe agent's current version. Starts at 1 and increments when the agent is modified.
data[].computer_idstringPraxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. computer_id selects a tenant-owned active computer. Session selection overrides the agent default; a sandbox environment_id and computer_id cannot be combined. Omitted when no computer is selected.
data[].subagent_modelstring | nullPraxis extension: default subagent model ID, pinned in the agent revision. Call model overrides this; otherwise it overrides the roster member model or the parent model for built-ins. Null clears the default. /agent/v1 only.
data[].modelsobjectPraxis extension: switchable model ids on /agent/v1 only. The default model must be included. When omitted, only the default model is selectable.
next_pagestring | nullOpaque cursor for the next page: pass it unchanged as page to continue. Null when this is the last page.

Archive Agent

Call Create agent first and replace the example agent ID with its returned ID.

POST /agent/v1/agents/{agent_id}/archive● Supported

Official Claude documentation ↗

Request parameters

  • agent_idstring必填

    path: Agent id, as returned by agents.create or agents.list (for a session filter, the agent the session was created with). Not the agent name.

Returns

200

Archived agents remain readable, including versions, but cannot be updated. Only archive your own test agent.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
idstringAgent id (agent_...). Pass it as agent when creating a session and as agent_id in agent calls.
archived_atnull | stringA timestamp in RFC 3339 format
created_atstringA timestamp in RFC 3339 format
descriptionnull | stringFree-text description of what the agent is for; null when none was set.
mcp_serversarray<object>URL MCP servers the agent can call, paired one-to-one with mcp_toolset entries in tools and saved with the agent version. No credentials are stored here.
mcp_servers[].typestringAlways `url`. An MCP server reached over a URL.
mcp_servers[].namestringName of the MCP server; the mcp_toolset entry that refers to it uses the same name in mcp_server_name.
mcp_servers[].urlstringhttp(s) endpoint of the MCP server, at most 2048 characters.
metadataobjectFree-form string key/value pairs stored with the agent for your own bookkeeping.
modelobjectModel identifier and configuration.
model.idstringThe model that will power your agent. See models for additional details and options.
model.effortobjectHow hard Claude works on each turn. Sets `output_config.effort` on every Messages call the session makes.
model.inference_geostringGeographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.
model.speedstringInference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.
model.settingsobjectPlatform model settings. Only reasoning is supported; other model controls return 400.
multiagentnull | objectResolved coordinator topology with a concrete agent roster.
multiagent.agentsarray<object>Agents the coordinator may spawn as session threads, each resolved to a specific version.
multiagent.typestringAlways `coordinator`. The agent coordinates the roster in agents and can delegate to its members.
namestringDisplay name of the agent, as set on create or update. It is a label, not a unique key.
skillsarray<object>Skill attachments are not supported: a nonempty skills array returns 400. Omit this field or send an empty array. The native Skill tool loads available runtime skills independently of this field.
skills[].skill_idstringId of the skill to attach.
skills[].typestringAlways `anthropic`. A skill provided by Anthropic, identified by skill_id. / Always `custom`. A skill created by you, identified by skill_id.
skills[].versionstringVersion of the skill; a string.
systemnull | stringSystem prompt given to the model at the start of every session of this agent; null when none was set.
toolsarray<object>Tools of the agent: one agent_toolset_20260401 entry for the native tools (all resolved settings are returned, ready to send back on update), plus mcp_toolset entries; custom tool definitions are rejected with 400. Keep bash enabled to use codemode, Skill and subagents.
tools[].configsarray<object> | array | nullPer-tool settings that override default_config. Tools that are not listed follow default_config.
tools[].default_configobject | object | nullResolved default configuration for agent tools. / Settings applied to every tool of this toolset that configs does not name. When omitted, tools are enabled with the always_allow policy.
tools[].typestringAlways `agent_toolset_20260401`. The native toolset entry (bash, edit, glob, grep, read, write, web_search, web_fetch, TaskOutput, TaskStop, Monitor, Agent, SendMessage). / Always `mcp_toolset`. An entry that exposes the tools of one MCP server from mcp_servers. / Always `custom`. A custom tool defined by name, description and input_schema; its calls are answered by the client with user.custom_tool_result.
tools[].mcp_server_namestringName of the MCP server in mcp_servers whose tools this entry exposes.
tools[].descriptionstringWhat the custom tool does and when the model should call it.
tools[].input_schemaobjectJSON Schema for custom tool input parameters.
tools[].namestringName of the custom tool, as the model sees and calls it.
typestringAlways `agent`. An agent definition.
updated_atstringA timestamp in RFC 3339 format
versionnumberThe agent's current version. Starts at 1 and increments when the agent is modified.
computer_idstringPraxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. computer_id selects a tenant-owned active computer. Session selection overrides the agent default; a sandbox environment_id and computer_id cannot be combined. Omitted when no computer is selected.
subagent_modelstring | nullPraxis extension: default subagent model ID, pinned in the agent revision. Call model overrides this; otherwise it overrides the roster member model or the parent model for built-ins. Null clears the default. /agent/v1 only.
modelsobjectPraxis extension: switchable model ids on /agent/v1 only. The default model must be included. When omitted, only the default model is selectable.
models.allowedarray<string>Model ids a session may select with its model field; it must be non-empty and must contain the agent's default model.

GET /agent/v1/sessions◐ Partial

Official Claude documentation ↗

Request parameters

  • agent_idstring可选

    query: Return only sessions created with this agent id (from agents.list or agents.create). This is one of the three filters sessions.list supports.

  • agent_versionnumber可选

    query: Filter by agent version; only applies when agent_id is also set.

  • created_at[gt]string可选

    query: Exclusive created-at lower bound for sessions. Declared by the Managed Agents shape but not supported here; sending it returns 400.

  • created_at[gte]string可选

    query: Created-at lower bound for sessions. Declared by the Managed Agents shape but not supported here: sessions.list honors only limit, page and agent_id, and other filters return 400.

  • created_at[lt]string可选

    query: Exclusive created-at upper bound for sessions. Declared by the Managed Agents shape but not supported here; sending it returns 400.

  • created_at[lte]string可选

    query: Created-at upper bound for sessions. Declared by the Managed Agents shape but not supported here: sessions.list honors only limit, page and agent_id, and other filters return 400.

  • deployment_idstring可选

    query: Declared by the Managed Agents shape but not supported by sessions.list; sending it returns 400.

  • include_archivedboolean可选

    query: Declared by the Managed Agents shape but not supported by sessions.list; sending it returns 400. Archived sessions are retrievable by id.

  • memory_store_idstring可选

    query: Declared by the Managed Agents shape but not supported by sessions.list; sending it returns 400.

  • orderstring可选

    query: Order by creation time: asc oldest first, desc newest first (default).

  • ▸ 更多参数(3)
    • statusesarray可选

      query: Filter by session status; repeat the parameter to match several.

    • limitnumber可选

      query: Number of items per page.

    • pagestring可选

      query: Opaque pagination cursor: pass the next_page value of the previous response unchanged. Omit it for the first page. A cursor from a different query or a malformed one returns 400.

Returns

200

Supports limit, page and agent_id. agent_version, time ranges, deployment_id, memory_store_id, include_archived, order and statuses are not supported and return 400.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
dataarray<object>Items of this page, in the order requested by the call.
data[].idstringSession id (sesn_...). Pass it as session_id in every session call.
data[].agentobjectResolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
data[].archived_atnull | stringA timestamp in RFC 3339 format
data[].budgetnull | objectA hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.
data[].created_atstringA timestamp in RFC 3339 format
data[].environment_idstringId of the environment recipe the session's sandbox was created from. Omitted when no recipe was selected, that is, for a light machine or the Computer chosen by computer_id.
data[].metadataobjectFree-form string key/value pairs stored with the session, changed through sessions.update patch semantics.
data[].outcome_evaluationsarray<object>Per-outcome evaluation state. One entry per `define_outcome` event sent to the session.
data[].resourcesarray<object>Resources attached to the session, at most 500; each is a file reference mounted into the session's machine.
data[].statsobjectTiming statistics for a session.
data[].statusstringSessionStatus 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.
data[].titlenull | stringTitle of the session, set on create or through sessions.update; null when none was set.
data[].typestringAlways `session`. A session, one conversation of an agent on a machine.
data[].updated_atstringA timestamp in RFC 3339 format
data[].usageobjectCumulative token usage for a session across all turns.
data[].vault_idsarray<string>Vault IDs attached to the session at creation. Empty when no vaults were supplied.
data[].deployment_idnull | stringDeployment ID when the session was created from a deployment reference. Null otherwise.
data[].cwdstringNormalized session working directory; defaults to /home/user/workspace. Forks inherit this directory.
data[].computer_idstringPraxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. computer_id selects a tenant-owned active computer. Session selection overrides the agent default; a sandbox environment_id and computer_id cannot be combined. Omitted when no computer is selected.
data[].modelobjectPraxis extension: the currently selected session model.
data[].thinkingobject | nullPraxis extension: explicit session thinking effort; null inherits the pinned agent default, then the model default. none disables thinking only when model.thinking.can_disable is true. Unsupported efforts return 400 invalid_request_error.
data[].forked_fromobject | nullPraxis extension: source of a forked session; null for other sessions. Available only on /agent/v1.
next_pagestring | nullOpaque cursor for the next page: pass it unchanged as page to continue. Null when this is the last page.

Call Create agent first and replace the example agent ID with its returned ID.

POST /agent/v1/sessions◐ Partial

Official Claude documentation ↗

Request body

  • modelstring可选

    The model powering the agent: a model name string (e.g. claude-opus-5) or an object for extra configuration (see subfields).

  • agentstring | object必填

    The agent the session runs: an agent ID string (pins the latest version) or an object with id and version (see subfields).

    ▸ 展开子字段(8)
    • idstring必填

      The ID of the agent the session runs.

    • typestring必填

      Reference type; only agent today.

      取值 agent_with_overrides
    • versionnumber可选

      The specific agent version to pin; omit for the latest.

    • mcp_serversarray可选

      Replacement MCP server list for this session: the provided array applies wholesale; an empty array clears, omitting keeps the agent's configuration.

    • modelstring | object可选

      Replacement model for this session: a model name string (e.g. claude-opus-5) or a config object; omit to keep the agent's model.

    • skillsarray可选

      Replacement skill list for this session; an empty array clears, omitting keeps the agent's skills.

    • systemstring可选

      Replacement system prompt for this session, up to 100,000 characters; null clears it, omitting keeps the agent's.

    • toolsarray可选

      Replacement tool configuration for this session; an empty array clears, omitting keeps the agent's.

  • environment_idstring可选

    ID of the environment the session runs in; it determines the container's base environment.

  • titlestring可选

    Human-readable session title.

  • metadataobject可选

    Custom metadata key-value pairs for the session.

  • budgetobject可选

    Spending cap for the session.

    ▸ 展开子字段(2)
    • max_list_costobject必填

      Cap on list-call spending within the budget.

    • typestring必填

      Budget type; only max_list_cost today.

      取值 limit
  • initial_eventsarray可选

    Initial events sent to the session in order at creation; user.message and user.define_outcome are supported, up to 50.

  • resourcesarray可选

    Resources (e.g. repositories, files) to mount into the session's container.

  • vault_idsarray可选

    Vault IDs for stored credentials the agent can use during the session.

  • cwdstring可选
    默认 "/home/user/workspace"

    Session working directory on any machine. Must be an absolute path within /home/user with no . or .. segments. Repeated and trailing slashes are normalized. Invalid values return 400 invalid_request_error with Invalid cwd.

  • ▸ 更多参数(3)
    • computer_idstring可选

      Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. computer_id selects a tenant-owned active computer. Session selection overrides the agent default; a sandbox environment_id and computer_id cannot be combined.

    • time_zonestring可选
      默认 "UTC"

      Praxis extension: the session's IANA time zone name (e.g. Asia/Shanghai) — the clock the runtime environment block renders for every turn. Absent means UTC. Only IANA names are accepted; fixed offsets ("+08:00") and unknown names return 400. Never stored in `metadata`.

    • thinkingobject可选

      Praxis extension: explicit session thinking effort; null inherits the pinned agent default, then the model default. none disables thinking only when model.thinking.can_disable is true. Unsupported efforts return 400 invalid_request_error.

      ▸ 展开子字段(1)
      • effortstring必填

        Thinking level for this session. The model must support the chosen effort; none requires can_disable. Null on thinking restores inheritance from the agent and model.

        取值 lowmediumhighxhighnone

Returns

200

Create with optional model (an ID string in models.allowed; only the default if no list) and thinking ({effort: "low|medium|high|xhigh|none"} or null), saved before initial_events execute. Omitted or null thinking inherits the agent default, then the model default. Efforts must be in model.thinking.efforts; none requires can_disable. Invalid selections return 400 invalid_request_error. The response includes thinking and model.thinking: {efforts, can_disable, default_effort}; unknown capability and an unspecified default_effort are null. Example: {"agent":"agent_123", "model":"deepseek-v4-flash","thinking":{"effort":"xhigh"}}. These selection fields belong only to /agent/v1. Create an agent first and replace agent_123 with its returned id. Omit environment_id to get a light machine, unless an explicit or agent-default computer_id selects a Computer. Select node22 or a tenant-owned cloud environment for a sandbox recipe. Responses omit environment_id when no recipe is selected. Inline agent overrides, budgets and vaults are not supported. File resources are persisted, up to 500 per session; sandbox synchronization is not implemented in this batch.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 201

Successful response

application/json

NameTypeDescription
idstringSession id (sesn_...). Pass it as session_id in every session call.
agentobjectResolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
agent.idstringAgent id (agent_...). Pass it as agent when creating a session and as agent_id in agent calls.
agent.descriptionnull | stringFree-text description of what the agent is for; null when none was set.
agent.mcp_serversarray<object>URL MCP servers the agent can call, paired one-to-one with mcp_toolset entries in tools and saved with the agent version. No credentials are stored here.
agent.modelobjectModel identifier and configuration.
agent.multiagentnull | objectResolved coordinator topology with full agent definitions for each roster member.
agent.namestringDisplay name of the agent, as set on create or update. It is a label, not a unique key.
agent.skillsarray<object>Skill attachments are not supported: a nonempty skills array returns 400. Omit this field or send an empty array. The native Skill tool loads available runtime skills independently of this field.
agent.systemnull | stringSystem prompt given to the model at the start of every session of this agent; null when none was set.
agent.toolsarray<object>Tools of the agent: one agent_toolset_20260401 entry for the native tools (all resolved settings are returned, ready to send back on update), plus mcp_toolset entries; custom tool definitions are rejected with 400. Keep bash enabled to use codemode, Skill and subagents.
agent.typestringAlways `agent`. An agent definition.
agent.versionnumberThe agent's current version. Starts at 1 and increments each time the agent is modified.
archived_atnull | stringA timestamp in RFC 3339 format
budgetnull | objectA hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.
budget.max_list_costobjectA monetary amount in a specific currency.
budget.typestringAlways `limit`. A spending limit.
created_atstringA timestamp in RFC 3339 format
environment_idstringId of the environment recipe the session's sandbox was created from. Omitted when no recipe was selected, that is, for a light machine or the Computer chosen by computer_id.
metadataobjectFree-form string key/value pairs stored with the session, changed through sessions.update patch semantics.
outcome_evaluationsarray<object>Per-outcome evaluation state. One entry per `define_outcome` event sent to the session.
outcome_evaluations[].completed_atnull | stringA timestamp in RFC 3339 format
outcome_evaluations[].descriptionstringWhat the agent should produce.
outcome_evaluations[].explanationnull | stringGrader'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[].iterationnumber0-indexed revision cycle the outcome is currently on.
outcome_evaluations[].outcome_idstringServer-generated outc_ ID for this outcome.
outcome_evaluations[].resultstringCurrent 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[].typestringAlways `outcome_evaluation`. Record of one outcome evaluation.
resourcesarray<object>Resources attached to the session, at most 500; each is a file reference mounted into the session's machine.
resources[].idstringResource id, the resource_id of sessions.resources calls.
resources[].created_atstringA timestamp in RFC 3339 format
resources[].mount_pathstring | null | stringPath inside the machine where the file is mounted; defaults to /mnt/session/uploads/<file_id>, and custom paths are rooted there. / 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[].typestringAlways `github_repository`. A GitHub repository resource; not supported on this platform. / Always `file`. A file resource: an uploaded file mounted into the session's machine. / Always `memory_store`. A memory store resource; not supported on this platform.
resources[].updated_atstringA timestamp in RFC 3339 format
resources[].urlstringRepository URL.
resources[].checkoutnull | objectBranch or commit to check out.
resources[].file_idstringId of the uploaded file; it must exist and belong to your tenant.
resources[].memory_store_idstringThe memory store ID (memstore_...). Must belong to the caller's organization and workspace.
resources[].accessnull | stringAccess mode for an attached memory store.
resources[].descriptionstringDescription of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.
resources[].instructionsnull | stringPer-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.
resources[].namenull | stringDisplay name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.
statsobjectTiming statistics for a session.
stats.active_secondsnumberCumulative time in seconds the session spent in `running` status. Excludes idle time.
stats.duration_secondsnumberElapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
statusstringSessionStatus 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.
titlenull | stringTitle of the session, set on create or through sessions.update; null when none was set.
typestringAlways `session`. A session, one conversation of an agent on a machine.
updated_atstringA timestamp in RFC 3339 format
usageobjectCumulative token usage for a session across all turns.
usage.active_secondsnumberCumulative 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_creationobjectPrompt-cache creation token usage broken down by cache lifetime.
usage.cache_read_input_tokensnumberTotal tokens read from prompt cache.
usage.input_tokensnumberTotal input tokens consumed across all turns.
usage.list_costnull | objectA monetary amount in a specific currency.
usage.output_tokensnumberTotal output tokens generated across all turns.
usage.server_tool_usenull | objectCumulative count of server-executed tool invocations, broken down by tool.
vault_idsarray<string>Vault IDs attached to the session at creation. Empty when no vaults were supplied.
deployment_idnull | stringDeployment ID when the session was created from a deployment reference. Null otherwise.
cwdstringNormalized session working directory; defaults to /home/user/workspace. Forks inherit this directory.
computer_idstringPraxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. computer_id selects a tenant-owned active computer. Session selection overrides the agent default; a sandbox environment_id and computer_id cannot be combined. Omitted when no computer is selected.
modelobjectPraxis extension: the currently selected session model.
model.idstringIdentifier of the object, as returned by the API; pass it in the path of follow-up calls on the same resource.
model.thinkingobject | nullSupported thinking controls, or null when capability is unknown or unavailable. efforts lists selectable strengths; can_disable permits none; default_effort is nullable.
thinkingobject | nullPraxis extension: explicit session thinking effort; null inherits the pinned agent default, then the model default. none disables thinking only when model.thinking.can_disable is true. Unsupported efforts return 400 invalid_request_error.
thinking.effortstringThinking level saved for this session: low, medium, high, xhigh, or none to turn thinking off. Null or absent means the session inherits the agent default and then the model default.
forked_fromobject | nullPraxis extension: source of a forked session; null for other sessions. Available only on /agent/v1.
forked_from.session_idstringId of the parent session this session was forked from; it is left unchanged by the fork.
forked_from.message_idstringmessage_id of the agent message in the parent session up to which the conversation was copied.

Get Session

Call Create session first and replace the example session ID with its returned ID.

GET /agent/v1/sessions/{session_id}● Supported

Official Claude documentation ↗

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

Returns

200

Replace example resource IDs with IDs from resources you created.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
idstringSession id (sesn_...). Pass it as session_id in every session call.
agentobjectResolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
agent.idstringAgent id (agent_...). Pass it as agent when creating a session and as agent_id in agent calls.
agent.descriptionnull | stringFree-text description of what the agent is for; null when none was set.
agent.mcp_serversarray<object>URL MCP servers the agent can call, paired one-to-one with mcp_toolset entries in tools and saved with the agent version. No credentials are stored here.
agent.modelobjectModel identifier and configuration.
agent.multiagentnull | objectResolved coordinator topology with full agent definitions for each roster member.
agent.namestringDisplay name of the agent, as set on create or update. It is a label, not a unique key.
agent.skillsarray<object>Skill attachments are not supported: a nonempty skills array returns 400. Omit this field or send an empty array. The native Skill tool loads available runtime skills independently of this field.
agent.systemnull | stringSystem prompt given to the model at the start of every session of this agent; null when none was set.
agent.toolsarray<object>Tools of the agent: one agent_toolset_20260401 entry for the native tools (all resolved settings are returned, ready to send back on update), plus mcp_toolset entries; custom tool definitions are rejected with 400. Keep bash enabled to use codemode, Skill and subagents.
agent.typestringAlways `agent`. An agent definition.
agent.versionnumberThe agent's current version. Starts at 1 and increments each time the agent is modified.
archived_atnull | stringA timestamp in RFC 3339 format
budgetnull | objectA hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.
budget.max_list_costobjectA monetary amount in a specific currency.
budget.typestringAlways `limit`. A spending limit.
created_atstringA timestamp in RFC 3339 format
environment_idstringId of the environment recipe the session's sandbox was created from. Omitted when no recipe was selected, that is, for a light machine or the Computer chosen by computer_id.
metadataobjectFree-form string key/value pairs stored with the session, changed through sessions.update patch semantics.
outcome_evaluationsarray<object>Per-outcome evaluation state. One entry per `define_outcome` event sent to the session.
outcome_evaluations[].completed_atnull | stringA timestamp in RFC 3339 format
outcome_evaluations[].descriptionstringWhat the agent should produce.
outcome_evaluations[].explanationnull | stringGrader'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[].iterationnumber0-indexed revision cycle the outcome is currently on.
outcome_evaluations[].outcome_idstringServer-generated outc_ ID for this outcome.
outcome_evaluations[].resultstringCurrent 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[].typestringAlways `outcome_evaluation`. Record of one outcome evaluation.
resourcesarray<object>Resources attached to the session, at most 500; each is a file reference mounted into the session's machine.
resources[].idstringResource id, the resource_id of sessions.resources calls.
resources[].created_atstringA timestamp in RFC 3339 format
resources[].mount_pathstring | null | stringPath inside the machine where the file is mounted; defaults to /mnt/session/uploads/<file_id>, and custom paths are rooted there. / 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[].typestringAlways `github_repository`. A GitHub repository resource; not supported on this platform. / Always `file`. A file resource: an uploaded file mounted into the session's machine. / Always `memory_store`. A memory store resource; not supported on this platform.
resources[].updated_atstringA timestamp in RFC 3339 format
resources[].urlstringRepository URL.
resources[].checkoutnull | objectBranch or commit to check out.
resources[].file_idstringId of the uploaded file; it must exist and belong to your tenant.
resources[].memory_store_idstringThe memory store ID (memstore_...). Must belong to the caller's organization and workspace.
resources[].accessnull | stringAccess mode for an attached memory store.
resources[].descriptionstringDescription of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.
resources[].instructionsnull | stringPer-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.
resources[].namenull | stringDisplay name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.
statsobjectTiming statistics for a session.
stats.active_secondsnumberCumulative time in seconds the session spent in `running` status. Excludes idle time.
stats.duration_secondsnumberElapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
statusstringSessionStatus 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.
titlenull | stringTitle of the session, set on create or through sessions.update; null when none was set.
typestringAlways `session`. A session, one conversation of an agent on a machine.
updated_atstringA timestamp in RFC 3339 format
usageobjectCumulative token usage for a session across all turns.
usage.active_secondsnumberCumulative 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_creationobjectPrompt-cache creation token usage broken down by cache lifetime.
usage.cache_read_input_tokensnumberTotal tokens read from prompt cache.
usage.input_tokensnumberTotal input tokens consumed across all turns.
usage.list_costnull | objectA monetary amount in a specific currency.
usage.output_tokensnumberTotal output tokens generated across all turns.
usage.server_tool_usenull | objectCumulative count of server-executed tool invocations, broken down by tool.
vault_idsarray<string>Vault IDs attached to the session at creation. Empty when no vaults were supplied.
deployment_idnull | stringDeployment ID when the session was created from a deployment reference. Null otherwise.
cwdstringNormalized session working directory; defaults to /home/user/workspace. Forks inherit this directory.
computer_idstringPraxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. computer_id selects a tenant-owned active computer. Session selection overrides the agent default; a sandbox environment_id and computer_id cannot be combined. Omitted when no computer is selected.
modelobjectPraxis extension: the currently selected session model.
model.idstringIdentifier of the object, as returned by the API; pass it in the path of follow-up calls on the same resource.
model.thinkingobject | nullSupported thinking controls, or null when capability is unknown or unavailable. efforts lists selectable strengths; can_disable permits none; default_effort is nullable.
thinkingobject | nullPraxis extension: explicit session thinking effort; null inherits the pinned agent default, then the model default. none disables thinking only when model.thinking.can_disable is true. Unsupported efforts return 400 invalid_request_error.
thinking.effortstringThinking level saved for this session: low, medium, high, xhigh, or none to turn thinking off. Null or absent means the session inherits the agent default and then the model default.
forked_fromobject | nullPraxis extension: source of a forked session; null for other sessions. Available only on /agent/v1.
forked_from.session_idstringId of the parent session this session was forked from; it is left unchanged by the fork.
forked_from.message_idstringmessage_id of the agent message in the parent session up to which the conversation was copied.

Fork Session (Extension)

POST /agent/v1/sessions/{session_id}/fork● Supported

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • message_idstring必填

    UI message ID from an own-face event’s message_id field; must identify the last assistant message of a successfully completed turn.

Returns

201

Available only on /agent/v1. Use the message_id field from own-face events, not the event id. Copies every message and part through the target, including tool calls and results. The parent is unchanged; another running turn does not prevent forking an earlier completed turn. The new root session appears in the session list with the same agent version, current model and thinking settings, and cwd working directory. Its title is the parent title plus “ 的分支”. If the parent has a sandbox, the new session owns an independent fork including a memory snapshot. Inherited running tasks are terminated, ring targets are replaced with the new session only, and its background-task table starts empty. Without a parent sandbox, creation remains lazy. Returns 201 with the same Session shape as retrieval. forked_from is {session_id, message_id}, or null for ordinary sessions. Imported history ends with session.forked containing forked_from_session_id and forked_from_message_id. These fields and this event are own-face only. Invalid requests return 400; ineligible targets return 409 FORK_TARGET_INVALID; missing sessions or sessions belonging to another caller return 404. Initialization failures leave the child unpublished and reclaim the forked sandbox.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 201

Forked session (same shape as session retrieval)

application/json

NameTypeDescription
idstringSession id (sesn_...). Pass it as session_id in every session call.
agentobjectResolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
agent.idstringAgent id (agent_...). Pass it as agent when creating a session and as agent_id in agent calls.
agent.descriptionnull | stringFree-text description of what the agent is for; null when none was set.
agent.mcp_serversarray<object>URL MCP servers the agent can call, paired one-to-one with mcp_toolset entries in tools and saved with the agent version. No credentials are stored here.
agent.modelobjectModel identifier and configuration.
agent.multiagentnull | objectResolved coordinator topology with full agent definitions for each roster member.
agent.namestringDisplay name of the agent, as set on create or update. It is a label, not a unique key.
agent.skillsarray<object>Skill attachments are not supported: a nonempty skills array returns 400. Omit this field or send an empty array. The native Skill tool loads available runtime skills independently of this field.
agent.systemnull | stringSystem prompt given to the model at the start of every session of this agent; null when none was set.
agent.toolsarray<object>Tools of the agent: one agent_toolset_20260401 entry for the native tools (all resolved settings are returned, ready to send back on update), plus mcp_toolset entries; custom tool definitions are rejected with 400. Keep bash enabled to use codemode, Skill and subagents.
agent.typestringAlways `agent`. An agent definition.
agent.versionnumberThe agent's current version. Starts at 1 and increments each time the agent is modified.
archived_atnull | stringA timestamp in RFC 3339 format
budgetnull | objectA hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.
budget.max_list_costobjectA monetary amount in a specific currency.
budget.typestringAlways `limit`. A spending limit.
created_atstringA timestamp in RFC 3339 format
environment_idstringId of the environment recipe the session's sandbox was created from. Omitted when no recipe was selected, that is, for a light machine or the Computer chosen by computer_id.
metadataobjectFree-form string key/value pairs stored with the session, changed through sessions.update patch semantics.
outcome_evaluationsarray<object>Per-outcome evaluation state. One entry per `define_outcome` event sent to the session.
outcome_evaluations[].completed_atnull | stringA timestamp in RFC 3339 format
outcome_evaluations[].descriptionstringWhat the agent should produce.
outcome_evaluations[].explanationnull | stringGrader'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[].iterationnumber0-indexed revision cycle the outcome is currently on.
outcome_evaluations[].outcome_idstringServer-generated outc_ ID for this outcome.
outcome_evaluations[].resultstringCurrent 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[].typestringAlways `outcome_evaluation`. Record of one outcome evaluation.
resourcesarray<object>Resources attached to the session, at most 500; each is a file reference mounted into the session's machine.
resources[].idstringResource id, the resource_id of sessions.resources calls.
resources[].created_atstringA timestamp in RFC 3339 format
resources[].mount_pathstring | null | stringPath inside the machine where the file is mounted; defaults to /mnt/session/uploads/<file_id>, and custom paths are rooted there. / 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[].typestringAlways `github_repository`. A GitHub repository resource; not supported on this platform. / Always `file`. A file resource: an uploaded file mounted into the session's machine. / Always `memory_store`. A memory store resource; not supported on this platform.
resources[].updated_atstringA timestamp in RFC 3339 format
resources[].urlstringRepository URL.
resources[].checkoutnull | objectBranch or commit to check out.
resources[].file_idstringId of the uploaded file; it must exist and belong to your tenant.
resources[].memory_store_idstringThe memory store ID (memstore_...). Must belong to the caller's organization and workspace.
resources[].accessnull | stringAccess mode for an attached memory store.
resources[].descriptionstringDescription of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.
resources[].instructionsnull | stringPer-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.
resources[].namenull | stringDisplay name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.
statsobjectTiming statistics for a session.
stats.active_secondsnumberCumulative time in seconds the session spent in `running` status. Excludes idle time.
stats.duration_secondsnumberElapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
statusstringSessionStatus 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.
titlenull | stringTitle of the session, set on create or through sessions.update; null when none was set.
typestringAlways `session`. A session, one conversation of an agent on a machine.
updated_atstringA timestamp in RFC 3339 format
usageobjectCumulative token usage for a session across all turns.
usage.active_secondsnumberCumulative 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_creationobjectPrompt-cache creation token usage broken down by cache lifetime.
usage.cache_read_input_tokensnumberTotal tokens read from prompt cache.
usage.input_tokensnumberTotal input tokens consumed across all turns.
usage.list_costnull | objectA monetary amount in a specific currency.
usage.output_tokensnumberTotal output tokens generated across all turns.
usage.server_tool_usenull | objectCumulative count of server-executed tool invocations, broken down by tool.
vault_idsarray<string>Vault IDs attached to the session at creation. Empty when no vaults were supplied.
deployment_idnull | stringDeployment ID when the session was created from a deployment reference. Null otherwise.
cwdstringNormalized session working directory; defaults to /home/user/workspace. Forks inherit this directory.
computer_idstringPraxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. computer_id selects a tenant-owned active computer. Session selection overrides the agent default; a sandbox environment_id and computer_id cannot be combined. Omitted when no computer is selected.
modelobjectPraxis extension: the currently selected session model.
model.idstringIdentifier of the object, as returned by the API; pass it in the path of follow-up calls on the same resource.
model.thinkingobject | nullSupported thinking controls, or null when capability is unknown or unavailable. efforts lists selectable strengths; can_disable permits none; default_effort is nullable.
thinkingobject | nullPraxis extension: explicit session thinking effort; null inherits the pinned agent default, then the model default. none disables thinking only when model.thinking.can_disable is true. Unsupported efforts return 400 invalid_request_error.
thinking.effortstringThinking level saved for this session: low, medium, high, xhigh, or none to turn thinking off. Null or absent means the session inherits the agent default and then the model default.
forked_fromobject | nullPraxis extension: source of a forked session; null for other sessions. Available only on /agent/v1.
forked_from.session_idstringId of the parent session this session was forked from; it is left unchanged by the fork.
forked_from.message_idstringmessage_id of the agent message in the parent session up to which the conversation was copied.

Get Session Context (Extension)

GET /agent/v1/sessions/{session_id}/context● Supported

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

Returns

200

Praxis extension available only on /agent/v1, following Claude Agent SDK getContextUsage() with snake_case fields. detail is summary: the latest actual model usage takes precedence, and local estimates apportion source totals; used categories sum to total_tokens. Only nonzero sources appear. Classify rows by kind (used/free/buffer/deferred). key is a stable source identifier extension; clients must tolerate unknown keys and new sources, falling back to name. MCP tools group by server, plugin blocks by id, and compaction summaries are counted separately. excluded_items is currently zero. Before measurement, total_tokens, total_tokens_source and measured_at are null, categories is empty, and details are zero or empty arrays. Model selection recalculates max_tokens, auto_compact_threshold and free/buffer while preserving the latest measurement. is_auto_compact_enabled is false for unknown capacity or a tripped compaction breaker. For example model.thinking is {efforts: [high, xhigh], can_disable: true, default_effort: high}. model.thinking contains efforts, can_disable and nullable default_effort; the entire thinking value is null when capability is unknown. Missing or inaccessible sessions return 404.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Current model and latest context measurement

application/json

NameTypeDescription
typestringAlways `session_context`. Snapshot of a session's context window usage.
session_idstringSession whose context this snapshot describes.
modelobjectModel of the session and its context window facts.
model.idstringIdentifier of the object, as returned by the API; pass it in the path of follow-up calls on the same resource.
model.display_namestringHuman-readable name of the model.
model.thinkingobject | nullThinking capability of the model: supported efforts, whether thinking can be disabled, and the default. Null when the capability is unknown.
total_tokensnumber | nullTokens currently occupying the context window; null before the first measurement.
total_tokens_sourcestring | nullWhether total_tokens is the provider-reported input usage (actual) or a local estimate (estimated); null before the first measurement.
max_tokensnumber | nullContext window of the model in tokens; null when the model does not state one.
max_input_tokensnumber | nullMaximum input tokens the model accepts per request; null when not stated.
percentagenumberShare of the context window in use, as a whole-number percent; 0 when the window or usage is unknown.
auto_compact_thresholdnumber | nullToken count at which automatic compaction starts; null when the window is unknown.
is_auto_compact_enabledbooleanWhether automatic compaction is enabled for this session.
clear_tool_results_atnumberToken count at which old tool results are cleared from the context.
detailstringLevel of detail of the snapshot.
categoriesarray<object>Context usage by category; each row has a stable key and a kind.
categories[].keystringPraxis extension: stable source identifier (system, tools, mcp:<server>, plugin:<id>, messages, summary, free, buffer). Clients must tolerate unknown keys and newly added sources; classify rows by kind, not key or name.
categories[].namestringDisplay name of the category.
categories[].tokensnumberTokens used by the category.
categories[].kindstringHow the category counts against the window.
mcp_toolsarray<object>Tokens spent on the tool definitions of each MCP server.
mcp_tools[].namestringName of the MCP tool.
mcp_tools[].server_namestringName of the MCP server that provides the tool.
mcp_tools[].tokensnumberTokens used by the tool definition.
plugin_blocksarray<object>Tokens spent on context blocks injected by each mod.
plugin_blocks[].namestringName of the mod that injected the block.
plugin_blocks[].tokensnumberTokens used by the block.
message_breakdownobjectTokens in the conversation messages, split by role and tool traffic.
message_breakdown.user_message_tokensnumberTokens of user messages.
message_breakdown.assistant_message_tokensnumberTokens of assistant text messages.
message_breakdown.tool_call_tokensnumberTokens of tool-call arguments.
message_breakdown.tool_result_tokensnumberTokens of tool results.
message_breakdown.reasoning_tokensnumberTokens of reasoning content.
message_breakdown.tool_calls_by_typearray<object>Tool-call and tool-result tokens grouped by tool name.
compaction_summaryobject | nullTokens held by the latest compaction summary; null when the session was never compacted.
compaction_summary.tokensnumberTokens of the compaction summary.
excluded_itemsobjectItems removed from the context for content safety, kept for audit only and not counted as usage.
excluded_items.countnumberNumber of excluded items.
excluded_items.tokensnumberTokens of the excluded items.
measured_atstring | nullRFC 3339 time of the measurement; null before the first measurement.

List Session Background Tasks (Extension)

GET /agent/v1/sessions/{session_id}/background_tasks● Supported

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

Returns

200

Own-face extension. Returns { data: BackgroundTask[] }. Each task has id, kind, title, thread_id, status, started_at, ended_at, cancellable, notified_at and trigger_count. Subagent rows link to their child thread via thread_id; other kinds have null. kind is an open string; tolerate unknown kinds. Status is running, result_pending, completed, failed, cancelled or lost. Only completed tasks with pending delivery are result_pending. Timestamps are RFC3339; ended_at is null while running. notified_at is the admission time of the latest system notification batch, or null. trigger_count counts admitted monitor event batches, or is null without records and for other kinds. Only supported running tasks without stop intent are cancellable. Missing or inaccessible sessions return 404.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Session background tasks

application/json

NameTypeDescription
dataarray<object>Items of this page, in the order requested by the call.
data[].idstringIdentifier of the object, as returned by the API; pass it in the path of follow-up calls on the same resource.
data[].kindstringKind of background task: bash for a command started with run_in_background, monitor for a Monitor watch.
data[].titlestringShort human-readable title of the task or object.
data[].thread_idstring | nullExecution thread the task belongs to; null for the primary thread.
data[].statusstringCurrent lifecycle state.
data[].started_atstringRFC 3339 time at which the task started.
data[].ended_atstring | nullRFC 3339 time at which the task ended; null while it is running.
data[].cancellablebooleanWhether the task can still be stopped.
data[].notified_atstring | nullRFC 3339 time of the latest run that the task's notification started; null while no notification has been delivered.
data[].trigger_countinteger | nullFor a monitor task, how many times its matches woke the session; null for other kinds or before the first notification.

Get Background Task Output (Extension)

GET /agent/v1/sessions/{session_id}/background_tasks/{task_id}/output● Supported

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • task_idstring必填

    path: Background task id (task_...), as listed by sessions.background_tasks.list.

  • offsetinteger可选
    默认 0

    query: Byte offset into the task output to read from; start at 0 and continue with the next_offset of the previous response. Integer of at least 0, default 0.

  • max_bytesinteger可选
    默认 65536

    query: Maximum number of bytes to return: an integer from 1 to 262144, default 65536.

Returns

200

Own-face extension. offset defaults to 0; max_bytes defaults to 65536 and must be between 1 and 262144. Returns text, next_offset and eof. Offsets count UTF-8 bytes, not characters; partial trailing characters are retained for the next read. eof describes the current log, which may grow while running. A paused or missing sandbox returns empty text, the original offset, eof=true and unavailable=true, without waking it. Reading does not acknowledge model result delivery. Missing or inaccessible sessions or tasks return 404; invalid ranges return 400.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Background task output byte page

application/json

NameTypeDescription
textstringText of the block.
next_offsetintegerByte offset to pass as offset to continue reading the output.
eofbooleanTrue when the output has ended and no more bytes will follow.
unavailablebooleanTrue when the output could not be read; text is then empty.

Stop Background Task (Extension)

POST /agent/v1/sessions/{session_id}/background_tasks/{task_id}/stop● Supported

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • task_idstring必填

    path: Background task id (task_...), as listed by sessions.background_tasks.list.

Returns

200

Own-face extension. No request body is required. Uses the same stop implementation as TaskStop: records stop_requested_at and signals the process group. Returns BackgroundTask with the same fields as the list operation. Until termination is observed, status may remain running with cancellable=false. An ended or unsupported task returns 409. Missing or inaccessible sessions or tasks return 404.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Current task after stop request

application/json

NameTypeDescription
idstringIdentifier of the object, as returned by the API; pass it in the path of follow-up calls on the same resource.
kindstringKind of background task: bash for a command started with run_in_background, monitor for a Monitor watch.
titlestringShort human-readable title of the task or object.
thread_idstring | nullExecution thread the task belongs to; null for the primary thread.
statusstringCurrent lifecycle state.
started_atstringRFC 3339 time at which the task started.
ended_atstring | nullRFC 3339 time at which the task ended; null while it is running.
cancellablebooleanWhether the task can still be stopped.
notified_atstring | nullRFC 3339 time of the latest run that the task's notification started; null while no notification has been delivered.
trigger_countinteger | nullFor a monitor task, how many times its matches woke the session; null for other kinds or before the first notification.

Compact Session (Extension)

Call Create session first and replace the example session ID with its returned ID.

POST /agent/v1/sessions/{session_id}/compact● Supported

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • instructionsstring可选

    Optional focus instructions for the summary, passed to the summarizing model unchanged.

Returns

200

Available only on /agent/v1. The body may be omitted or {}. Optional instructions must be a string and is forwarded unchanged. Idempotency-Key is forwarded unchanged; a UUID is generated when absent. Returns { type: session_compaction, id, status, reason? }, where id is the operation ID. queued/running return 202; skipped/succeeded/failed return 200. Non-string instructions return 400 invalid_request_error. Missing or inaccessible managed sessions return 404 not_found_error.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Skipped, succeeded or failed compaction

application/json

NameTypeDescription
typestringAlways `session_compaction`. Result of a compaction request.
idstringCompaction operation id; pass it as operation_id to sessions.compact.retrieve.
statusstringState of the compaction operation: queued and running are in progress, skipped means nothing needed compaction, succeeded and failed are final.
reasonstringWhy the compaction was skipped or failed; absent otherwise.

HTTP 202

Queued or running compaction

application/json

NameTypeDescription
typestringAlways `session_compaction`. Result of a compaction request.
idstringCompaction operation id; pass it as operation_id to sessions.compact.retrieve.
statusstringState of the compaction operation: queued and running are in progress, skipped means nothing needed compaction, succeeded and failed are final.
reasonstringWhy the compaction was skipped or failed; absent otherwise.

Get Session Compaction (Extension)

Call Create session first and replace the example session ID with its returned ID.

GET /agent/v1/sessions/{session_id}/compact/{operation_id}● Supported

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • operation_idstring必填

    path: Compaction operation id returned by sessions.compact in the id field of the session_compaction object.

Returns

200

Available only on /agent/v1. Returns { type: session_compaction, id, status, reason? } with HTTP 200 for every status. A missing operation or inaccessible session returns 404 not_found_error.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Compaction operation

application/json

NameTypeDescription
typestringAlways `session_compaction`. Result of a compaction request.
idstringCompaction operation id; pass it as operation_id to sessions.compact.retrieve.
statusstringState of the compaction operation: queued and running are in progress, skipped means nothing needed compaction, succeeded and failed are final.
reasonstringWhy the compaction was skipped or failed; absent otherwise.

List Session Compactions (Extension)

Call Create session first and replace the example session ID with its returned ID.

GET /agent/v1/sessions/{session_id}/compactions● Supported

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

Returns

200

Available only on /agent/v1. Returns { data: [...] }. Each entry contains type, id, event_id, trigger, status, model, compacted_message_count, input_tokens_before, input_tokens_after, summary, error and created_at, as recorded by the service. Missing or inaccessible managed sessions return 404 not_found_error.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Compaction history

application/json

NameTypeDescription
dataarray<object>Items of this page, in the order requested by the call.
data[].typestringAlways `context_compaction`. Record of one past compaction.
data[].idstringCompaction record id.
data[].event_idstring | nullId of the agent.thread_context_compacted event emitted for this compaction; null when none.
data[].triggerstringWhat started the compaction.
data[].statusstringFinal outcome of the compaction.
data[].modelstringModel that wrote the summary.
data[].compacted_message_countnumberNumber of messages replaced by the summary.
data[].input_tokens_beforenumberContext tokens before the compaction.
data[].input_tokens_afternumber | nullContext tokens after the compaction; null when not measured.
data[].summarystring | nullSummary text that replaced the messages; null when the compaction failed.
data[].errorstring | nullFailure reason; null when the compaction succeeded.
data[].created_atstringRFC 3339 time at which the compaction was recorded.

List Events

Call Create session first and replace the example session ID with its returned ID.

GET /agent/v1/sessions/{session_id}/events● Supported

Official Claude documentation ↗

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • created_at[gt]string可选

    query: Return events created after this time (exclusive). Compared against the event's `processed_at` value.

  • created_at[gte]string可选

    query: Return events created at or after this time (inclusive). Compared against the event's `processed_at` value.

  • created_at[lt]string可选

    query: Return events created before this time (exclusive). Compared against the event's `processed_at` value.

  • created_at[lte]string可选

    query: Return events created at or before this time (inclusive). Compared against the event's `processed_at` value.

  • orderstring可选

    query: Order by processed time: asc chronological (default), desc the reverse.

  • typesarray可选

    query: Filter by event type; values match the returned events' type field (e.g. user.message, agent.tool_use). Omit for all types.

  • limitnumber可选

    query: Number of items per page.

  • pagestring可选

    query: Opaque pagination cursor: pass the next_page value of the previous response unchanged. Omit it for the first page. A cursor from a different query or a malformed one returns 400.

Returns

200

Send a message before reading history. Until processing finishes, only admitted input may be visible. Pagination, event type and time filters are supported. A session waiting for tool approval pauses on session.status_idle with stop_reason requires_action, whose event_ids list the agent.tool_use events to confirm. A failed run emits session.error before session.status_terminated. agent.thinking carries the thinking text in content. When searching or reading web pages, tool results use official search_result blocks on both API surfaces. Answer text blocks carry citations as an /agent/v1 extension; /anthropic renders answer references as [n] in the text.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
dataarray<object>Items of this page, in the order requested by the call.
data[].idstringUnique identifier for this event. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer. / Event id, unique within the session. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer. / Event id, unique within the session.
data[].contentarray<object>Array of content blocks comprising the user message. / The result content returned by the tool. / Array of text blocks comprising the agent response. / The result content returned by the tool. / The result content returned by the tool. / Message content blocks. / Message content blocks. / The result content returned by the tool. / System content blocks. Text-only.
data[].typestringAlways `user.message`. A message from the user to the agent, with content blocks. / Always `user.interrupt`. The user interrupted the running turn. / Always `user.tool_confirmation`. The user's decision to allow or deny a tool call that waits for approval. / Always `user.custom_tool_result`. The user's result for a custom tool call. / Always `agent.custom_tool_use`. The agent called a custom tool defined by the client. / Always `agent.message`. A message from the agent, with text content blocks. / Always `agent.thinking`. The agent's thinking text for a step. / Always `agent.mcp_tool_use`. The agent called an MCP tool. / Always `agent.mcp_tool_result`. The result of an MCP tool call. / Always `agent.tool_use`. The agent called a tool. / Always `agent.tool_result`. The result of a tool call. / Always `agent.thread_message_received`. The agent received a message from another thread. / Always `agent.thread_message_sent`. The agent sent a message to another thread. / Always `agent.thread_context_compacted`. The thread's context was compacted into a summary. / Always `session.error`. The session hit an error. / Always `session.status_rescheduled`. The session will retry after a recoverable error. / Always `session.status_running`. The session started running a turn. / Always `session.status_idle`. The session stopped running; stop_reason says why. / Always `session.status_terminated`. The session ended and accepts no more work. / Always `session.thread_created`. A child thread was started. / Always `span.outcome_evaluation_start`. An outcome evaluation started. / Always `span.outcome_evaluation_end`. An outcome evaluation ended. / Always `span.model_request_start`. A model request started. / Always `span.model_request_end`. A model request ended, with its usage. / Always `span.outcome_evaluation_ongoing`. An outcome evaluation is still running. / Always `user.define_outcome`. The user defined the outcome the agent should reach. / Always `session.deleted`. The session was deleted. / Always `session.thread_status_running`. A thread started running. / Always `session.thread_status_idle`. A thread stopped running; stop_reason says why. / Always `session.thread_status_terminated`. A thread ended. / Always `user.tool_result`. The user's result for a client-side tool call. / Always `session.thread_status_rescheduled`. A thread will retry after a recoverable error. / Always `session.updated`. The session's model, title, metadata, agent or budget changed. / Always `system.message`. A message produced by the platform rather than the user or the agent. / Always `session.usage`. Cumulative usage of the session. / Always `session.forked`. The session was created by forking another session. / Always `session.goal_changed`. / Always `session.goal_verification`. / Always `user.steer`. Receipt that a queued user.message was injected into the running turn. / Always `user.tool_confirmation`.
data[].processed_atnull | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | null | string | string | string | null | string | string | string | string | string | string | stringA timestamp in RFC 3339 format / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / When the event was recorded, RFC 3339. / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / When the event was recorded, RFC 3339.
data[].message_idstringUI transcript message ID. Use the last assistant message in a successfully completed turn as the fork target. / UI transcript message ID shared with this assistant's message parts.
data[].session_thread_idnull | string | string | string | string | string | null | string | stringIf absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread. / Set by the server to the subagent thread this confirmation was routed to. Omitted when it was routed to the primary thread. / Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread. / When set, this event was cross-posted from a subagent's thread to surface its custom tool use on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.custom_tool_result` by `custom_tool_use_id`, so clients do not send it back. / When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` by `tool_use_id`, so clients do not send it back. / When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` or `user.tool_result` by `tool_use_id`, so clients do not send it back. / Public `sthr_` ID of the newly created thread. / Public sthr_ ID of the thread that started running. / Public sthr_ ID of the thread that went idle. / Public sthr_ ID of the thread that terminated. / Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread. / Public sthr_ ID of the thread that is retrying.
data[].resultstringUserToolConfirmationResult enum / Evaluation verdict. 'satisfied': criteria met, session goes idle. 'needs_revision': criteria not met, another revision cycle follows. 'max_iterations_reached': evaluation budget exhausted with criteria still unmet — one final acknowledgment turn follows before the session goes idle, but no further evaluation runs. 'failed': grader determined the rubric does not apply to the deliverables. 'interrupted': user sent an interrupt while evaluation was in progress. / Always `allow`.
data[].tool_use_idstringThe id of the `agent.tool_use` or `agent.mcp_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field. / The id of the `agent.tool_use` event this result corresponds to. / The id of the `agent.tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field. / The id of the AskUserQuestion `agent.tool_use` event this answers.
data[].deny_messagenull | stringOptional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
data[].custom_tool_use_idstringThe id of the `agent.custom_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field.
data[].is_errornull | booleanWhether the tool execution resulted in an error. / Whether the model request resulted in an error. / Whether the tool execution resulted in an error.
data[].inputobjectInput parameters for the tool call.
data[].namestringName of the custom tool being called. / Name of the MCP tool being used. / Name of the agent tool being used.
data[].mcp_server_namestringName of the MCP server providing the tool.
data[].evaluated_permissionstringAgentEvaluatedPermission enum
data[].evaluationobjectNames the resolved permission_policy that produced evaluated_permission, and under auto carries the judgement. Open union: clients must tolerate unknown variants.
data[]._metaobjectPraxis extension (MCP Apps, SEP-1865): the `ui` and `openai/ui` keys of the MCP tool definition's `_meta`, verbatim; other `_meta` keys are not exposed. When `ui.resourceUri` is a `ui://` URI, the tool has an interactive view: a client that implements MCP Apps can fetch that resource from the MCP server and render it for this call. Absent when the tool declares neither key. Clients that do not render MCP Apps ignore it. / Praxis extension (MCP Apps, SEP-1865): the MCP CallToolResult `_meta`, verbatim. Views use it for data that should not reach the model; absent when the tool returned none.
data[].sourcestringPraxis extension (MCP Apps, SEP-1865): `app` when the call was made by an MCP Apps view, `codemode` when a program run by the codemode tool called an MCP tool that declares a view (the event pair exists so a client can render that view; the model already has the result in the codemode tool result); absent for the model's own calls. / What caused the change.
data[].parent_tool_use_idstringPraxis extension (MCP Apps, SEP-1865): present when `source` is `codemode`; the id of the codemode tool use whose program made this call. Absent otherwise.
data[].mcp_tool_use_idstringThe id of the `agent.mcp_tool_use` event this result corresponds to.
data[].structured_contentanyPraxis extension (MCP Apps, SEP-1865): the MCP CallToolResult `structuredContent`, verbatim JSON. MCP Apps views read it as the data to render; absent when the tool returned none.
data[].from_session_thread_idstringPublic `sthr_` ID of the thread that sent the message.
data[].from_agent_namenull | stringName of the callable agent this message came from. Absent when received from the primary agent.
data[].to_session_thread_idstringPublic `sthr_` ID of the thread the message was sent to.
data[].to_agent_namenull | stringName of the callable agent this message was sent to. Absent when sent to the primary agent.
data[].errorobjectDescription of the error and what the client should do next.
data[].stop_reasonobjectWhy the session stopped running, with the variant data needed to continue.
data[].agent_namestringName of the callable agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs.
data[].iterationnumber0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc. / 0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`. / 0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`.
data[].outcome_idstringThe `outc_` ID of the outcome being evaluated. / Server-generated `outc_` ID for this outcome. Referenced by `span.outcome_evaluation_*` events and the session's `outcome_evaluations` list.
data[].explanationstringHuman-readable explanation of the verdict. For `needs_revision`, describes which criteria failed and why.
data[].outcome_evaluation_start_idstringThe id of the corresponding `span.outcome_evaluation_start` event.
data[].usageobjectToken usage for a single model request. / Point-in-time snapshot of a session's cumulative usage.
data[].model_request_start_idstringThe id of the corresponding `span.model_request_start` event.
data[].model_usageobjectToken usage for a single model request.
data[].descriptionstringWhat the agent should produce. Copied from the input event.
data[].max_iterationsnull | numberEvaluate-then-revise cycles before giving up. Default 3, max 20.
data[].rubricobjectRubric for grading the quality of an outcome.
data[].agentnull | objectResolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
data[].budgetnull | objectA hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.
data[].metadataobjectThe session's full metadata bag after the update. Present when the update set non-empty metadata; absent when metadata was unchanged or cleared to empty.
data[].titlenull | stringThe session's new title. Present only when the update changed it.
data[].modelobjectPraxis extension: the changed session model, present only on /agent/v1 session.updated events. Model-only updates are omitted on /anthropic.
data[].forked_from_session_idstringId of the parent session this session was forked from.
data[].forked_from_message_idstringmessage_id of the agent message in the parent session up to which the conversation was copied.
data[].actionstringWhat changed in the goal.
data[].goalobject | nullThe goal as the change left it, or null when the session has no goal.
data[].previous_goalobject | nullThe goal before the change, or null when there was none.
data[].statusstringWhere the check stands. Read `verification.passed` on the closing event to know whether the goal counts as done.
data[].goal_idstringThe goal this check belongs to.
data[].goal_iterationintegerWhich check of this goal, matching `iteration` on the goal.
data[].verification_idstringIdentifier shared by every event of one check.
data[].anchor_message_idstring | nullThe assistant message the check follows, or null.
data[].verificationobjectThe verdict; absent on `started`.
data[].event_idstringId of the event this event refers to.
data[].answersobjectThe user's answer to each question, keyed by the question text; empty when the questions were dismissed.
data[].annotationsobjectPer-question notes, keyed by the question text.
next_pagestring | nullOpaque cursor for the next page: pass it unchanged as page to continue. Null when this is the last page.

Call Create session first and replace the example session ID with its returned ID.

POST /agent/v1/sessions/{session_id}/events◐ Partial

Official Claude documentation ↗

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • eventsarray必填

    Events to send to the session.

Returns

200

Each user.message accepts exactly one nonempty text block. Replace sesn_123 with your session id. Text user.message, user.interrupt and tool confirmation are supported. To guide a running turn, send a user.steer event with event_id referencing a queued user.message. Current tools continue; the message enters the next model request. The user.steer receipt has its own processed_at; repeated marking returns the same receipt. Processing or withdrawn inputs return 409; missing events return 404. Pending approvals defer injection. If the turn ends first, the input runs normally from the queue. Ordinary messages remain queued by default. This extension is unavailable on /anthropic. The response acknowledges inputs; read replies from event history or the stream. A user.message sent while the session waits for tool approval is queued: the returned event has processed_at null and runs in order once the approval is resolved. When allowing a tool call, copy its permission_suggestions into updated_permissions to remember similar operations for this conversation; dangerous operations offer no suggestions to remember. When searching or reading web pages, tool results use official search_result blocks on both API surfaces. Answer text blocks carry citations as an /agent/v1 extension; /anthropic renders answer references as [n] in the text.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
dataarray<object>Sent events
data[].idstringUnique identifier for this event. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer. / Event id, unique within the session.
data[].contentarray<object>Array of content blocks comprising the user message. / The result content returned by the tool. / The result content returned by the tool. / System content blocks. Text-only.
data[].typestringAlways `user.message`. A message from the user to the agent, with content blocks. / Always `user.interrupt`. The user interrupted the running turn. / Always `user.tool_confirmation`. The user's decision to allow or deny a tool call that waits for approval. / Always `user.custom_tool_result`. The user's result for a custom tool call. / Always `user.define_outcome`. The user defined the outcome the agent should reach. / Always `user.tool_result`. The user's result for a client-side tool call. / Always `system.message`. A message produced by the platform rather than the user or the agent. / Always `user.steer`. Receipt that a queued user.message was injected into the running turn. / Always `user.tool_confirmation`.
data[].processed_atnull | string | string | null | string | null | string | string | stringA timestamp in RFC 3339 format / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / When the event was recorded, RFC 3339.
data[].session_thread_idnull | stringIf absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread. / Set by the server to the subagent thread this confirmation was routed to. Omitted when it was routed to the primary thread. / Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread. / Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread.
data[].resultstringUserToolConfirmationResult enum / Always `allow`.
data[].tool_use_idstringThe id of the `agent.tool_use` or `agent.mcp_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field. / The id of the `agent.tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field. / The id of the AskUserQuestion `agent.tool_use` event this answers.
data[].deny_messagenull | stringOptional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
data[].custom_tool_use_idstringThe id of the `agent.custom_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field.
data[].is_errornull | booleanWhether the tool execution resulted in an error.
data[].descriptionstringWhat the agent should produce. Copied from the input event.
data[].max_iterationsnull | numberEvaluate-then-revise cycles before giving up. Default 3, max 20.
data[].outcome_idstringServer-generated `outc_` ID for this outcome. Referenced by `span.outcome_evaluation_*` events and the session's `outcome_evaluations` list.
data[].rubricobjectRubric for grading the quality of an outcome.
data[].event_idstringId of the event this event refers to.
data[].answersobjectThe user's answer to each question, keyed by the question text; empty when the questions were dismissed.
data[].annotationsobjectPer-question notes, keyed by the question text.

Call Create session first and replace the example session ID with its returned ID.

GET /agent/v1/sessions/{session_id}/events/stream◐ Partial

Official Claude documentation ↗

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • event_deltasarray可选

    query: When set, this connection also receives streaming deltas (`event_start`, `event_delta`) while an event is being produced, before the event itself arrives. Deltas are best-effort; when the final event is produced it carries the complete content. A model request that ends early (an error or interrupt) produces no final event — its terminal `span.model_request_end` closes the preview. Accepts one or more event types to preview and may be repeated: `agent.message` streams `content_delta` fragments; `agent.thinking` is start-only — a signal that the agent has begun extended thinking, concluded by the `agent.thinking` event itself. Only previews of the requested event types are sent.

Returns

200

Keep the SSE connection open and send a message in another request after replacing sesn_123. Stopping the stream disconnects the subscription, not the agent. SDK 0.124.0 filters session.usage; read history for full usage. Pass event_deltas[]=agent.message or event_deltas[]=agent.thinking to receive incremental previews (event_start and event_delta) before the final event. Pass event_deltas[]=agent.tool_use to receive input_json_delta fragments while tool arguments are being generated. When searching or reading web pages, tool results use official search_result blocks on both API surfaces. Answer text blocks carry citations as an /agent/v1 extension; /anthropic renders answer references as [n] in the text.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Server-sent events

text/event-stream — chunk / event object

NameTypeDescription
idstringIdentifier of the object, as returned by the API; pass it in the path of follow-up calls on the same resource.
eventstringServer-Sent Events event name of this frame. / Always `user.message`. SSE event name of this frame; its data is a user.message payload. A message from the user to the agent, with content blocks. / Always `user.interrupt`. SSE event name of this frame; its data is a user.interrupt payload. The user interrupted the running turn. / Always `agent.message`. SSE event name of this frame; its data is a agent.message payload. A message from the agent, with text content blocks. / Always `agent.thinking`. SSE event name of this frame; its data is a agent.thinking payload. The agent's thinking text for a step. / Always `session.status_running`. SSE event name of this frame; its data is a session.status_running payload. The session started running a turn. / Always `session.status_rescheduled`. SSE event name of this frame; its data is a session.status_rescheduled payload. The session will retry after a recoverable error. / Always `session.status_idle`. SSE event name of this frame; its data is a session.status_idle payload. The session stopped running; stop_reason says why. / Always `session.status_terminated`. SSE event name of this frame; its data is a session.status_terminated payload. The session ended and accepts no more work. / Always `agent.thread_context_compacted`. SSE event name of this frame; its data is a agent.thread_context_compacted payload. The thread's context was compacted into a summary. / Always `agent.thread_context_reset`. SSE event name of this frame; its data is a agent.thread_context_reset payload. Content was removed from the model's context after a content-safety refusal. / Always `session.updated`. SSE event name of this frame; its data is a session.updated payload. The session's model, title, metadata, agent or budget changed. / Always `session.error`. SSE event name of this frame; its data is a session.error payload. The session hit an error. / Always `session.usage`. SSE event name of this frame; its data is a session.usage payload. Cumulative usage of the session. / Always `span.model_request_start`. SSE event name of this frame; its data is a span.model_request_start payload. A model request started. / Always `span.model_request_end`. SSE event name of this frame; its data is a span.model_request_end payload. A model request ended, with its usage. / Always `agent.tool_use`. SSE event name of this frame; its data is a agent.tool_use payload. The agent called a tool. / Always `agent.tool_result`. SSE event name of this frame; its data is a agent.tool_result payload. The result of a tool call. / Always `agent.mcp_tool_use`. SSE event name of this frame; its data is a agent.mcp_tool_use payload. The agent called an MCP tool. / Always `agent.mcp_tool_result`. SSE event name of this frame; its data is a agent.mcp_tool_result payload. The result of an MCP tool call. / Always `user.tool_confirmation`. SSE event name of this frame; its data is a user.tool_confirmation payload. The user's decision to allow or deny a tool call that waits for approval. / Always `session.thread_created`. SSE event name of this frame; its data is a session.thread_created payload. A child thread was started. / Always `session.thread_status_running`. SSE event name of this frame; its data is a session.thread_status_running payload. A thread started running. / Always `session.thread_status_idle`. SSE event name of this frame; its data is a session.thread_status_idle payload. A thread stopped running; stop_reason says why. / Always `session.thread_status_rescheduled`. SSE event name of this frame; its data is a session.thread_status_rescheduled payload. A thread will retry after a recoverable error. / Always `session.thread_status_terminated`. SSE event name of this frame; its data is a session.thread_status_terminated payload. A thread ended. / Always `agent.thread_message_sent`. SSE event name of this frame; its data is a agent.thread_message_sent payload. The agent sent a message to another thread. / Always `agent.thread_message_received`. SSE event name of this frame; its data is a agent.thread_message_received payload. The agent received a message from another thread. / Always `user.withdraw`. SSE event name of this frame; its data is a user.withdraw payload. A queued user.message was withdrawn before it ran. / Always `user.steer`. SSE event name of this frame; its data is a user.steer payload. Receipt that a queued user.message was injected into the running turn. / Always `system.notification`. SSE event name of this frame; its data is a system.notification payload. Background work woke the session with a notification. / Always `session.forked`. SSE event name of this frame; its data is a session.forked payload. The session was created by forking another session. / Always `session.goal_changed`. SSE event name of this frame; its data is a session.goal_changed payload. The session's goal was set, changed status, accounted usage or was cleared. / Always `session.goal_verification`. SSE event name of this frame; its data is a session.goal_verification payload. One completion check of the session's goal started or ended. / Always `event_start`. SSE event name of this frame; its data is a event_start payload. Preview that an event of the requested delta types has started. / Always `event_delta`. SSE event name of this frame; its data is a event_delta payload. Incremental fragment of the event being produced. / Always `ping`. SSE event name of this frame; its data is a ping payload. Keep-alive frame; carries no data. / Always `error`. SSE event name of this frame; its data is a error payload. A stream error.
dataobjectDecoded JSON payload of this frame; its shape is selected by the event name. / Praxis extension (AskUserQuestion, own face only): the confirmation of an AskUserQuestion call, with the answers it carried. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Praxis extension (goal mode, own face only): the session's goal was set, moved to another status, accounted usage or was cleared. `goal` is the goal after the change, `previous_goal` the one before; each is null when there was none. / Praxis extension (goal mode, own face only): one completion check of the goal. A `started` event opens it; `completed`, `failed_closed` or `cancelled` closes it. Events of one check share `verification_id`. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name.
data.idstringUnique identifier for this event. / Text of the block. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Event id, unique within the session. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Text of the block. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer. / Text of the block. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer. / Event id, unique within the session. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Text of the block. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Event id, unique within the session. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Text of the block. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer. / Text of the block. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer. / Event id, unique within the session. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer.
data.contentarray<object>Array of content blocks comprising the user message. / Array of text blocks comprising the agent response. / Content blocks of the event, in order. / The result content returned by the tool. / The result content returned by the tool. / Message content blocks. / Message content blocks. / Array of content blocks comprising the user message. / Array of text blocks comprising the agent response. / Content blocks of the event, in order. / The result content returned by the tool. / The result content returned by the tool. / Message content blocks. / Message content blocks.
data.typestringAlways `user.message`. A message from the user to the agent, with content blocks. / Always `user.interrupt`. The user interrupted the running turn. / Always `agent.message`. A message from the agent, with text content blocks. / Always `agent.thinking`. The agent's thinking text for a step. / Always `session.status_running`. The session started running a turn. / Always `session.status_rescheduled`. The session will retry after a recoverable error. / Always `session.status_idle`. The session stopped running; stop_reason says why. / Always `session.status_terminated`. The session ended and accepts no more work. / Always `agent.thread_context_compacted`. The thread's context was compacted into a summary. / Always `agent.thread_context_reset`. Content was removed from the model's context after a content-safety refusal. / Always `session.updated`. The session's model, title, metadata, agent or budget changed. / Always `session.error`. The session hit an error. / Always `session.usage`. Cumulative usage of the session. / Always `span.model_request_start`. A model request started. / Always `span.model_request_end`. A model request ended, with its usage. / Always `agent.tool_use`. The agent called a tool. / Always `agent.tool_result`. The result of a tool call. / Always `agent.mcp_tool_use`. The agent called an MCP tool. / Always `agent.mcp_tool_result`. The result of an MCP tool call. / Always `user.tool_confirmation`. / Always `session.thread_created`. A child thread was started. / Always `session.thread_status_running`. A thread started running. / Always `session.thread_status_idle`. A thread stopped running; stop_reason says why. / Always `session.thread_status_rescheduled`. A thread will retry after a recoverable error. / Always `session.thread_status_terminated`. A thread ended. / Always `agent.thread_message_sent`. The agent sent a message to another thread. / Always `agent.thread_message_received`. The agent received a message from another thread. / Always `user.withdraw`. A queued user.message was withdrawn before it ran. / Always `user.steer`. Receipt that a queued user.message was injected into the running turn. / Always `system.notification`. Background work woke the session with a notification. / Always `session.forked`. The session was created by forking another session. / Always `session.goal_changed`. / Always `session.goal_verification`. / Always `event_start`. Preview that an event of the requested delta types has started. / Always `event_delta`. Incremental fragment of the event being produced. / Always `ping`. Keep-alive frame; carries no data. / Always `error`. A stream error. / Always `user.message`. A message from the user to the agent, with content blocks. / Always `user.interrupt`. The user interrupted the running turn. / Always `agent.message`. A message from the agent, with text content blocks. / Always `agent.thinking`. The agent's thinking text for a step. / Always `session.status_running`. The session started running a turn. / Always `session.status_rescheduled`. The session will retry after a recoverable error. / Always `session.status_idle`. The session stopped running; stop_reason says why. / Always `session.status_terminated`. The session ended and accepts no more work. / Always `agent.thread_context_compacted`. The thread's context was compacted into a summary. / Always `agent.thread_context_reset`. Content was removed from the model's context after a content-safety refusal. / Always `session.updated`. The session's model, title, metadata, agent or budget changed. / Always `session.error`. The session hit an error. / Always `session.usage`. Cumulative usage of the session. / Always `span.model_request_start`. A model request started. / Always `span.model_request_end`. A model request ended, with its usage. / Always `agent.tool_use`. The agent called a tool. / Always `agent.tool_result`. The result of a tool call. / Always `agent.mcp_tool_use`. The agent called an MCP tool. / Always `agent.mcp_tool_result`. The result of an MCP tool call. / Always `user.tool_confirmation`. / Always `session.thread_created`. A child thread was started. / Always `session.thread_status_running`. A thread started running. / Always `session.thread_status_idle`. A thread stopped running; stop_reason says why. / Always `session.thread_status_rescheduled`. A thread will retry after a recoverable error. / Always `session.thread_status_terminated`. A thread ended. / Always `agent.thread_message_sent`. The agent sent a message to another thread. / Always `agent.thread_message_received`. The agent received a message from another thread. / Always `user.withdraw`. A queued user.message was withdrawn before it ran. / Always `user.steer`. Receipt that a queued user.message was injected into the running turn. / Always `system.notification`. Background work woke the session with a notification. / Always `session.forked`. The session was created by forking another session. / Always `session.goal_changed`. / Always `session.goal_verification`. / Always `event_start`. Preview that an event of the requested delta types has started. / Always `event_delta`. Incremental fragment of the event being produced. / Always `ping`. Keep-alive frame; carries no data. / Always `error`. A stream error.
data.processed_atnull | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | null | string | null | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | stringA timestamp in RFC 3339 format / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / When the event was recorded, RFC 3339. / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / When the event was recorded, RFC 3339. / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / When the event was recorded, RFC 3339. / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / When the event was recorded, RFC 3339. / RFC 3339 time at which the server processed the event; null while a queued input has not started running.
data.message_idstringUI transcript message ID. Use the last assistant message in a successfully completed turn as the fork target. / UI transcript message ID shared with this assistant's message parts. / UI transcript message ID. Use the last assistant message in a successfully completed turn as the fork target. / UI transcript message ID. Use the last assistant message in a successfully completed turn as the fork target. / UI transcript message ID shared with this assistant's message parts.
data.session_thread_idnull | string | string | null | string | null | string | string | string | string | string | string | string | string | null | string | string | null | string | null | string | string | string | string | string | string | string | stringIf absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread. / Text of the block. / When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` or `user.tool_result` by `tool_use_id`, so clients do not send it back. / When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` by `tool_use_id`, so clients do not send it back. / Public `sthr_` ID of the newly created thread. / Public sthr_ ID of the thread that started running. / Public sthr_ ID of the thread that went idle. / Public sthr_ ID of the thread that is retrying. / Public sthr_ ID of the thread that terminated. / Text of the block. / Text of the block. / If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread. / Text of the block. / When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` or `user.tool_result` by `tool_use_id`, so clients do not send it back. / When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` by `tool_use_id`, so clients do not send it back. / Public `sthr_` ID of the newly created thread. / Public sthr_ ID of the thread that started running. / Public sthr_ ID of the thread that went idle. / Public sthr_ ID of the thread that is retrying. / Public sthr_ ID of the thread that terminated. / Text of the block. / Text of the block.
data.stop_reasonobjectWhy the session stopped running, with the variant data needed to continue.
data.removedarray<object>Content removed from the model's context by this reset.
data.categorystringText of the block.
data.stoppedbooleanTrue when the run was stopped instead of retried after the reset.
data.agentnull | objectResolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
data.budgetnull | objectA hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.
data.metadataobjectThe session's full metadata bag after the update. Present when the update set non-empty metadata; absent when metadata was unchanged or cleared to empty.
data.titlenull | stringThe session's new title. Present only when the update changed it.
data.modelobjectPraxis extension: the changed session model, present only on /agent/v1 session.updated events. Model-only updates are omitted on /anthropic.
data.errorobjectDescription of the error and what the client should do next. / Error detail. / Description of the error and what the client should do next. / Error detail.
data.usageobjectPoint-in-time snapshot of a session's cumulative usage.
data.is_errornull | booleanWhether the model request resulted in an error. / Whether the tool execution resulted in an error. / Whether the tool execution resulted in an error. / Whether the model request resulted in an error. / Whether the tool execution resulted in an error. / Whether the tool execution resulted in an error.
data.model_request_start_idstringThe id of the corresponding `span.model_request_start` event.
data.model_usageobjectToken usage for a single model request.
data.inputobjectInput parameters for the tool call.
data.namestringName of the agent tool being used. / Name of the MCP tool being used. / Name of the agent tool being used. / Name of the MCP tool being used.
data.evaluated_permissionstringAgentEvaluatedPermission enum
data.evaluationobjectNames the resolved permission_policy that produced evaluated_permission, and under auto carries the judgement. Open union: clients must tolerate unknown variants.
data.tool_use_idstringThe id of the `agent.tool_use` event this result corresponds to. / The id of the AskUserQuestion `agent.tool_use` event this answers. / The id of the `agent.tool_use` event this result corresponds to. / The id of the AskUserQuestion `agent.tool_use` event this answers.
data.mcp_server_namestringName of the MCP server providing the tool.
data._metaobjectPraxis extension (MCP Apps, SEP-1865): the `ui` and `openai/ui` keys of the MCP tool definition's `_meta`, verbatim; other `_meta` keys are not exposed. When `ui.resourceUri` is a `ui://` URI, the tool has an interactive view: a client that implements MCP Apps can fetch that resource from the MCP server and render it for this call. Absent when the tool declares neither key. Clients that do not render MCP Apps ignore it. / Praxis extension (MCP Apps, SEP-1865): the MCP CallToolResult `_meta`, verbatim. Views use it for data that should not reach the model; absent when the tool returned none. / Praxis extension (MCP Apps, SEP-1865): the `ui` and `openai/ui` keys of the MCP tool definition's `_meta`, verbatim; other `_meta` keys are not exposed. When `ui.resourceUri` is a `ui://` URI, the tool has an interactive view: a client that implements MCP Apps can fetch that resource from the MCP server and render it for this call. Absent when the tool declares neither key. Clients that do not render MCP Apps ignore it. / Praxis extension (MCP Apps, SEP-1865): the MCP CallToolResult `_meta`, verbatim. Views use it for data that should not reach the model; absent when the tool returned none.
data.sourcestringPraxis extension (MCP Apps, SEP-1865): `app` when the call was made by an MCP Apps view, `codemode` when a program run by the codemode tool called an MCP tool that declares a view (the event pair exists so a client can render that view; the model already has the result in the codemode tool result); absent for the model's own calls. / What caused the change. / Praxis extension (MCP Apps, SEP-1865): `app` when the call was made by an MCP Apps view, `codemode` when a program run by the codemode tool called an MCP tool that declares a view (the event pair exists so a client can render that view; the model already has the result in the codemode tool result); absent for the model's own calls. / Praxis extension (MCP Apps, SEP-1865): `app` when the call was made by an MCP Apps view, `codemode` when a program run by the codemode tool called an MCP tool that declares a view (the event pair exists so a client can render that view; the model already has the result in the codemode tool result); absent for the model's own calls. / What caused the change.
data.parent_tool_use_idstringPraxis extension (MCP Apps, SEP-1865): present when `source` is `codemode`; the id of the codemode tool use whose program made this call. Absent otherwise.
data.mcp_tool_use_idstringThe id of the `agent.mcp_tool_use` event this result corresponds to.
data.structured_contentanyPraxis extension (MCP Apps, SEP-1865): the MCP CallToolResult `structuredContent`, verbatim JSON. MCP Apps views read it as the data to render; absent when the tool returned none.
data.resultstringAlways `allow`.
data.answersobjectThe user's answer to each question, keyed by the question text; empty when the questions were dismissed.
data.annotationsobjectPer-question notes, keyed by the question text.
data.agent_namestringName of the callable agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the callable agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs.
data.to_session_thread_idstringPublic `sthr_` ID of the thread the message was sent to.
data.to_agent_namenull | stringName of the callable agent this message was sent to. Absent when sent to the primary agent.
data.from_session_thread_idstringPublic `sthr_` ID of the thread that sent the message.
data.from_agent_namenull | stringName of the callable agent this message came from. Absent when received from the primary agent.
data.event_idstringText of the block. / Id of the event this event refers to. / Text of the block. / Text of the block. / Id of the event this event refers to. / Text of the block.
data.sourcesarray<object>Background work that woke the session with this notification.
data.forked_from_session_idstringId of the parent session this session was forked from.
data.forked_from_message_idstringmessage_id of the agent message in the parent session up to which the conversation was copied.
data.actionstringWhat changed in the goal.
data.goalobject | nullThe goal as the change left it, or null when the session has no goal.
data.previous_goalobject | nullThe goal before the change, or null when there was none.
data.statusstringWhere the check stands. Read `verification.passed` on the closing event to know whether the goal counts as done.
data.goal_idstringThe goal this check belongs to.
data.goal_iterationintegerWhich check of this goal, matching `iteration` on the goal.
data.verification_idstringIdentifier shared by every event of one check.
data.anchor_message_idstring | nullThe assistant message the check follows, or null.
data.verificationobjectThe verdict; absent on `started`.
data.eventobjectEvent name or event payload.
data.deltaobjectIncremental fragment of the event being produced.

Receive over WebSocket

The same address also accepts a read-only WebSocket over wss://, one frame per event, suited to long-lived server connections. Connection, frame format, close codes and limits: Subscribe to events over WebSocket.

Subscribe to events over WebSocket

Besides pulling session events with Stream events (SSE), you can receive them over a WebSocket on the same address: one frame per event, with exactly the same event data as SSE. This is an access mode the platform offers in addition to the official SSE, suited to a server that keeps a long-lived connection and forwards events into your own system.

wss://api.deepraxis.com/agent/v1/sessions/{session_id}/events/stream

The connection is read-only: it only pushes events and accepts no messages. Sending messages and interrupting still go through Send events.

Handshake and authentication

The handshake carries the same auth headers as the HTTP endpoints: Authorization: Bearer <API Key> or x-api-key: <API Key>.

A browser's native WebSocket cannot set request headers, so this is a server-side surface. In a browser, use SSE, or let your server open the connection and relay it to the front end.

When the handshake fails, no connection is opened and the server answers with an HTTP error (body format in Errors):

CaseResponse
No credential, or the key is invalid or disabled401
The session does not exist, or is not in this key's workspace404
In-flight requests exceed the key's concurrency limit429, see Rate limits

An open WebSocket, like an in-progress SSE, holds one of the key's concurrency slots until it closes.

Frames

Every frame is one JSON text. After connecting, the first frame is a ready notice:

{"type":"session.events.ready"}

After that, each event produced in the session arrives as one frame, and its event field is the SSE event data:

{"type":"session.event","event":{"id":"d4dc3d96-…","type":"agent.message","processed_at":"2026-09-26T13:35:04.906Z","content":[{"type":"text","text":"OK"}]}}
FieldMeaning
typesession.events.ready (ready, sent once) or session.event (one event)
eventOnly on session.event frames; same shape as a single event from List events

The same event can arrive more than once. A user.message, for example, first appears with processed_at: null (accepted, pending) and again with a timestamp once processed. Deduplicate by event.id and keep the latest.

Close codes

CodeMeaningWhat to do
1000The server ended the subscription normallyReconnect if you still need events
1008The client sent a message on the connectionThe connection is read-only; send no frames
1011Internal server interruptionReconnect and backfill with List events
1013A limit was exceeded for now (see below)Reconnect and backfill with List events

Limits

  • One connection pushes at most about 512 KB of events in total, then closes with 1013. Be ready to reconnect on long sessions.
  • The server retries its internal connection to the session automatically; if repeated retries fail, it also closes with 1013.

Disconnects and backfill

Events produced while you are disconnected are not replayed. After reconnecting, fill the gap with List events by time:

GET /agent/v1/sessions/{session_id}/events?order=asc&created_at[gt]=<processed_at of the last event you received>

Backfilled events and newly pushed ones can overlap; deduplicate by event.id.

Examples

Bun (the built-in WebSocket supports headers):

const ws = new WebSocket(
  `wss://api.deepraxis.com/agent/v1/sessions/${sessionId}/events/stream`,
  { headers: { Authorization: `Bearer ${process.env.PRAXIS_API_KEY}` } },
);
ws.addEventListener("message", (message) => {
  const frame = JSON.parse(String(message.data));
  if (frame.type === "session.events.ready") console.log("ready");
  if (frame.type === "session.event") console.log(frame.event.type, frame.event);
});
ws.addEventListener("close", (close) => console.log("closed", close.code));

Node (the ws package):

import WebSocket from "ws";

const ws = new WebSocket(
  `wss://api.deepraxis.com/agent/v1/sessions/${sessionId}/events/stream`,
  { headers: { Authorization: `Bearer ${process.env.PRAXIS_API_KEY}` } },
);
ws.on("message", (data) => {
  const frame = JSON.parse(String(data));
  if (frame.type === "session.event") console.log(frame.event.type, frame.event);
});
ws.on("close", (code) => console.log("closed", code));

Python (the websockets package):

import asyncio, json, os
import websockets

async def main(session_id: str):
    url = f"wss://api.deepraxis.com/agent/v1/sessions/{session_id}/events/stream"
    headers = {"Authorization": f"Bearer {os.environ['PRAXIS_API_KEY']}"}
    async with websockets.connect(url, additional_headers=headers) as ws:
        async for message in ws:
            frame = json.loads(message)
            if frame["type"] == "session.event":
                print(frame["event"]["type"], frame["event"])

asyncio.run(main("sesn_123"))

Call Create session first and replace the example session ID with its returned ID.

POST /agent/v1/sessions/{session_id}◐ Partial

Official Claude documentation ↗

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • modelstring可选

    Extension: model ID from the session’s pinned version models.allowed, or its default model when no list exists. Applies on the next turn without interrupting the current turn. No context-window check is performed here.

  • agentobject可选

    The agent the session runs: an agent ID string (pins the latest version) or an object with id and version (see subfields).

    ▸ 展开子字段(2)
    • mcp_serversarray可选

      Replacement MCP server list for this session: the provided array applies wholesale; an empty array clears, omitting keeps the agent's configuration.

    • toolsarray可选

      Replacement tool configuration for this session; an empty array clears, omitting keeps the agent's.

  • titlestring可选

    Human-readable session title.

  • metadataobject可选

    Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve.

  • budgetobject可选

    A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.

    ▸ 展开子字段(2)
    • max_list_costobject必填

      Cap on list-call spending within the budget.

    • typestring必填

      Budget type; only max_list_cost today.

      取值 limit
  • vault_idsarray可选

    Vault IDs (`vlt_*`) to attach to the session. Not yet supported; requests setting this field are rejected. Reserved for future use.

  • thinkingobject可选

    Praxis extension: explicit session thinking effort; null inherits the pinned agent default, then the model default. none disables thinking only when model.thinking.can_disable is true. Unsupported efforts return 400 invalid_request_error.

    ▸ 展开子字段(1)
    • effortstring必填

      Thinking level for this session. The model must support the chosen effort; none requires can_disable. Null on thinking restores inheritance from the agent and model.

      取值 lowmediumhighxhighnone

Returns

200

Optional model is an ID in the pinned version allowed list; thinking is {effort: "low|medium|high|xhigh|none"} or null. Omission preserves the selection; null restores inheritance. A model-only change clears unsupported session thinking. Combined updates validate against the new model; invalid choices return 400 and preserve the previous selection. Changes affect the next turn, not an in-flight turn. Example: {"model":"deepseek-v4-flash","thinking":{"effort":"xhigh"}}. Responses include thinking and model.thinking: {efforts, can_disable, default_effort}; unknown capability is null. These fields are available only on /agent/v1. 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 and vault_ids are not supported and return 400 naming the field. Updating an archived session returns 409.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
idstringSession id (sesn_...). Pass it as session_id in every session call.
agentobjectResolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
agent.idstringAgent id (agent_...). Pass it as agent when creating a session and as agent_id in agent calls.
agent.descriptionnull | stringFree-text description of what the agent is for; null when none was set.
agent.mcp_serversarray<object>URL MCP servers the agent can call, paired one-to-one with mcp_toolset entries in tools and saved with the agent version. No credentials are stored here.
agent.modelobjectModel identifier and configuration.
agent.multiagentnull | objectResolved coordinator topology with full agent definitions for each roster member.
agent.namestringDisplay name of the agent, as set on create or update. It is a label, not a unique key.
agent.skillsarray<object>Skill attachments are not supported: a nonempty skills array returns 400. Omit this field or send an empty array. The native Skill tool loads available runtime skills independently of this field.
agent.systemnull | stringSystem prompt given to the model at the start of every session of this agent; null when none was set.
agent.toolsarray<object>Tools of the agent: one agent_toolset_20260401 entry for the native tools (all resolved settings are returned, ready to send back on update), plus mcp_toolset entries; custom tool definitions are rejected with 400. Keep bash enabled to use codemode, Skill and subagents.
agent.typestringAlways `agent`. An agent definition.
agent.versionnumberThe agent's current version. Starts at 1 and increments each time the agent is modified.
archived_atnull | stringA timestamp in RFC 3339 format
budgetnull | objectA hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.
budget.max_list_costobjectA monetary amount in a specific currency.
budget.typestringAlways `limit`. A spending limit.
created_atstringA timestamp in RFC 3339 format
environment_idstringId of the environment recipe the session's sandbox was created from. Omitted when no recipe was selected, that is, for a light machine or the Computer chosen by computer_id.
metadataobjectFree-form string key/value pairs stored with the session, changed through sessions.update patch semantics.
outcome_evaluationsarray<object>Per-outcome evaluation state. One entry per `define_outcome` event sent to the session.
outcome_evaluations[].completed_atnull | stringA timestamp in RFC 3339 format
outcome_evaluations[].descriptionstringWhat the agent should produce.
outcome_evaluations[].explanationnull | stringGrader'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[].iterationnumber0-indexed revision cycle the outcome is currently on.
outcome_evaluations[].outcome_idstringServer-generated outc_ ID for this outcome.
outcome_evaluations[].resultstringCurrent 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[].typestringAlways `outcome_evaluation`. Record of one outcome evaluation.
resourcesarray<object>Resources attached to the session, at most 500; each is a file reference mounted into the session's machine.
resources[].idstringResource id, the resource_id of sessions.resources calls.
resources[].created_atstringA timestamp in RFC 3339 format
resources[].mount_pathstring | null | stringPath inside the machine where the file is mounted; defaults to /mnt/session/uploads/<file_id>, and custom paths are rooted there. / 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[].typestringAlways `github_repository`. A GitHub repository resource; not supported on this platform. / Always `file`. A file resource: an uploaded file mounted into the session's machine. / Always `memory_store`. A memory store resource; not supported on this platform.
resources[].updated_atstringA timestamp in RFC 3339 format
resources[].urlstringRepository URL.
resources[].checkoutnull | objectBranch or commit to check out.
resources[].file_idstringId of the uploaded file; it must exist and belong to your tenant.
resources[].memory_store_idstringThe memory store ID (memstore_...). Must belong to the caller's organization and workspace.
resources[].accessnull | stringAccess mode for an attached memory store.
resources[].descriptionstringDescription of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.
resources[].instructionsnull | stringPer-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.
resources[].namenull | stringDisplay name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.
statsobjectTiming statistics for a session.
stats.active_secondsnumberCumulative time in seconds the session spent in `running` status. Excludes idle time.
stats.duration_secondsnumberElapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
statusstringSessionStatus 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.
titlenull | stringTitle of the session, set on create or through sessions.update; null when none was set.
typestringAlways `session`. A session, one conversation of an agent on a machine.
updated_atstringA timestamp in RFC 3339 format
usageobjectCumulative token usage for a session across all turns.
usage.active_secondsnumberCumulative 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_creationobjectPrompt-cache creation token usage broken down by cache lifetime.
usage.cache_read_input_tokensnumberTotal tokens read from prompt cache.
usage.input_tokensnumberTotal input tokens consumed across all turns.
usage.list_costnull | objectA monetary amount in a specific currency.
usage.output_tokensnumberTotal output tokens generated across all turns.
usage.server_tool_usenull | objectCumulative count of server-executed tool invocations, broken down by tool.
vault_idsarray<string>Vault IDs attached to the session at creation. Empty when no vaults were supplied.
deployment_idnull | stringDeployment ID when the session was created from a deployment reference. Null otherwise.
cwdstringNormalized session working directory; defaults to /home/user/workspace. Forks inherit this directory.
computer_idstringPraxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. computer_id selects a tenant-owned active computer. Session selection overrides the agent default; a sandbox environment_id and computer_id cannot be combined. Omitted when no computer is selected.
modelobjectPraxis extension: the currently selected session model.
model.idstringIdentifier of the object, as returned by the API; pass it in the path of follow-up calls on the same resource.
model.thinkingobject | nullSupported thinking controls, or null when capability is unknown or unavailable. efforts lists selectable strengths; can_disable permits none; default_effort is nullable.
thinkingobject | nullPraxis extension: explicit session thinking effort; null inherits the pinned agent default, then the model default. none disables thinking only when model.thinking.can_disable is true. Unsupported efforts return 400 invalid_request_error.
thinking.effortstringThinking level saved for this session: low, medium, high, xhigh, or none to turn thinking off. Null or absent means the session inherits the agent default and then the model default.
forked_fromobject | nullPraxis extension: source of a forked session; null for other sessions. Available only on /agent/v1.
forked_from.session_idstringId of the parent session this session was forked from; it is left unchanged by the fork.
forked_from.message_idstringmessage_id of the agent message in the parent session up to which the conversation was copied.

Archive Session

Call Create session first and replace the example session ID with its returned ID.

POST /agent/v1/sessions/{session_id}/archive● Supported

Official Claude documentation ↗

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

Returns

200

Archived sessions refuse new messages with 400 invalid_request_error naming the archived session; retrieval and event history stay readable. Re-archiving is idempotent and archived_at keeps the first archive time.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
idstringSession id (sesn_...). Pass it as session_id in every session call.
agentobjectResolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
agent.idstringAgent id (agent_...). Pass it as agent when creating a session and as agent_id in agent calls.
agent.descriptionnull | stringFree-text description of what the agent is for; null when none was set.
agent.mcp_serversarray<object>URL MCP servers the agent can call, paired one-to-one with mcp_toolset entries in tools and saved with the agent version. No credentials are stored here.
agent.modelobjectModel identifier and configuration.
agent.multiagentnull | objectResolved coordinator topology with full agent definitions for each roster member.
agent.namestringDisplay name of the agent, as set on create or update. It is a label, not a unique key.
agent.skillsarray<object>Skill attachments are not supported: a nonempty skills array returns 400. Omit this field or send an empty array. The native Skill tool loads available runtime skills independently of this field.
agent.systemnull | stringSystem prompt given to the model at the start of every session of this agent; null when none was set.
agent.toolsarray<object>Tools of the agent: one agent_toolset_20260401 entry for the native tools (all resolved settings are returned, ready to send back on update), plus mcp_toolset entries; custom tool definitions are rejected with 400. Keep bash enabled to use codemode, Skill and subagents.
agent.typestringAlways `agent`. An agent definition.
agent.versionnumberThe agent's current version. Starts at 1 and increments each time the agent is modified.
archived_atnull | stringA timestamp in RFC 3339 format
budgetnull | objectA hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.
budget.max_list_costobjectA monetary amount in a specific currency.
budget.typestringAlways `limit`. A spending limit.
created_atstringA timestamp in RFC 3339 format
environment_idstringId of the environment recipe the session's sandbox was created from. Omitted when no recipe was selected, that is, for a light machine or the Computer chosen by computer_id.
metadataobjectFree-form string key/value pairs stored with the session, changed through sessions.update patch semantics.
outcome_evaluationsarray<object>Per-outcome evaluation state. One entry per `define_outcome` event sent to the session.
outcome_evaluations[].completed_atnull | stringA timestamp in RFC 3339 format
outcome_evaluations[].descriptionstringWhat the agent should produce.
outcome_evaluations[].explanationnull | stringGrader'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[].iterationnumber0-indexed revision cycle the outcome is currently on.
outcome_evaluations[].outcome_idstringServer-generated outc_ ID for this outcome.
outcome_evaluations[].resultstringCurrent 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[].typestringAlways `outcome_evaluation`. Record of one outcome evaluation.
resourcesarray<object>Resources attached to the session, at most 500; each is a file reference mounted into the session's machine.
resources[].idstringResource id, the resource_id of sessions.resources calls.
resources[].created_atstringA timestamp in RFC 3339 format
resources[].mount_pathstring | null | stringPath inside the machine where the file is mounted; defaults to /mnt/session/uploads/<file_id>, and custom paths are rooted there. / 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[].typestringAlways `github_repository`. A GitHub repository resource; not supported on this platform. / Always `file`. A file resource: an uploaded file mounted into the session's machine. / Always `memory_store`. A memory store resource; not supported on this platform.
resources[].updated_atstringA timestamp in RFC 3339 format
resources[].urlstringRepository URL.
resources[].checkoutnull | objectBranch or commit to check out.
resources[].file_idstringId of the uploaded file; it must exist and belong to your tenant.
resources[].memory_store_idstringThe memory store ID (memstore_...). Must belong to the caller's organization and workspace.
resources[].accessnull | stringAccess mode for an attached memory store.
resources[].descriptionstringDescription of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.
resources[].instructionsnull | stringPer-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.
resources[].namenull | stringDisplay name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.
statsobjectTiming statistics for a session.
stats.active_secondsnumberCumulative time in seconds the session spent in `running` status. Excludes idle time.
stats.duration_secondsnumberElapsed time since session creation in seconds. For terminated sessions, frozen at the final update.
statusstringSessionStatus 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.
titlenull | stringTitle of the session, set on create or through sessions.update; null when none was set.
typestringAlways `session`. A session, one conversation of an agent on a machine.
updated_atstringA timestamp in RFC 3339 format
usageobjectCumulative token usage for a session across all turns.
usage.active_secondsnumberCumulative 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_creationobjectPrompt-cache creation token usage broken down by cache lifetime.
usage.cache_read_input_tokensnumberTotal tokens read from prompt cache.
usage.input_tokensnumberTotal input tokens consumed across all turns.
usage.list_costnull | objectA monetary amount in a specific currency.
usage.output_tokensnumberTotal output tokens generated across all turns.
usage.server_tool_usenull | objectCumulative count of server-executed tool invocations, broken down by tool.
vault_idsarray<string>Vault IDs attached to the session at creation. Empty when no vaults were supplied.
deployment_idnull | stringDeployment ID when the session was created from a deployment reference. Null otherwise.
cwdstringNormalized session working directory; defaults to /home/user/workspace. Forks inherit this directory.
computer_idstringPraxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. computer_id selects a tenant-owned active computer. Session selection overrides the agent default; a sandbox environment_id and computer_id cannot be combined. Omitted when no computer is selected.
modelobjectPraxis extension: the currently selected session model.
model.idstringIdentifier of the object, as returned by the API; pass it in the path of follow-up calls on the same resource.
model.thinkingobject | nullSupported thinking controls, or null when capability is unknown or unavailable. efforts lists selectable strengths; can_disable permits none; default_effort is nullable.
thinkingobject | nullPraxis extension: explicit session thinking effort; null inherits the pinned agent default, then the model default. none disables thinking only when model.thinking.can_disable is true. Unsupported efforts return 400 invalid_request_error.
thinking.effortstringThinking level saved for this session: low, medium, high, xhigh, or none to turn thinking off. Null or absent means the session inherits the agent default and then the model default.
forked_fromobject | nullPraxis extension: source of a forked session; null for other sessions. Available only on /agent/v1.
forked_from.session_idstringId of the parent session this session was forked from; it is left unchanged by the fork.
forked_from.message_idstringmessage_id of the agent message in the parent session up to which the conversation was copied.

Call Create session first and replace the example session ID with its returned ID.

GET /agent/v1/sessions/{session_id}/threads◐ Partial

Official Claude documentation ↗

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • limitnumber可选

    query: Number of items per page.

  • pagestring可选

    query: Opaque pagination cursor: pass the next_page value of the previous response unchanged. Omit it for the first page. A cursor from a different query or a malformed one returns 400.

Returns

200

Returns the primary thread and every child thread in created_at order. Thread ids use sthr_ plus the owning session suffix; children reference the primary parent_thread_id and retain the parent session_id. agent describes the actual running definition; built-in types use their type name and null for unregistered id/version. Archived children have status terminated and archived_at. stats/usage remain null without thread-level tracking.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
dataarray<object>Items of this page, in the order requested by the call.
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[].typestringAlways `session_thread`. An execution thread of a session.
data[].updated_atstringA timestamp in RFC 3339 format
data[].usagenull | objectCumulative token usage for a session thread across all turns.
next_pagestring | nullOpaque cursor for the next page: pass it unchanged as page to continue. Null when this is the last page.

Call Create session first and replace the example session ID with its returned ID.

GET /agent/v1/sessions/{session_id}/threads/{thread_id}◐ Partial

Official Claude documentation ↗

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • thread_idstring必填

    path: Execution thread id (sthr_...), as listed by sessions.threads.list; the primary thread id equals the session's own thread. Unknown or foreign ids return 404.

  • session_idstring必填

    query: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

Returns

200

Returns a primary or child thread belonging to this session, field-for-field identical to its list item. Foreign, unknown and malformed thread ids uniformly return 404 without revealing existence.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
idstringUnique identifier for this thread.
agentobjectThe resolved agent a `session_thread` runs.
agent.modelstring | objectThe advisor model id. / Model identifier and configuration.
agent.typestringAlways `advisor`. An advisor whose model is consulted for advice in a separate thread (at most one per coordinator). / Always `agent`. A roster member that refers to an agent by id and pinned version.
agent.idstringAgent id (agent_...). Pass it as agent when creating a session and as agent_id in agent calls.
agent.descriptionnull | stringFree-text description of what the agent is for; null when none was set.
agent.mcp_serversarray<object>URL MCP servers the agent can call, paired one-to-one with mcp_toolset entries in tools and saved with the agent version. No credentials are stored here.
agent.namestringDisplay name of the agent, as set on create or update. It is a label, not a unique key.
agent.skillsarray<object>Skill attachments are not supported: a nonempty skills array returns 400. Omit this field or send an empty array. The native Skill tool loads available runtime skills independently of this field.
agent.systemnull | stringSystem prompt given to the model at the start of every session of this agent; null when none was set.
agent.toolsarray<object>Tools of the agent: one agent_toolset_20260401 entry for the native tools (all resolved settings are returned, ready to send back on update), plus mcp_toolset entries; custom tool definitions are rejected with 400. Keep bash enabled to use codemode, Skill and subagents.
agent.versionnumberThe agent's current version. Starts at 1 and increments each time the agent is modified.
archived_atnull | stringA timestamp in RFC 3339 format
created_atstringA timestamp in RFC 3339 format
parent_thread_idnull | stringParent thread that spawned this thread. Null for the primary thread.
session_idstringThe session this thread belongs to.
statsnull | objectTiming statistics for a session thread.
stats.active_secondsnumberCumulative time in seconds the thread spent actively running. Excludes idle time.
stats.duration_secondsnumberElapsed time since thread creation in seconds. For archived threads, frozen at the final update.
stats.startup_secondsnumberTime in seconds for the thread to begin running. Zero for child threads, which start immediately.
statusstringSessionThreadStatus enum
typestringAlways `session_thread`. An execution thread of a session.
updated_atstringA timestamp in RFC 3339 format
usagenull | objectCumulative token usage for a session thread across all turns.
usage.active_secondsnumberCumulative 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_creationobjectPrompt-cache creation token usage broken down by cache lifetime.
usage.cache_read_input_tokensnumberTotal tokens read from prompt cache.
usage.input_tokensnumberTotal input tokens consumed across all turns.
usage.list_costnull | objectA monetary amount in a specific currency.
usage.output_tokensnumberTotal output tokens generated across all turns.
usage.server_tool_usenull | objectCumulative count of server-executed tool invocations, broken down by tool.

Call Create session first and replace the example session ID with its returned ID.

GET /agent/v1/sessions/{session_id}/threads/{thread_id}/events◐ Partial

Official Claude documentation ↗

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • thread_idstring必填

    path: Execution thread id (sthr_...), as listed by sessions.threads.list; the primary thread id equals the session's own thread. Unknown or foreign ids return 404.

  • session_idstring必填

    query: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • limitnumber可选

    query: Number of items per page.

  • pagestring可选

    query: Opaque pagination cursor: pass the next_page value of the previous response unchanged. Omit it for the first page. A cursor from a different query or a malformed one returns 400.

Returns

200

Reads the selected thread ledger: the primary session for the primary thread, or the child session for a child thread. Uses the session event query parameters, public event types and data + next_page envelope. Web tools return search_result blocks on both APIs; answer citations are an /agent/v1 extension, rendered as [n] on /anthropic.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
dataarray<object>Items of this page, in the order requested by the call.
data[].idstringUnique identifier for this event. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer. / Event id, unique within the session. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer.
data[].contentarray<object>Array of content blocks comprising the user message. / The result content returned by the tool. / Array of text blocks comprising the agent response. / The result content returned by the tool. / The result content returned by the tool. / Message content blocks. / Message content blocks. / The result content returned by the tool. / System content blocks. Text-only.
data[].typestringAlways `user.message`. A message from the user to the agent, with content blocks. / Always `user.interrupt`. The user interrupted the running turn. / Always `user.tool_confirmation`. The user's decision to allow or deny a tool call that waits for approval. / Always `user.custom_tool_result`. The user's result for a custom tool call. / Always `agent.custom_tool_use`. The agent called a custom tool defined by the client. / Always `agent.message`. A message from the agent, with text content blocks. / Always `agent.thinking`. The agent's thinking text for a step. / Always `agent.mcp_tool_use`. The agent called an MCP tool. / Always `agent.mcp_tool_result`. The result of an MCP tool call. / Always `agent.tool_use`. The agent called a tool. / Always `agent.tool_result`. The result of a tool call. / Always `agent.thread_message_received`. The agent received a message from another thread. / Always `agent.thread_message_sent`. The agent sent a message to another thread. / Always `agent.thread_context_compacted`. The thread's context was compacted into a summary. / Always `session.error`. The session hit an error. / Always `session.status_rescheduled`. The session will retry after a recoverable error. / Always `session.status_running`. The session started running a turn. / Always `session.status_idle`. The session stopped running; stop_reason says why. / Always `session.status_terminated`. The session ended and accepts no more work. / Always `session.thread_created`. A child thread was started. / Always `span.outcome_evaluation_start`. An outcome evaluation started. / Always `span.outcome_evaluation_end`. An outcome evaluation ended. / Always `span.model_request_start`. A model request started. / Always `span.model_request_end`. A model request ended, with its usage. / Always `span.outcome_evaluation_ongoing`. An outcome evaluation is still running. / Always `user.define_outcome`. The user defined the outcome the agent should reach. / Always `session.deleted`. The session was deleted. / Always `session.thread_status_running`. A thread started running. / Always `session.thread_status_idle`. A thread stopped running; stop_reason says why. / Always `session.thread_status_terminated`. A thread ended. / Always `user.tool_result`. The user's result for a client-side tool call. / Always `session.thread_status_rescheduled`. A thread will retry after a recoverable error. / Always `session.updated`. The session's model, title, metadata, agent or budget changed. / Always `system.message`. A message produced by the platform rather than the user or the agent. / Always `session.usage`. Cumulative usage of the session. / Always `session.forked`. The session was created by forking another session. / Always `session.goal_changed`. / Always `session.goal_verification`. / Always `user.steer`. Receipt that a queued user.message was injected into the running turn.
data[].processed_atnull | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | null | string | string | string | null | string | string | string | string | string | stringA timestamp in RFC 3339 format / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / When the event was recorded, RFC 3339. / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / RFC 3339 time at which the server processed the event; null while a queued input has not started running.
data[].message_idstringUI transcript message ID. Use the last assistant message in a successfully completed turn as the fork target. / UI transcript message ID shared with this assistant's message parts.
data[].session_thread_idnull | string | string | string | string | string | null | string | stringIf absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread. / Set by the server to the subagent thread this confirmation was routed to. Omitted when it was routed to the primary thread. / Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread. / When set, this event was cross-posted from a subagent's thread to surface its custom tool use on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.custom_tool_result` by `custom_tool_use_id`, so clients do not send it back. / When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` by `tool_use_id`, so clients do not send it back. / When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` or `user.tool_result` by `tool_use_id`, so clients do not send it back. / Public `sthr_` ID of the newly created thread. / Public sthr_ ID of the thread that started running. / Public sthr_ ID of the thread that went idle. / Public sthr_ ID of the thread that terminated. / Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread. / Public sthr_ ID of the thread that is retrying.
data[].resultstringUserToolConfirmationResult enum / Evaluation verdict. 'satisfied': criteria met, session goes idle. 'needs_revision': criteria not met, another revision cycle follows. 'max_iterations_reached': evaluation budget exhausted with criteria still unmet — one final acknowledgment turn follows before the session goes idle, but no further evaluation runs. 'failed': grader determined the rubric does not apply to the deliverables. 'interrupted': user sent an interrupt while evaluation was in progress.
data[].tool_use_idstringThe id of the `agent.tool_use` or `agent.mcp_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field. / The id of the `agent.tool_use` event this result corresponds to. / The id of the `agent.tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field.
data[].deny_messagenull | stringOptional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
data[].custom_tool_use_idstringThe id of the `agent.custom_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field.
data[].is_errornull | booleanWhether the tool execution resulted in an error. / Whether the model request resulted in an error. / Whether the tool execution resulted in an error.
data[].inputobjectInput parameters for the tool call.
data[].namestringName of the custom tool being called. / Name of the MCP tool being used. / Name of the agent tool being used.
data[].mcp_server_namestringName of the MCP server providing the tool.
data[].evaluated_permissionstringAgentEvaluatedPermission enum
data[].evaluationobjectNames the resolved permission_policy that produced evaluated_permission, and under auto carries the judgement. Open union: clients must tolerate unknown variants.
data[].parent_tool_use_idstringPraxis extension (MCP Apps, SEP-1865): present when `source` is `codemode`; the id of the codemode tool use whose program made this call. Absent otherwise.
data[]._metaobjectPraxis extension (MCP Apps, SEP-1865): the `ui` and `openai/ui` keys of the MCP tool definition's `_meta`, verbatim; other `_meta` keys are not exposed. When `ui.resourceUri` is a `ui://` URI, the tool has an interactive view: a client that implements MCP Apps can fetch that resource from the MCP server and render it for this call. Absent when the tool declares neither key. Clients that do not render MCP Apps ignore it. / Praxis extension (MCP Apps, SEP-1865): the MCP CallToolResult `_meta`, verbatim. Views use it for data that should not reach the model; absent when the tool returned none.
data[].sourcestringPraxis extension (MCP Apps, SEP-1865): `app` when the call was made by an MCP Apps view, `codemode` when a program run by the codemode tool called an MCP tool that declares a view (the event pair exists so a client can render that view; the model already has the result in the codemode tool result); absent for the model's own calls. / What caused the change.
data[].mcp_tool_use_idstringThe id of the `agent.mcp_tool_use` event this result corresponds to.
data[].structured_contentanyPraxis extension (MCP Apps, SEP-1865): the MCP CallToolResult `structuredContent`, verbatim JSON. MCP Apps views read it as the data to render; absent when the tool returned none.
data[].from_session_thread_idstringPublic `sthr_` ID of the thread that sent the message.
data[].from_agent_namenull | stringName of the callable agent this message came from. Absent when received from the primary agent.
data[].to_session_thread_idstringPublic `sthr_` ID of the thread the message was sent to.
data[].to_agent_namenull | stringName of the callable agent this message was sent to. Absent when sent to the primary agent.
data[].errorobjectDescription of the error and what the client should do next.
data[].stop_reasonobjectWhy the session stopped running, with the variant data needed to continue.
data[].agent_namestringName of the callable agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs.
data[].iterationnumber0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc. / 0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`. / 0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`.
data[].outcome_idstringThe `outc_` ID of the outcome being evaluated. / Server-generated `outc_` ID for this outcome. Referenced by `span.outcome_evaluation_*` events and the session's `outcome_evaluations` list.
data[].explanationstringHuman-readable explanation of the verdict. For `needs_revision`, describes which criteria failed and why.
data[].outcome_evaluation_start_idstringThe id of the corresponding `span.outcome_evaluation_start` event.
data[].usageobjectToken usage for a single model request. / Point-in-time snapshot of a session's cumulative usage.
data[].model_request_start_idstringThe id of the corresponding `span.model_request_start` event.
data[].model_usageobjectToken usage for a single model request.
data[].descriptionstringWhat the agent should produce. Copied from the input event.
data[].max_iterationsnull | numberEvaluate-then-revise cycles before giving up. Default 3, max 20.
data[].rubricobjectRubric for grading the quality of an outcome.
data[].agentnull | objectResolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
data[].budgetnull | objectA hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.
data[].metadataobjectThe session's full metadata bag after the update. Present when the update set non-empty metadata; absent when metadata was unchanged or cleared to empty.
data[].titlenull | stringThe session's new title. Present only when the update changed it.
data[].modelobjectPraxis extension: the changed session model, present only on /agent/v1 session.updated events. Model-only updates are omitted on /anthropic.
data[].forked_from_session_idstringId of the parent session this session was forked from.
data[].forked_from_message_idstringmessage_id of the agent message in the parent session up to which the conversation was copied.
data[].actionstringWhat changed in the goal.
data[].goalobject | nullThe goal as the change left it, or null when the session has no goal.
data[].previous_goalobject | nullThe goal before the change, or null when there was none.
data[].statusstringWhere the check stands. Read `verification.passed` on the closing event to know whether the goal counts as done.
data[].goal_idstringThe goal this check belongs to.
data[].goal_iterationintegerWhich check of this goal, matching `iteration` on the goal.
data[].verification_idstringIdentifier shared by every event of one check.
data[].anchor_message_idstring | nullThe assistant message the check follows, or null.
data[].verificationobjectThe verdict; absent on `started`.
data[].event_idstringId of the event this event refers to.
next_pagestring | nullOpaque cursor for the next page: pass it unchanged as page to continue. Null when this is the last page.

Call Create session first and replace the example session ID with its returned ID.

GET /agent/v1/sessions/{session_id}/threads/{thread_id}/stream◐ Partial

Official Claude documentation ↗

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • thread_idstring必填

    path: Execution thread id (sthr_...), as listed by sessions.threads.list; the primary thread id equals the session's own thread. Unknown or foreign ids return 404.

  • session_idstring必填

    query: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • event_deltasarray可选

    query: When set, this connection also receives streaming deltas (`event_start`, `event_delta`) while an event is being produced, before the event itself arrives. Deltas are best-effort; when the final event is produced it carries the complete content. A model request that ends early (an error or interrupt) produces no final event — its terminal `span.model_request_end` closes the preview. Accepts one or more event types to preview and may be repeated: `agent.message` streams `content_delta` fragments; `agent.thinking` is start-only — a signal that the agent has begun extended thinking, concluded by the `agent.thinking` event itself. Only previews of the requested event types are sent.

Returns

200

Subscribes to the selected thread live ledger using the session SSE implementation; the /agent API also supports a read-only WebSocket. The parent stream includes child creation, status and message events. Child approvals carry session_thread_id; confirmations and interrupts targeting that id are routed to the owned child.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Server-sent events

text/event-stream — chunk / event object

NameTypeDescription
idstringIdentifier of the object, as returned by the API; pass it in the path of follow-up calls on the same resource.
eventstringServer-Sent Events event name of this frame. / Always `user.message`. SSE event name of this frame; its data is a user.message payload. A message from the user to the agent, with content blocks. / Always `user.interrupt`. SSE event name of this frame; its data is a user.interrupt payload. The user interrupted the running turn. / Always `agent.message`. SSE event name of this frame; its data is a agent.message payload. A message from the agent, with text content blocks. / Always `agent.thinking`. SSE event name of this frame; its data is a agent.thinking payload. The agent's thinking text for a step. / Always `session.status_running`. SSE event name of this frame; its data is a session.status_running payload. The session started running a turn. / Always `session.status_rescheduled`. SSE event name of this frame; its data is a session.status_rescheduled payload. The session will retry after a recoverable error. / Always `session.status_idle`. SSE event name of this frame; its data is a session.status_idle payload. The session stopped running; stop_reason says why. / Always `session.status_terminated`. SSE event name of this frame; its data is a session.status_terminated payload. The session ended and accepts no more work. / Always `agent.thread_context_compacted`. SSE event name of this frame; its data is a agent.thread_context_compacted payload. The thread's context was compacted into a summary. / Always `agent.thread_context_reset`. SSE event name of this frame; its data is a agent.thread_context_reset payload. Content was removed from the model's context after a content-safety refusal. / Always `session.updated`. SSE event name of this frame; its data is a session.updated payload. The session's model, title, metadata, agent or budget changed. / Always `session.error`. SSE event name of this frame; its data is a session.error payload. The session hit an error. / Always `session.usage`. SSE event name of this frame; its data is a session.usage payload. Cumulative usage of the session. / Always `span.model_request_start`. SSE event name of this frame; its data is a span.model_request_start payload. A model request started. / Always `span.model_request_end`. SSE event name of this frame; its data is a span.model_request_end payload. A model request ended, with its usage. / Always `agent.tool_use`. SSE event name of this frame; its data is a agent.tool_use payload. The agent called a tool. / Always `agent.tool_result`. SSE event name of this frame; its data is a agent.tool_result payload. The result of a tool call. / Always `agent.mcp_tool_use`. SSE event name of this frame; its data is a agent.mcp_tool_use payload. The agent called an MCP tool. / Always `agent.mcp_tool_result`. SSE event name of this frame; its data is a agent.mcp_tool_result payload. The result of an MCP tool call. / Always `user.tool_confirmation`. SSE event name of this frame; its data is a user.tool_confirmation payload. The user's decision to allow or deny a tool call that waits for approval. / Always `session.thread_created`. SSE event name of this frame; its data is a session.thread_created payload. A child thread was started. / Always `session.thread_status_running`. SSE event name of this frame; its data is a session.thread_status_running payload. A thread started running. / Always `session.thread_status_idle`. SSE event name of this frame; its data is a session.thread_status_idle payload. A thread stopped running; stop_reason says why. / Always `session.thread_status_rescheduled`. SSE event name of this frame; its data is a session.thread_status_rescheduled payload. A thread will retry after a recoverable error. / Always `session.thread_status_terminated`. SSE event name of this frame; its data is a session.thread_status_terminated payload. A thread ended. / Always `agent.thread_message_sent`. SSE event name of this frame; its data is a agent.thread_message_sent payload. The agent sent a message to another thread. / Always `agent.thread_message_received`. SSE event name of this frame; its data is a agent.thread_message_received payload. The agent received a message from another thread. / Always `user.withdraw`. SSE event name of this frame; its data is a user.withdraw payload. A queued user.message was withdrawn before it ran. / Always `user.steer`. SSE event name of this frame; its data is a user.steer payload. Receipt that a queued user.message was injected into the running turn. / Always `system.notification`. SSE event name of this frame; its data is a system.notification payload. Background work woke the session with a notification. / Always `session.forked`. SSE event name of this frame; its data is a session.forked payload. The session was created by forking another session. / Always `session.goal_changed`. SSE event name of this frame; its data is a session.goal_changed payload. The session's goal was set, changed status, accounted usage or was cleared. / Always `session.goal_verification`. SSE event name of this frame; its data is a session.goal_verification payload. One completion check of the session's goal started or ended. / Always `event_start`. SSE event name of this frame; its data is a event_start payload. Preview that an event of the requested delta types has started. / Always `event_delta`. SSE event name of this frame; its data is a event_delta payload. Incremental fragment of the event being produced. / Always `ping`. SSE event name of this frame; its data is a ping payload. Keep-alive frame; carries no data. / Always `error`. SSE event name of this frame; its data is a error payload. A stream error.
dataobjectDecoded JSON payload of this frame; its shape is selected by the event name. / Praxis extension (AskUserQuestion, own face only): the confirmation of an AskUserQuestion call, with the answers it carried. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Praxis extension (goal mode, own face only): the session's goal was set, moved to another status, accounted usage or was cleared. `goal` is the goal after the change, `previous_goal` the one before; each is null when there was none. / Praxis extension (goal mode, own face only): one completion check of the goal. A `started` event opens it; `completed`, `failed_closed` or `cancelled` closes it. Events of one check share `verification_id`. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name. / Decoded JSON payload of this frame; its shape is selected by the event name.
data.idstringUnique identifier for this event. / Text of the block. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Event id, unique within the session. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Text of the block. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer. / Text of the block. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer. / Event id, unique within the session. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Text of the block. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Event id, unique within the session. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Unique identifier for this event. / Text of the block. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer. / Text of the block. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer. / Event id, unique within the session. / Event id, unique within the session. Use it to refer to this event, for example in user.tool_confirmation or user.steer.
data.contentarray<object>Array of content blocks comprising the user message. / Array of text blocks comprising the agent response. / Content blocks of the event, in order. / The result content returned by the tool. / The result content returned by the tool. / Message content blocks. / Message content blocks. / Array of content blocks comprising the user message. / Array of text blocks comprising the agent response. / Content blocks of the event, in order. / The result content returned by the tool. / The result content returned by the tool. / Message content blocks. / Message content blocks.
data.typestringAlways `user.message`. A message from the user to the agent, with content blocks. / Always `user.interrupt`. The user interrupted the running turn. / Always `agent.message`. A message from the agent, with text content blocks. / Always `agent.thinking`. The agent's thinking text for a step. / Always `session.status_running`. The session started running a turn. / Always `session.status_rescheduled`. The session will retry after a recoverable error. / Always `session.status_idle`. The session stopped running; stop_reason says why. / Always `session.status_terminated`. The session ended and accepts no more work. / Always `agent.thread_context_compacted`. The thread's context was compacted into a summary. / Always `agent.thread_context_reset`. Content was removed from the model's context after a content-safety refusal. / Always `session.updated`. The session's model, title, metadata, agent or budget changed. / Always `session.error`. The session hit an error. / Always `session.usage`. Cumulative usage of the session. / Always `span.model_request_start`. A model request started. / Always `span.model_request_end`. A model request ended, with its usage. / Always `agent.tool_use`. The agent called a tool. / Always `agent.tool_result`. The result of a tool call. / Always `agent.mcp_tool_use`. The agent called an MCP tool. / Always `agent.mcp_tool_result`. The result of an MCP tool call. / Always `user.tool_confirmation`. / Always `session.thread_created`. A child thread was started. / Always `session.thread_status_running`. A thread started running. / Always `session.thread_status_idle`. A thread stopped running; stop_reason says why. / Always `session.thread_status_rescheduled`. A thread will retry after a recoverable error. / Always `session.thread_status_terminated`. A thread ended. / Always `agent.thread_message_sent`. The agent sent a message to another thread. / Always `agent.thread_message_received`. The agent received a message from another thread. / Always `user.withdraw`. A queued user.message was withdrawn before it ran. / Always `user.steer`. Receipt that a queued user.message was injected into the running turn. / Always `system.notification`. Background work woke the session with a notification. / Always `session.forked`. The session was created by forking another session. / Always `session.goal_changed`. / Always `session.goal_verification`. / Always `event_start`. Preview that an event of the requested delta types has started. / Always `event_delta`. Incremental fragment of the event being produced. / Always `ping`. Keep-alive frame; carries no data. / Always `error`. A stream error. / Always `user.message`. A message from the user to the agent, with content blocks. / Always `user.interrupt`. The user interrupted the running turn. / Always `agent.message`. A message from the agent, with text content blocks. / Always `agent.thinking`. The agent's thinking text for a step. / Always `session.status_running`. The session started running a turn. / Always `session.status_rescheduled`. The session will retry after a recoverable error. / Always `session.status_idle`. The session stopped running; stop_reason says why. / Always `session.status_terminated`. The session ended and accepts no more work. / Always `agent.thread_context_compacted`. The thread's context was compacted into a summary. / Always `agent.thread_context_reset`. Content was removed from the model's context after a content-safety refusal. / Always `session.updated`. The session's model, title, metadata, agent or budget changed. / Always `session.error`. The session hit an error. / Always `session.usage`. Cumulative usage of the session. / Always `span.model_request_start`. A model request started. / Always `span.model_request_end`. A model request ended, with its usage. / Always `agent.tool_use`. The agent called a tool. / Always `agent.tool_result`. The result of a tool call. / Always `agent.mcp_tool_use`. The agent called an MCP tool. / Always `agent.mcp_tool_result`. The result of an MCP tool call. / Always `user.tool_confirmation`. / Always `session.thread_created`. A child thread was started. / Always `session.thread_status_running`. A thread started running. / Always `session.thread_status_idle`. A thread stopped running; stop_reason says why. / Always `session.thread_status_rescheduled`. A thread will retry after a recoverable error. / Always `session.thread_status_terminated`. A thread ended. / Always `agent.thread_message_sent`. The agent sent a message to another thread. / Always `agent.thread_message_received`. The agent received a message from another thread. / Always `user.withdraw`. A queued user.message was withdrawn before it ran. / Always `user.steer`. Receipt that a queued user.message was injected into the running turn. / Always `system.notification`. Background work woke the session with a notification. / Always `session.forked`. The session was created by forking another session. / Always `session.goal_changed`. / Always `session.goal_verification`. / Always `event_start`. Preview that an event of the requested delta types has started. / Always `event_delta`. Incremental fragment of the event being produced. / Always `ping`. Keep-alive frame; carries no data. / Always `error`. A stream error.
data.processed_atnull | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | null | string | null | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | stringA timestamp in RFC 3339 format / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / When the event was recorded, RFC 3339. / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / When the event was recorded, RFC 3339. / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / When the event was recorded, RFC 3339. / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / A timestamp in RFC 3339 format / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / RFC 3339 time at which the server processed the event; null while a queued input has not started running. / When the event was recorded, RFC 3339. / RFC 3339 time at which the server processed the event; null while a queued input has not started running.
data.message_idstringUI transcript message ID. Use the last assistant message in a successfully completed turn as the fork target. / UI transcript message ID shared with this assistant's message parts. / UI transcript message ID. Use the last assistant message in a successfully completed turn as the fork target. / UI transcript message ID. Use the last assistant message in a successfully completed turn as the fork target. / UI transcript message ID shared with this assistant's message parts.
data.session_thread_idnull | string | string | null | string | null | string | string | string | string | string | string | string | string | null | string | string | null | string | null | string | string | string | string | string | string | string | stringIf absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread. / Text of the block. / When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` or `user.tool_result` by `tool_use_id`, so clients do not send it back. / When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` by `tool_use_id`, so clients do not send it back. / Public `sthr_` ID of the newly created thread. / Public sthr_ ID of the thread that started running. / Public sthr_ ID of the thread that went idle. / Public sthr_ ID of the thread that is retrying. / Public sthr_ ID of the thread that terminated. / Text of the block. / Text of the block. / If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread. / Text of the block. / When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` or `user.tool_result` by `tool_use_id`, so clients do not send it back. / When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` by `tool_use_id`, so clients do not send it back. / Public `sthr_` ID of the newly created thread. / Public sthr_ ID of the thread that started running. / Public sthr_ ID of the thread that went idle. / Public sthr_ ID of the thread that is retrying. / Public sthr_ ID of the thread that terminated. / Text of the block. / Text of the block.
data.stop_reasonobjectWhy the session stopped running, with the variant data needed to continue.
data.removedarray<object>Content removed from the model's context by this reset.
data.categorystringText of the block.
data.stoppedbooleanTrue when the run was stopped instead of retried after the reset.
data.agentnull | objectResolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
data.budgetnull | objectA hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.
data.metadataobjectThe session's full metadata bag after the update. Present when the update set non-empty metadata; absent when metadata was unchanged or cleared to empty.
data.titlenull | stringThe session's new title. Present only when the update changed it.
data.modelobjectPraxis extension: the changed session model, present only on /agent/v1 session.updated events. Model-only updates are omitted on /anthropic.
data.errorobjectDescription of the error and what the client should do next. / Error detail. / Description of the error and what the client should do next. / Error detail.
data.usageobjectPoint-in-time snapshot of a session's cumulative usage.
data.is_errornull | booleanWhether the model request resulted in an error. / Whether the tool execution resulted in an error. / Whether the tool execution resulted in an error. / Whether the model request resulted in an error. / Whether the tool execution resulted in an error. / Whether the tool execution resulted in an error.
data.model_request_start_idstringThe id of the corresponding `span.model_request_start` event.
data.model_usageobjectToken usage for a single model request.
data.inputobjectInput parameters for the tool call.
data.namestringName of the agent tool being used. / Name of the MCP tool being used. / Name of the agent tool being used. / Name of the MCP tool being used.
data.evaluated_permissionstringAgentEvaluatedPermission enum
data.evaluationobjectNames the resolved permission_policy that produced evaluated_permission, and under auto carries the judgement. Open union: clients must tolerate unknown variants.
data.tool_use_idstringThe id of the `agent.tool_use` event this result corresponds to. / The id of the AskUserQuestion `agent.tool_use` event this answers. / The id of the `agent.tool_use` event this result corresponds to. / The id of the AskUserQuestion `agent.tool_use` event this answers.
data.mcp_server_namestringName of the MCP server providing the tool.
data._metaobjectPraxis extension (MCP Apps, SEP-1865): the `ui` and `openai/ui` keys of the MCP tool definition's `_meta`, verbatim; other `_meta` keys are not exposed. When `ui.resourceUri` is a `ui://` URI, the tool has an interactive view: a client that implements MCP Apps can fetch that resource from the MCP server and render it for this call. Absent when the tool declares neither key. Clients that do not render MCP Apps ignore it. / Praxis extension (MCP Apps, SEP-1865): the MCP CallToolResult `_meta`, verbatim. Views use it for data that should not reach the model; absent when the tool returned none. / Praxis extension (MCP Apps, SEP-1865): the `ui` and `openai/ui` keys of the MCP tool definition's `_meta`, verbatim; other `_meta` keys are not exposed. When `ui.resourceUri` is a `ui://` URI, the tool has an interactive view: a client that implements MCP Apps can fetch that resource from the MCP server and render it for this call. Absent when the tool declares neither key. Clients that do not render MCP Apps ignore it. / Praxis extension (MCP Apps, SEP-1865): the MCP CallToolResult `_meta`, verbatim. Views use it for data that should not reach the model; absent when the tool returned none.
data.sourcestringPraxis extension (MCP Apps, SEP-1865): `app` when the call was made by an MCP Apps view, `codemode` when a program run by the codemode tool called an MCP tool that declares a view (the event pair exists so a client can render that view; the model already has the result in the codemode tool result); absent for the model's own calls. / What caused the change. / Praxis extension (MCP Apps, SEP-1865): `app` when the call was made by an MCP Apps view, `codemode` when a program run by the codemode tool called an MCP tool that declares a view (the event pair exists so a client can render that view; the model already has the result in the codemode tool result); absent for the model's own calls. / Praxis extension (MCP Apps, SEP-1865): `app` when the call was made by an MCP Apps view, `codemode` when a program run by the codemode tool called an MCP tool that declares a view (the event pair exists so a client can render that view; the model already has the result in the codemode tool result); absent for the model's own calls. / What caused the change.
data.parent_tool_use_idstringPraxis extension (MCP Apps, SEP-1865): present when `source` is `codemode`; the id of the codemode tool use whose program made this call. Absent otherwise.
data.mcp_tool_use_idstringThe id of the `agent.mcp_tool_use` event this result corresponds to.
data.structured_contentanyPraxis extension (MCP Apps, SEP-1865): the MCP CallToolResult `structuredContent`, verbatim JSON. MCP Apps views read it as the data to render; absent when the tool returned none.
data.resultstringAlways `allow`.
data.answersobjectThe user's answer to each question, keyed by the question text; empty when the questions were dismissed.
data.annotationsobjectPer-question notes, keyed by the question text.
data.agent_namestringName of the callable agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the callable agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs.
data.to_session_thread_idstringPublic `sthr_` ID of the thread the message was sent to.
data.to_agent_namenull | stringName of the callable agent this message was sent to. Absent when sent to the primary agent.
data.from_session_thread_idstringPublic `sthr_` ID of the thread that sent the message.
data.from_agent_namenull | stringName of the callable agent this message came from. Absent when received from the primary agent.
data.event_idstringText of the block. / Id of the event this event refers to. / Text of the block. / Text of the block. / Id of the event this event refers to. / Text of the block.
data.sourcesarray<object>Background work that woke the session with this notification.
data.forked_from_session_idstringId of the parent session this session was forked from.
data.forked_from_message_idstringmessage_id of the agent message in the parent session up to which the conversation was copied.
data.actionstringWhat changed in the goal.
data.goalobject | nullThe goal as the change left it, or null when the session has no goal.
data.previous_goalobject | nullThe goal before the change, or null when there was none.
data.statusstringWhere the check stands. Read `verification.passed` on the closing event to know whether the goal counts as done.
data.goal_idstringThe goal this check belongs to.
data.goal_iterationintegerWhich check of this goal, matching `iteration` on the goal.
data.verification_idstringIdentifier shared by every event of one check.
data.anchor_message_idstring | nullThe assistant message the check follows, or null.
data.verificationobjectThe verdict; absent on `started`.
data.eventobjectEvent name or event payload.
data.deltaobjectIncremental fragment of the event being produced.

Call Create session first and replace the example session ID with its returned ID.

POST /agent/v1/sessions/{session_id}/threads/{thread_id}/archive◐ Partial

Official Claude documentation ↗

Request parameters

  • session_idstring必填

    path: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

  • thread_idstring必填

    path: Execution thread id (sthr_...), as listed by sessions.threads.list; the primary thread id equals the session's own thread. Unknown or foreign ids return 404.

  • session_idstring必填

    query: Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value.

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 Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
idstringUnique identifier for this thread.
agentobjectThe resolved agent a `session_thread` runs.
agent.modelstring | objectThe advisor model id. / Model identifier and configuration.
agent.typestringAlways `advisor`. An advisor whose model is consulted for advice in a separate thread (at most one per coordinator). / Always `agent`. A roster member that refers to an agent by id and pinned version.
agent.idstringAgent id (agent_...). Pass it as agent when creating a session and as agent_id in agent calls.
agent.descriptionnull | stringFree-text description of what the agent is for; null when none was set.
agent.mcp_serversarray<object>URL MCP servers the agent can call, paired one-to-one with mcp_toolset entries in tools and saved with the agent version. No credentials are stored here.
agent.namestringDisplay name of the agent, as set on create or update. It is a label, not a unique key.
agent.skillsarray<object>Skill attachments are not supported: a nonempty skills array returns 400. Omit this field or send an empty array. The native Skill tool loads available runtime skills independently of this field.
agent.systemnull | stringSystem prompt given to the model at the start of every session of this agent; null when none was set.
agent.toolsarray<object>Tools of the agent: one agent_toolset_20260401 entry for the native tools (all resolved settings are returned, ready to send back on update), plus mcp_toolset entries; custom tool definitions are rejected with 400. Keep bash enabled to use codemode, Skill and subagents.
agent.versionnumberThe agent's current version. Starts at 1 and increments each time the agent is modified.
archived_atnull | stringA timestamp in RFC 3339 format
created_atstringA timestamp in RFC 3339 format
parent_thread_idnull | stringParent thread that spawned this thread. Null for the primary thread.
session_idstringThe session this thread belongs to.
statsnull | objectTiming statistics for a session thread.
stats.active_secondsnumberCumulative time in seconds the thread spent actively running. Excludes idle time.
stats.duration_secondsnumberElapsed time since thread creation in seconds. For archived threads, frozen at the final update.
stats.startup_secondsnumberTime in seconds for the thread to begin running. Zero for child threads, which start immediately.
statusstringSessionThreadStatus enum
typestringAlways `session_thread`. An execution thread of a session.
updated_atstringA timestamp in RFC 3339 format
usagenull | objectCumulative token usage for a session thread across all turns.
usage.active_secondsnumberCumulative 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_creationobjectPrompt-cache creation token usage broken down by cache lifetime.
usage.cache_read_input_tokensnumberTotal tokens read from prompt cache.
usage.input_tokensnumberTotal input tokens consumed across all turns.
usage.list_costnull | objectA monetary amount in a specific currency.
usage.output_tokensnumberTotal output tokens generated across all turns.
usage.server_tool_usenull | objectCumulative count of server-executed tool invocations, broken down by tool.

GET /agent/v1/environments◐ Partial

Official Claude documentation ↗

Request parameters

  • include_archivedboolean可选

    query: Include archived environments in the response

  • limitnumber可选

    query: Number of items per page.

  • pagestring可选

    query: Opaque pagination cursor: pass the next_page value of the previous response unchanged. Omit it for the first page. A cursor from a different query or a malformed one returns 400.

Returns

200

Supports tenant-owned cloud environments, configuration updates and soft archival; built-ins are read-only. Lists accept limit, page and include_archived. Limited networking applies at sandbox creation; package installation failure terminates the session with ENVIRONMENT_PACKAGE_INSTALL_FAILED. self_hosted, scope and cross-session package caching are not supported.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
dataarray<object>Items of this page, in the order requested by the call.
data[].idstringEnvironment identifier (e.g., 'env_...')
data[].archived_atnull | stringRFC 3339 timestamp when environment was archived, or null if not archived
data[].configobjectEnvironment configuration (either Anthropic Cloud or self-hosted)
data[].created_atstringRFC 3339 timestamp when environment was created
data[].descriptionnull | stringUser-provided description for the environment; null when unset
data[].metadataobjectUser-provided metadata key-value pairs
data[].namestringHuman-readable name for the environment
data[].typestringThe type of object (always 'environment')
data[].updated_atstringRFC 3339 timestamp when environment was last updated
data[].scopestringThe visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account.
next_pagestring | nullOpaque cursor for the next page: pass it unchanged as page to continue. Null when this is the last page.

GET /agent/v1/environments/{environment_id}◐ Partial

Official Claude documentation ↗

Request parameters

  • environment_idstring必填

    path: Environment id, as returned by environments.create or environments.list. Built-in environments can be read but not changed.

Returns

200

Supports tenant-owned cloud environments, configuration updates and soft archival; built-ins are read-only. Lists accept limit, page and include_archived. Limited networking applies at sandbox creation; package installation failure terminates the session with ENVIRONMENT_PACKAGE_INSTALL_FAILED. self_hosted, scope and cross-session package caching are not supported.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Successful response

application/json

NameTypeDescription
idstringEnvironment identifier (e.g., 'env_...')
archived_atnull | stringRFC 3339 timestamp when environment was archived, or null if not archived
configobjectEnvironment configuration (either Anthropic Cloud or self-hosted)
config.networkingobjectNetwork configuration policy.
config.packagesobjectPackage manager configuration.
config.typestringEnvironment type
created_atstringRFC 3339 timestamp when environment was created
descriptionnull | stringUser-provided description for the environment; null when unset
metadataobjectUser-provided metadata key-value pairs
namestringHuman-readable name for the environment
typestringThe type of object (always 'environment')
updated_atstringRFC 3339 timestamp when environment was last updated
scopestringThe visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account.

List Toolsets

GET /agent/v1/toolsets● Supported

Returns

200

Returns toolset descriptions, plugin names and versions, and each tool’s name, description, input schema, read-only status and default permission policy. Available at /agent/v1/toolsets. Reading the catalog does not change agent configuration. agent_toolset_20260401 contains all 13 native tools. TaskOutput, TaskStop, Monitor, Agent and SendMessage support individual enablement and permission policies and require bash. The compatibility API provides only the eight official tools.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Response

HTTP 200

Available toolsets

application/json

NameTypeDescription
dataarray<object>Items of this page, in the order requested by the call.
data[].typestringToolset type id as used in an agent's tools entry, for example agent_toolset_20260401.
data[].pluginobjectUnit that registers the toolset, with its name and version.
data[].descriptionstringFree-text description; null when none was set.
data[].environmentstringEnvironment in which the toolset's tools run, for example node22.
data[].toolsarray<object>Tools offered to the model.
next_pagenullOpaque cursor for the next page: pass it unchanged as page to continue. Null when this is the last page.