跳转到内容
EN

Update session agent version

Code Mode: praxis.agent.sessions.agentVersion.create

HTTP: POST /agent/v1/sessions/{session_id}/agent_version

Move one session to a version of its agent

Without version, the session moves to the agent’s active version — the version new sessions get now, which is not necessarily the newest saved one. With version, it moves to that existing version. The change is idempotent: asking for the version the session is already on answers the session and writes nothing, so the call may be repeated freely. A session that is running a turn answers 409 SESSION_CONFLICT and changes nothing, because a turn finishes on the version it started with; ask again once it is idle. The move writes a session.updated event carrying the agent version and the caller as its actor, so every version change is attributable. Main sessions additionally follow their agent’s active version at the start of a person-started turn; this endpoint is the same move made explicitly, and it works on every kind of session, including worker sessions that never follow on their own.

签名

praxis.agent.sessions.agentVersion.create(args:{path:{session_id:string};body?:{/** An existing version of the session's agent, from agents.versions.list. */ version?:number}}):Promise<{/** Session id (sesn_...). */ id:string;/** Resolved `agent` definition for a `session`. */ agent:{/** Agent id (agent_...). */ id:string;/** Free-text description of what the agent is for; null when none was set. */ description:null|string;/** Praxis extension: HTTP, SSE or trusted stdio MCP servers paired with mcp_toolset entries and saved with the agent version. */ mcp_servers:Array<{/** Streamable HTTP transport. e.g. "url" */ type:"url";/** Name of the MCP server; the mcp_toolset entry that refers to it uses the same name in mcp_server_name. */ name:string;/** HTTP or HTTPS MCP server endpoint. pattern: ^https?:// e.g. "https://mcp.example.com/mcp" */ url:string;/** Praxis extension: request headers. */ headers?:{/** HTTP header name using RFC 7230 token characters. pattern: ^[!#$%&'*+.^_`|~0-9A-Za-z-]+$ e.g. "Authorization" */ [key:string]:string};/** Praxis extension: timeout in milliseconds. */ timeout_ms?:number}|{/** Legacy SSE transport. e.g. "sse" */ type:"sse";/** Name of the MCP server; the mcp_toolset entry that refers to it uses the same name in mcp_server_name. */ name:string;/** HTTP or HTTPS MCP server endpoint. pattern: ^https?:// e.g. "https://mcp.example.com/sse" */ url:string;/** Praxis extension: request headers. */ headers?:{/** HTTP header name using RFC 7230 token characters. pattern: ^[!#$%&'*+.^_`|~0-9A-Za-z-]+$ e.g. "Authorization" */ [key:string]:string};/** Praxis extension: timeout in milliseconds. */ timeout_ms?:number}|{/** Run a command on the agent computer. e.g. "stdio" */ type:"stdio";/** Name of the MCP server; the mcp_toolset entry that refers to it uses the same name in mcp_server_name. */ name:string;/** Executable command on the agent computer. */ command:string;/** Command arguments; omitted means no arguments. */ args?:Array<string>;/** Praxis extension: environment variables for the command on the agent computer. */ env?:{/** Environment variable name. e.g. "TOKEN" */ [key:string]:string};/** Praxis extension: timeout in milliseconds. */ timeout_ms?:number}>;/** Model identifier and configuration. */ model:{/** A model id from the Praxis model catalog (`praxis.model.models.list`). */ id:string;/** How hard Claude works on each turn. */ effort?:{/** Always `low`. */ type:"low"}|{/** Always `medium`. */ type:"medium"}|{/** Always `high`. */ type:"high"}|{/** Always `xhigh`. */ type:"xhigh"}|{/** Always `max`. */ type:"max"};/** Geographic region for model inference. */ inference_geo?:string;/** Inference speed mode. */ speed?:"standard"|"fast";/** Platform model settings: reasoning (default thinking level) and max_output_tokens (output cap). */ settings?:{/** Default thinking effort for sessions without an explicit selection. */ reasoning?:"low"|"medium"|"high"|"xhigh"|"max"|"none";/** Output cap for one model request, thinking included; the counterpart of Claude Code's CLAUDE_CODE_MAX_OUTPUT_TOKENS. */ max_output_tokens?:number}};/** Resolved coordinator topology with full agent definitions for each roster member. */ multiagent:null|{/** Full `agent` definitions the coordinator may spawn as session threads. */ agents:Array<{/** The advisor model id. */ model:string;/** Always `advisor`. */ type:"advisor"}|{/** Agent id (agent_...). */ id:string;/** Free-text description of what the agent is for; null when none was set. */ description:null|string;/** Praxis extension: HTTP, SSE or trusted stdio MCP servers paired with mcp_toolset entries and saved with the agent version. */ mcp_servers:Array<{/** Streamable HTTP transport. e.g. "url" */ type:"url";/** Name of the MCP server; the mcp_toolset entry that refers to it uses the same name in mcp_server_name. */ name:string;/** HTTP or HTTPS MCP server endpoint. pattern: ^https?:// e.g. "https://mcp.example.com/mcp" */ url:string;/** Praxis extension: request headers. */ headers?:{/** HTTP header name using RFC 7230 token characters. pattern: ^[!#$%&'*+.^_`|~0-9A-Za-z-]+$ e.g. "Authorization" */ [key:string]:string};/** Praxis extension: timeout in milliseconds. */ timeout_ms?:number}|{/** Legacy SSE transport. e.g. "sse" */ type:"sse";/** Name of the MCP server; the mcp_toolset entry that refers to it uses the same name in mcp_server_name. */ name:string;/** HTTP or HTTPS MCP server endpoint. pattern: ^https?:// e.g. "https://mcp.example.com/sse" */ url:string;/** Praxis extension: request headers. */ headers?:{/** HTTP header name using RFC 7230 token characters. pattern: ^[!#$%&'*+.^_`|~0-9A-Za-z-]+$ e.g. "Authorization" */ [key:string]:string};/** Praxis extension: timeout in milliseconds. */ timeout_ms?:number}|{/** Run a command on the agent computer. e.g. "stdio" */ type:"stdio";/** Name of the MCP server; the mcp_toolset entry that refers to it uses the same name in mcp_server_name. */ name:string;/** Executable command on the agent computer. */ command:string;/** Command arguments; omitted means no arguments. */ args?:Array<string>;/** Praxis extension: environment variables for the command on the agent computer. */ env?:{/** Environment variable name. e.g. "TOKEN" */ [key:string]:string};/** Praxis extension: timeout in milliseconds. */ timeout_ms?:number}>;/** Model identifier and configuration. */ model:{/** A model id from the Praxis model catalog (`praxis.model.models.list`). */ id:string;/** How hard Claude works on each turn. */ effort?:{/** Always `low`. */ type:"low"}|{/** Always `medium`. */ type:"medium"}|{/** Always `high`. */ type:"high"}|{/** Always `xhigh`. */ type:"xhigh"}|{/** Always `max`. */ type:"max"};/** Geographic region for model inference. */ inference_geo?:string;/** Inference speed mode. */ speed?:"standard"|"fast"};/** Display name of the agent, as set on create or update. */ name:string;/** Custom skills attached to the agent, each {type: "custom", skill_id, version?}: skill_id comes from skills.create or skills.list, at most 20 skills, no repeated */ skills:Array<{/** Id of the skill to attach. */ skill_id:string;/** Always `anthropic`. */ type:"anthropic";/** Version of the skill: omit or `latest` to follow the newest version at each new session; give a version id to pin it. */ version:string}|{/** Id of the skill to attach. */ skill_id:string;/** Always `custom`. */ type:"custom";/** Version of the skill: omit or `latest` to follow the newest version at each new session; give a version id to pin it. */ version:string}>;/** System prompt given to the model at the start of every session of this agent; null when none was set. */ system:null|string;/** 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 e */ tools:Array<{/** Per-tool settings that override default_config. */ configs:Array<{/** Whether the tool is offered to the model. */ enabled:boolean;/** Name of the native tool this entry configures. */ name:"bash";/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"};/** Always `bash`. */ type:"bash"}|{/** Whether the tool is offered to the model. */ enabled:boolean;/** Name of the native tool this entry configures. */ name:"edit";/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"};/** Always `edit`. */ type:"edit"}|{/** Whether the tool is offered to the model. */ enabled:boolean;/** Name of the native tool this entry configures. */ name:"read";/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"};/** Always `read`. */ type:"read"}|{/** Whether the tool is offered to the model. */ enabled:boolean;/** Name of the native tool this entry configures. */ name:"write";/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"};/** Always `write`. */ type:"write"}|{/** Whether the tool is offered to the model. */ enabled:boolean;/** Name of the native tool this entry configures. */ name:"glob";/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"};/** Always `glob`. */ type:"glob"}|{/** Whether the tool is offered to the model. */ enabled:boolean;/** Name of the native tool this entry configures. */ name:"grep";/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"};/** Always `grep`. */ type:"grep"}|{/** Whether the tool is offered to the model. */ enabled:boolean;/** Name of the native tool this entry configures. */ name:"web_fetch";/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"};/** Always `web_fetch`. */ type:"web_fetch";/** Hosts the tool may fetch or search, as plain hostnames (no scheme, port or path); a listed domain also covers its subdomains. */ allowed_domains?:Array<string>;/** Hosts the tool must never fetch or search, as plain hostnames (no scheme, port or path); a listed domain also covers its subdomains. */ blocked_domains?:Array<string>;/** Maximum number of tokens of fetched text content included in context per call; does not apply to binary content such as PDFs. */ max_content_tokens?:null|number}|{/** Whether the tool is offered to the model. */ enabled:boolean;/** Name of the native tool this entry configures. */ name:"web_search";/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"};/** Always `web_search`. */ type:"web_search";/** Hosts the tool may fetch or search, as plain hostnames (no scheme, port or path); a listed domain also covers its subdomains. */ allowed_domains?:Array<string>;/** Hosts the tool must never fetch or search, as plain hostnames (no scheme, port or path); a listed domain also covers its subdomains. */ blocked_domains?:Array<string>;/** Approximate user location for search result localization. */ user_location?:null|{/** Location precision. */ type:"approximate";/** City name. */ city?:null|string;/** Two-letter ISO 3166-1 country code, uppercase. */ country?:null|string;/** Region or state name. */ region?:null|string;/** IANA timezone identifier, e.g. */ timezone?:null|string}}|{/** Name of the native tool this entry configures. */ name:"task_output"|"task_stop"|"monitor"|"agent"|"send_message"|"codemode"|"skill";/** Whether the tool is offered to the model. */ enabled:boolean;/** Whether a call to this tool runs automatically (always_allow) or waits for user.tool_confirmation (always_ask). */ permission_policy:{/** Permission policy kind. */ type:"always_allow"|"always_ask"}}>;/** Resolved default configuration for agent tools. */ default_config:{/** Whether tools of the toolset are offered to the model when configs does not name them. */ enabled:boolean;/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"}};/** Always `agent_toolset_20260401`. */ type:"agent_toolset_20260401"}|{/** Always `mcp_toolset`. */ type:"mcp_toolset";/** Name of the MCP server in mcp_servers whose tools this entry exposes. */ mcp_server_name:string;/** Settings applied to every tool of this toolset that configs does not name. */ default_config?:{/** Whether tools of the toolset are offered to the model when configs does not name them. */ enabled?:boolean|null;/** Permission policy for tools that configs does not name: always_allow runs calls automatically, always_ask waits for user.tool_confirmation. */ permission_policy?:null|{/** Permission policy kind. */ type:"always_allow"|"always_ask"}}|{/** Whether tools of the toolset are offered to the model when configs does not name them. */ enabled?:boolean|null;/** Permission policy for tools that configs does not name: always_allow runs calls automatically, always_ask waits for user.tool_confirmation. */ permission_policy?:null|{/** Permission policy kind. */ type:"always_allow"|"always_ask"}};/** Per-tool settings that override default_config. */ configs?:Array<{/** Bare tool name reported by the MCP server. */ name:string;/** Whether the tool is offered to the model. */ enabled?:boolean|null;/** Whether a call to this tool runs automatically (always_allow) or waits for user.tool_confirmation (always_ask). */ permission_policy?:null|{/** Permission policy kind. */ type:"always_allow"|"always_ask"}}>|null}|{/** What the custom tool does and when the model should call it. */ description:string;/** JSON Schema for custom tool input parameters. */ input_schema:{/** Always `object`. */ type:"object";/** JSON Schema of each input property, keyed by property name. */ properties?:null|{[key:string]:unknown};/** Names of the input properties the model must supply. */ required?:null|Array<string>;[key:string]:unknown};/** Name of the custom tool, as the model sees and calls it. */ name:string;/** Always `custom`. */ type:"custom"}>;/** Always `agent`. */ type:"agent";/** The latest saved version of the agent, the editable head; it differs from active_version after a save with apply false. */ version:number}>;/** Always `coordinator`. */ type:"coordinator"};/** Display name of the agent, as set on create or update. */ name:string;/** Custom skills attached to the agent, each {type: "custom", skill_id, version?}: skill_id comes from skills.create or skills.list, at most 20 skills, no repeated */ skills:Array<{/** Id of the skill to attach. */ skill_id:string;/** Always `anthropic`. */ type:"anthropic";/** Version of the skill: omit or `latest` to follow the newest version at each new session; give a version id to pin it. */ version:string}|{/** Id of the skill to attach. */ skill_id:string;/** Always `custom`. */ type:"custom";/** Version of the skill: omit or `latest` to follow the newest version at each new session; give a version id to pin it. */ version:string}>;/** System prompt given to the model at the start of every session of this agent; null when none was set. */ system:null|string;/** 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 e */ tools:Array<{/** Per-tool settings that override default_config. */ configs:Array<{/** Whether the tool is offered to the model. */ enabled:boolean;/** Name of the native tool this entry configures. */ name:"bash";/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"};/** Always `bash`. */ type:"bash"}|{/** Whether the tool is offered to the model. */ enabled:boolean;/** Name of the native tool this entry configures. */ name:"edit";/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"};/** Always `edit`. */ type:"edit"}|{/** Whether the tool is offered to the model. */ enabled:boolean;/** Name of the native tool this entry configures. */ name:"read";/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"};/** Always `read`. */ type:"read"}|{/** Whether the tool is offered to the model. */ enabled:boolean;/** Name of the native tool this entry configures. */ name:"write";/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"};/** Always `write`. */ type:"write"}|{/** Whether the tool is offered to the model. */ enabled:boolean;/** Name of the native tool this entry configures. */ name:"glob";/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"};/** Always `glob`. */ type:"glob"}|{/** Whether the tool is offered to the model. */ enabled:boolean;/** Name of the native tool this entry configures. */ name:"grep";/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"};/** Always `grep`. */ type:"grep"}|{/** Whether the tool is offered to the model. */ enabled:boolean;/** Name of the native tool this entry configures. */ name:"web_fetch";/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"};/** Always `web_fetch`. */ type:"web_fetch";/** Hosts the tool may fetch or search, as plain hostnames (no scheme, port or path); a listed domain also covers its subdomains. */ allowed_domains?:Array<string>;/** Hosts the tool must never fetch or search, as plain hostnames (no scheme, port or path); a listed domain also covers its subdomains. */ blocked_domains?:Array<string>;/** Maximum number of tokens of fetched text content included in context per call; does not apply to binary content such as PDFs. */ max_content_tokens?:null|number}|{/** Whether the tool is offered to the model. */ enabled:boolean;/** Name of the native tool this entry configures. */ name:"web_search";/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"};/** Always `web_search`. */ type:"web_search";/** Hosts the tool may fetch or search, as plain hostnames (no scheme, port or path); a listed domain also covers its subdomains. */ allowed_domains?:Array<string>;/** Hosts the tool must never fetch or search, as plain hostnames (no scheme, port or path); a listed domain also covers its subdomains. */ blocked_domains?:Array<string>;/** Approximate user location for search result localization. */ user_location?:null|{/** Location precision. */ type:"approximate";/** City name. */ city?:null|string;/** Two-letter ISO 3166-1 country code, uppercase. */ country?:null|string;/** Region or state name. */ region?:null|string;/** IANA timezone identifier, e.g. */ timezone?:null|string}}|{/** Name of the native tool this entry configures. */ name:"task_output"|"task_stop"|"monitor"|"agent"|"send_message"|"codemode"|"skill";/** Whether the tool is offered to the model. */ enabled:boolean;/** Whether a call to this tool runs automatically (always_allow) or waits for user.tool_confirmation (always_ask). */ permission_policy:{/** Permission policy kind. */ type:"always_allow"|"always_ask"}}>;/** Resolved default configuration for agent tools. */ default_config:{/** Whether tools of the toolset are offered to the model when configs does not name them. */ enabled:boolean;/** Permission policy for tool execution. */ permission_policy:{/** Always `always_allow`. */ type:"always_allow"}|{/** Always `always_ask`. */ type:"always_ask"}|{/** Always `auto`. */ type:"auto"}};/** Always `agent_toolset_20260401`. */ type:"agent_toolset_20260401"}|{/** Always `mcp_toolset`. */ type:"mcp_toolset";/** Name of the MCP server in mcp_servers whose tools this entry exposes. */ mcp_server_name:string;/** Settings applied to every tool of this toolset that configs does not name. */ default_config?:{/** Whether tools of the toolset are offered to the model when configs does not name them. */ enabled?:boolean|null;/** Permission policy for tools that configs does not name: always_allow runs calls automatically, always_ask waits for user.tool_confirmation. */ permission_policy?:null|{/** Permission policy kind. */ type:"always_allow"|"always_ask"}}|{/** Whether tools of the toolset are offered to the model when configs does not name them. */ enabled?:boolean|null;/** Permission policy for tools that configs does not name: always_allow runs calls automatically, always_ask waits for user.tool_confirmation. */ permission_policy?:null|{/** Permission policy kind. */ type:"always_allow"|"always_ask"}};/** Per-tool settings that override default_config. */ configs?:Array<{/** Bare tool name reported by the MCP server. */ name:string;/** Whether the tool is offered to the model. */ enabled?:boolean|null;/** Whether a call to this tool runs automatically (always_allow) or waits for user.tool_confirmation (always_ask). */ permission_policy?:null|{/** Permission policy kind. */ type:"always_allow"|"always_ask"}}>|null}|{/** What the custom tool does and when the model should call it. */ description:string;/** JSON Schema for custom tool input parameters. */ input_schema:{/** Always `object`. */ type:"object";/** JSON Schema of each input property, keyed by property name. */ properties?:null|{[key:string]:unknown};/** Names of the input properties the model must supply. */ required?:null|Array<string>;[key:string]:unknown};/** Name of the custom tool, as the model sees and calls it. */ name:string;/** Always `custom`. */ type:"custom"}>;/** Always `agent`. */ type:"agent";/** The latest saved version of the agent, the editable head; it differs from active_version after a save with apply false. */ version:number};/** A timestamp in RFC 3339 format */ archived_at:null|string;/** A hard spend ceiling. */ budget:null|{/** A monetary amount in a specific currency. */ max_list_cost:{/** Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. */ amount:string;/** Uppercase ISO-4217 currency code. */ currency:"USD"};/** Always `limit`. */ type:"limit"};/** A timestamp in RFC 3339 format */ created_at:string;/** Execution environment of this session. */ environment_id?:string;/** Free-form string key/value pairs stored with the session, changed through sessions.update patch semantics. */ metadata:{[key:string]:string};/** Per-outcome evaluation state. */ outcome_evaluations:Array<{/** A timestamp in RFC 3339 format */ completed_at:null|string;/** What the agent should produce. */ description:string;/** Grader's verdict text from the most recent evaluation. */ explanation:null|string;/** 0-indexed revision cycle the outcome is currently on. */ iteration:number;/** Server-generated outc\_ ID for this outcome. */ outcome_id:string;/** Current evaluation state. */ result:string;/** Always `outcome_evaluation`. */ type:"outcome_evaluation"}>;/** Resources attached to the session, at most 500; each is a file reference mounted into the session's machine. */ resources:Array<{/** Resource id, the resource_id of sessions.resources calls. */ id:string;/** A timestamp in RFC 3339 format */ created_at:string;/** Path inside the machine where the file is mounted; defaults to /mnt/session/uploads/<file_id>, and custom paths are rooted there. */ mount_path:string;/** Always `github_repository`. */ type:"github_repository";/** A timestamp in RFC 3339 format */ updated_at:string;/** Repository URL. */ url:string;/** Branch or commit to check out. */ checkout?:null|{/** Branch name to check out. */ name:string;/** Always `branch`. */ type:"branch"}|{/** Full commit SHA to check out. */ sha:string;/** Always `commit`. */ type:"commit"}}|{/** Resource id, the resource_id of sessions.resources calls. */ id:string;/** A timestamp in RFC 3339 format */ created_at:string;/** Id of the uploaded file; it must exist and belong to your tenant. */ file_id:string;/** Path inside the machine where the file is mounted; defaults to /mnt/session/uploads/<file_id>, and custom paths are rooted there. */ mount_path:string;/** Always `file`. */ type:"file";/** A timestamp in RFC 3339 format */ updated_at:string}|{/** The memory store ID (memstore\_...). */ memory_store_id:string;/** Always `memory_store`. */ type:"memory_store";/** Access mode for an attached memory store. */ access?:null|"read_write"|"read_only";/** Description of the memory store, snapshotted at attach time. */ description?:string;/** Per-attachment guidance for the agent on how to use this store. */ instructions?:null|string;/** Filesystem path where the store is mounted in the session container, e.g. */ mount_path?:null|string;/** Display name of the memory store, snapshotted at attach time. */ name?:null|string}>;/** Timing statistics for a session. */ stats:{/** Cumulative time in seconds the session spent in `running` status. */ active_seconds?:number;/** Elapsed time since session creation in seconds. */ duration_seconds?:number};/** SessionStatus enum - `rescheduling` - Transient error occurred, retrying automatically. */ status:"rescheduling"|"running"|"idle"|"terminated";/** Title of the session, set on create or through sessions.update; null when none was set. */ title:null|string;/** Always `session`. */ type:"session";/** A timestamp in RFC 3339 format */ updated_at:string;/** Cumulative token usage for a session across all turns. */ usage:{/** Cumulative time in seconds during which the session had at least one thread in running status. */ active_seconds?:number;/** Prompt-cache creation token usage broken down by cache lifetime. */ cache_creation?:{/** Tokens used to create 1-hour ephemeral cache entries. */ ephemeral_1h_input_tokens?:number;/** Tokens used to create 5-minute ephemeral cache entries. */ ephemeral_5m_input_tokens?:number};/** Total tokens read from prompt cache. */ cache_read_input_tokens?:number;/** Total input tokens consumed across all turns. */ input_tokens?:number;/** Session total list-price cost in USD as a decimal string with exactly 6 decimals. */ list_cost?:null|{/** Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. */ amount:string;/** Uppercase ISO-4217 currency code. */ currency:"USD"};/** Total output tokens generated across all turns. */ output_tokens?:number;/** Cumulative count of server-executed tool invocations, broken down by tool. */ server_tool_use?:null|{/** Number of server-executed web fetch requests. */ web_fetch_requests?:number;/** Number of server-executed web search requests. */ web_search_requests?:number};/** USD list-price cost by product, as decimal strings with exactly 6 decimals. */ cost_by_product?:{[key:string]:string};/** Child-thread model cost in integer micro-USD, already included in list_cost. */ subagent_cost_micro_usd?:number};/** Vault IDs attached to the session at creation. */ vault_ids:Array<string>;/** Deployment ID when the session was created from a deployment reference. */ deployment_id?:null|string;/** Normalized session working directory; defaults to /home/user/workspace. */ cwd:string;/** Praxis extension: where this session's work happens. */ workspace?:{/** Kind of background task: bash for a command started with run_in_background, monitor for a monitor watch. */ kind:"shared"|"isolated";/** The worktree's own folder; present only when kind is isolated. */ path?:string;/** The worktree's branch; present only when kind is isolated. */ branch?:string};/** Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. pattern: ^cmp_[A-Za-z0-9_-]{1,64}$ */ computer_id?:string;/** Praxis extension: the currently selected session model. */ model?:{/** Identifier of the object, as returned by the API; pass it in the path of follow-up calls on the same resource. */ id:string;/** Supported thinking controls, or null when capability is unknown or unavailable. */ thinking:{/** Thinking levels the model accepts as effort, in ascending order. */ efforts:Array<"low"|"medium"|"high"|"xhigh"|"max">;/** Whether effort none (thinking off) is allowed for this model. */ can_disable:boolean;/** Thinking level used when neither the session nor the agent selects one; null when the model states no default. */ default_effort:"low"|"medium"|"high"|"xhigh"|"max"|null}|null};/** Praxis extension: explicit session thinking effort; null inherits the pinned agent default, then the model default. */ thinking?:{/** Thinking level saved for this session: low, medium, high, xhigh, max, or none to turn thinking off. */ effort:"low"|"medium"|"high"|"xhigh"|"max"|"none"}|null;/** Praxis extension: source of a forked session; null for other sessions. */ forked_from?:{/** Id of the parent session this session was forked from; it is left unchanged by the fork. */ session_id:string;/** message_id of the agent message in the parent session up to which the conversation was copied. */ message_id:string}|null;/** End-user identifier associated with the session, or null when none is recorded. */ external_user_id:string|null;/** Origin of the session: kit, iframe, hosted, api or automation; null when unavailable. */ source:"kit"|"iframe"|"hosted"|"api"|"automation"|null}>;

参数

名称位置类型必填说明
session_idpathstring是Session id from session creation or listing, or the own face’s session name for a main session.

请求体

必填内容类型说明
否application/json

响应

状态码内容类型说明
200application/jsonThe session, now on the requested version; an unchanged version answers the session as it stands and writes no event.
400INVALID_PARAMS: version is not a positive integer.
401Authentication required.
403FORBIDDEN: an embedded end user talks to an agent but never reconfigures the session it talks on, so it cannot change the agent version.
404Session not found or not writable by this caller; AGENT_VERSION_NOT_FOUND when the agent has no such version.
409SESSION_CONFLICT: the session is running a turn, so the version was not changed; retry once it is idle. SESSION_ARCHIVED: an archived session cannot be moved.
502Agent service failed
503Agent service unavailable