读取智能体
先调用「创建智能体」,用返回的智能体 ID 替换示例 ID。
GET
/agent/v1/agents/{agent_id}● 支持请求参数
agent_idstring必填path: 智能体 ID,由 agents.create 或 agents.list 返回;用于会话筛选时,指创建该会话所用的智能体。不是智能体名称。
versionnumber可选query: 要读取的智能体版本。省略或传 active 读取新会话当前使用的生效版本。传 agents.versions.list 中至少为 1 的整数以读取该保存版本。默认响应还包含最新保存版本号 latest_version。
返回
200
tools 在一个 agent_toolset_20260401 条目中返回全部原生工具的有效配置,可原样用于更新。将示例中的资源 ID 替换成你创建的资源 ID。
错误按 Anthropic 错误格式返回(type / message / request_id),参见 错误码
请求示例
curl
# 先调用「创建智能体」,用返回的智能体 ID 替换示例 ID。
curl https://api.deepraxis.com/agent/v1/agents/agent_123 \
-H "Authorization: Bearer $PRAXIS_API_KEY"Python
# 先调用「创建智能体」,用返回的智能体 ID 替换示例 ID。
import requests
opts = dict(
base_url="https://api.deepraxis.com/agent",
api_key="$PRAXIS_API_KEY",
)
# /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
resp = requests.get(
f"{opts['base_url']}/v1/agents/agent_123",
headers={"Authorization": f"Bearer {opts['api_key']}"},
)
print(resp.status_code, resp.json())TypeScript
// 先调用「创建智能体」,用返回的智能体 ID 替换示例 ID。
const opts = {
baseURL: "https://api.deepraxis.com/agent",
apiKey: "$PRAXIS_API_KEY",
};
// /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
const resp = await fetch(`${opts.baseURL}/v1/agents/agent_123`, {
headers: { Authorization: `Bearer ${opts.apiKey}` },
});
console.log(resp.status, await resp.json());响应示例 200
{
"id": "agent_e61b492a-db90-4322-b80b-f1cd49688eaa",
"type": "agent",
"name": "文档助手",
"description": null,
"system": "用一句话简短回答。",
"model": {
"id": "deepseek-flash"
},
"metadata": {},
"tools": [
{
"type": "agent_toolset_20260401",
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_allow"
}
},
"configs": [
{
"name": "bash",
"enabled": true,
"permission_policy": null
},
{
"name": "edit",
"enabled": true,
"permission_policy": null
},
{
"name": "glob",
"enabled": true,
"permission_policy": null
},
{
"name": "grep",
"enabled": true,
"permission_policy": null
},
{
"name": "read",
"enabled": true,
"permission_policy": null
},
{
"name": "write",
"enabled": true,
"permission_policy": null
},
{
"name": "task_output",
"enabled": true,
"permission_policy": null
},
{
"name": "task_stop",
"enabled": true,
"permission_policy": null
},
{
"name": "monitor",
"enabled": true,
"permission_policy": null
},
{
"name": "agent",
"enabled": true,
"permission_policy": null
},
{
"name": "send_message",
"enabled": true,
"permission_policy": null
},
{
"name": "codemode",
"enabled": true,
"permission_policy": null
},
{
"name": "skill",
"enabled": true,
"permission_policy": null
},
{
"name": "todo_write",
"enabled": true,
"permission_policy": null
},
{
"name": "enter_plan_mode",
"enabled": true,
"permission_policy": null
},
{
"name": "ask_user_question",
"enabled": true,
"permission_policy": null
},
{
"name": "goal_read",
"enabled": true,
"permission_policy": null
},
{
"name": "web_search",
"type": "web_search",
"enabled": true,
"permission_policy": null
},
{
"name": "web_fetch",
"type": "web_fetch",
"enabled": true,
"permission_policy": null
}
]
}
],
"mcp_servers": [],
"skills": [],
"multiagent": null,
"creation_source": "api",
"identity_number": "50Q2KSMG",
"avatar": null,
"environment_id": "light",
"vault_ids": [],
"subagent_model": null,
"subagents": null,
"commands": null,
"settings": null,
"version": 1,
"active_version": 1,
"created_by": {
"type": "api_key",
"id": "key_4njccw0s4v7q17pt6yngh221"
},
"note": null,
"created_at": "2026-10-23T21:18:50.645Z",
"updated_at": "2026-10-23T21:18:50.645Z",
"archived_at": null,
"kind": "service",
"bindings": [],
"status": "active"
}响应
HTTP 200
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Agent id (agent_...). Pass it as agent when creating a session and as agent_id in agent calls. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| description | null | string | Free-text description of what the agent is for; null when none was set. |
| mcp_servers | array<object> | Praxis extension: HTTP, SSE or trusted stdio MCP servers paired with mcp_toolset entries and saved with the agent version. |
| mcp_servers[].type | string | Streamable HTTP transport. / Legacy SSE transport. / Run a command on the agent computer. |
| mcp_servers[].name | string | Name of the MCP server; the mcp_toolset entry that refers to it uses the same name in mcp_server_name. |
| mcp_servers[].url | string | HTTP or HTTPS MCP server endpoint. |
| mcp_servers[].headers | object | Praxis extension: request headers. Platform identity headers take precedence, case-insensitively. |
| mcp_servers[].timeout_ms | integer | Praxis extension: timeout in milliseconds. Applied to stdio; HTTP/SSE currently use the connection SDK default. |
| mcp_servers[].command | string | Executable command on the agent computer. |
| mcp_servers[].args | array<string> | Command arguments; omitted means no arguments. |
| mcp_servers[].env | object | Praxis extension: environment variables for the command on the agent computer. |
| metadata | object | Free-form string key/value pairs stored with the agent for your own bookkeeping. |
| model | object | Model identifier and configuration. |
| model.id | string | A model id from the Praxis model catalog (praxis.model.models.list). Unlike Anthropic, Claude model ids other than those in the catalog are rejected. |
| model.effort | object | How hard Claude works on each turn. Sets output_config.effort on every Messages call the session makes. |
| model.inference_geo | string | Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo. |
| model.speed | string | Inference 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.settings | object | Platform model settings: reasoning (default thinking level) and max_output_tokens (output cap). Other model controls return 400. |
| multiagent | null | object | Coordinator roster. A bare string agent id is equivalent to {type: "agent", id}; omitting its version pins the referenced agent's current saved version when this roster is saved. {type: "self"} refers to this agent. Specify a concrete version to pin it explicitly. |
| multiagent.agents | array<object> | Agents the coordinator may spawn as session threads, each resolved to a specific version. |
| multiagent.type | string | Always coordinator. The agent coordinates the roster in agents and can delegate to its members. |
| name | string | Display name of the agent, as set on create or update. It is a label, not a unique key. |
| skills | array<object> | 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 skill_id. Omit version, or send "latest", to use the skill's newest version at the moment a session starts; a pinned version stays fixed. type anthropic returns 400: upload the skill and attach it as custom. On update, omit the field to keep the list, send an array to replace it, or send [] or null to clear it. |
| skills[].skill_id | string | Id of the skill to attach. |
| skills[].type | string | Always anthropic. A skill provided by Anthropic, identified by skill_id. / Always custom. A skill created by you, identified by skill_id. |
| skills[].version | string | Version of the skill: omit or latest to follow the newest version at each new session; give a version id to pin it. |
| system | null | string | System prompt given to the model at the start of every session of this agent; null when none was set. |
| tools | array<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 and custom tool definitions. Custom calls emit agent.custom_tool_use and wait for user.custom_tool_result. Keep bash enabled to use codemode, skill and subagents. |
| tools[].configs | array<object> | array | null | Per-tool settings that override default_config. Tools that are not listed follow default_config. |
| tools[].default_config | object | object | null | Resolved 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[].type | string | Always agent_toolset_20260401. The native toolset entry (bash, edit, glob, grep, read, write, web_search, web_fetch, task_output, task_stop, monitor, agent, send_message). / 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_name | string | Name of the MCP server in mcp_servers whose tools this entry exposes. |
| tools[].description | string | What the custom tool does and when the model should call it. |
| tools[].input_schema | object | JSON Schema for custom tool input parameters. |
| tools[].name | string | Name of the custom tool, as the model sees and calls it. |
| type | string | Always agent. An agent definition. |
| updated_at | string | A timestamp in RFC 3339 format |
| version | number | Version of this returned configuration. Default retrieve returns the effective version; an explicit version query or a version-history item returns that saved version. |
| latest_version | integer | Newest saved version number, including an unapplied save. Returned by default retrieve, update and apply; use it for optimistic concurrency when updating. |
| active_version | integer | Agent-level currently effective version used by new sessions and newly issued embed tokens. This same value appears on every history item; it is not that item's version. Saving with apply false leaves it unchanged. Existing sessions and tokens retain their version. |
| created_by | object | null | Authenticated author who created this immutable version; null for historical versions without attribution. user identifies the signed-in user; api_key identifies the calling key. Never supplied by the request body. |
| created_by.type | string | user denotes a version saved by a signed-in user. / api_key denotes a version saved through an API key. |
| created_by.id | string | Authenticated user identifier at the time this version was saved. / Authenticated API key identifier, never the key secret. |
| created_by.name | string | User display name at save time, omitted when unavailable. |
| note | string | null | Change explanation supplied as version_note when this version was saved; null when omitted or for historical versions. Immutable after creation. |
| deployments_behind | integer | null | How many of this agent's live deployments are not on its active version: pinned to a version other than active_version, not archived, counted once each. It counts both a pin older than the active version and a pin newer than it that was saved without being applied, so read it as "not on the active version", never as "older than". Following deployments are never counted (they run the active version by definition). Null when the deployment side could not be read. Returned by update and apply too, so those answers equal the read that follows them. |
| bindings | array<object> | Platform resources and services this service agent's codemode may reach, as one list of typed bindings. Only kind=service accepts a nonempty list; general agents return 400. There are two kinds. A resource binding names one resource with id and access: database (id db_..., read_only or read_write), vector_store (id vs_..., read_only or read_write), file (id file- plus 24 letters or digits, as the File API returns it; read_only), media_library (any id without ':' or whitespace, read_only or read_write), model (a model catalog id, invoke), workflow and script (id <namespace>/<name>, invoke). A resource binding may also carry customer_access (read_only by default): it caps what a terminal customer's session (a visitor, ADR-163 §3) may do with that one resource, at the intersection of customer_access and the binding's own access — invoke (call) and read_write (change) are different axes, so only a matching pair keeps its access and any other pair falls to read_only. Its value must be one the type can grant: read_only or read_write for database, vector_store and media_library, read_only for file, and read_only or invoke for model, workflow and script. A member's session ignores it, so raising it never widens what members may do. A visitor's session never receives a whole-service binding (the default ticket service included) or an agent resource. A service binding opens one service, or one sub-tree of one, and carries only enabled: search, browser, ticket, crm, canvas, cut, studio, feedback or workspace. workspace opens development units — list one, read one, start, stop, exec inside one, fetch, push, connect, and open a unit for a change — and opens neither publishing nor any production operation. The ticket service is bound by default: a service agent whose list has no ticket entry may call the ticket API, and {"type": "ticket", "enabled": false} removes it. Every other service stays closed until it is bound. An open service allows every public method of that service. At most 20 bindings per type, no repeated type and id, and each service type at most once. A session is authorized by the agent version it runs: newly added bindings apply only to new sessions, and a version saved with apply=false changes no access until it is applied. Applying a version that disables, removes or downgrades a binding revokes it immediately in running sessions on older versions. A resource that is not bound returns 404, a service that is not opened returns 403, and a write to a resource bound read_only returns 403 BINDING_READ_ONLY. Unknown types, fields on the wrong kind (id, access, customer_access or instructions on a service binding), wrong access and malformed ids return 400. The former databases, vector_stores and files fields are removed and return 400. Omit on create for the default: the ticket service only. Saving checks added or changed database, vector_store, media_library and file bindings in the organization: unknown or deleted ids return 400. If an owner is unavailable or takes more than 3 seconds, saving succeeds with verified=false for the affected bindings. Unchanged bindings keep their previous verification result and are not rechecked. workflow and script ids are not verified at save time. |
| bindings[].type | string | Resource type. Decides the id format and the allowed access. / Service type. Opens one service, or one sub-tree of one, to codemode; there is no per-resource id. |
| bindings[].id | string | Resource id, never its name. database db_..., vector_store vs_..., file file- plus 24 letters or digits; media_library and model ids must not contain ':' or whitespace; workflow and script use <namespace>/<name> with no '/', '@', ':' or whitespace inside a part; repository pkg_..., browser_context bsc_.... |
| bindings[].access | string | database, vector_store and media_library accept read_only or read_write; file accepts read_only; model, workflow and script accept invoke; repository and browser_context accept read_only or read_write. Any other combination returns 400. |
| bindings[].customer_access | string | What a visitor's session (a terminal customer, ADR-163 §3) may do with this resource: read_only, read_write or invoke. Its scope is the intersection of this value and the binding's own access, so invoke needs both to be invoke. Limited to the accesses the type can grant: read_only or read_write for database, vector_store and media_library, read_only for file, read_only or invoke for model, workflow and script. Defaults to read_only. A member's session ignores it entirely; a visitor's session never receives a whole-service binding or an agent resource. |
| bindings[].instructions | string | Optional guidance for using this resource, up to 4096 characters; does not expand access. |
| bindings[].verified | boolean | Save-time verification result. false means the resource owner was unavailable; saving still succeeded. Unchanged bindings retain their previous result. true is returned for other bindings, including workflow and script ids which are not verified at save time. Client values are ignored. |
| bindings[].enabled | boolean | Whether this binding grants access. Defaults to true; false immediately disables it for running sessions. / Whether the service is open. Defaults to true; false immediately closes it for running sessions. |
| kind | string | Immutable agent kind. general uses a durable computer and acts for its owner; service uses a clean environment per session; assume is driven over MCP with a durable computer and no conversation model. Historical agents infer kind from their computer binding and read as general. |
| computers | object | General agents only: the agent's computers, configured like its models. default is the template its Computer starts on; allowed lists the computers resize may switch to, and a resize to anything else is refused with COMPUTER_NOT_CONFIGURED. Omit on create for {default: base, allowed: Small base-small, Base base, Large base-large}; on update, omit to keep it, send an object to replace it as a whole. Service and assume agents return 400 computers is for general agents; service agents use environment_id. /agent/v1 only. |
| computers.default | string | Template of the computer the agent's Computer starts on; must be the template of one allowed entry. |
| computers.allowed | array<object> | Computers the agent may switch to with the computer tool's resize, in the order they are listed. |
| browser | object | null | ADR-205: which browser the agent drives. {byob: byb_…} names one of your organization's paired browsers (browser.byob.browsers.list), which the agent then drives through connect() instead of a cloud browser; null or absent is the cloud browser. The browser must belong to your organization (otherwise 400) and must grant this agent before a session can open it. Omit on update to keep it, send an object to replace it, or null to go back to the cloud browser. /agent/v1 only. |
| browser.byob | string | A paired browser's id (byb_ and 26 lowercase hex characters), from browser.byob.browsers.list. |
| computer_id | string | 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. Omitted when no computer is selected. |
| subagent_model | string | null | Praxis 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. |
| subagents | array | null | Praxis extension: inline subagent definitions stored in the configuration revision, separately from the multiagent roster. Omit to preserve; null clears. Names must be unique. Configuration storage only; runtime activation is not implemented. /agent/v1 only. |
| commands | array | null | Praxis extension: command definitions saved in the configuration revision. Names must be unique and contain at most one colon. Omit to preserve; null clears. Configuration storage only; runtime activation is not implemented. /agent/v1 only. |
| settings | object | null | Agent runtime settings follow Claude Code managed settings. Praxis freezes output-style selection for each new session; inline output_styles extend file-based styles. Omit settings to keep saved settings; null clears them. |
| settings.hooks | object | Hook declarations for seven supported lifecycle events. Unknown event names return 400. |
| settings.allowManagedHooksOnly | boolean | Store the switch restricting hooks to managed configuration. |
| settings.allowManagedMcpServersOnly | boolean | Store the switch restricting MCP servers to managed configuration. |
| settings.allowManagedPermissionRulesOnly | boolean | Store the managed permission rules switch; permission rules remain on toolsets. |
| settings.idleCompaction | boolean | Whether new sessions compact large contexts while idle before the prompt cache expires; defaults to true. |
| settings.autoMemoryEnabled | boolean | Whether automatic memory is enabled in the saved configuration; defaults to true. |
| settings.disabled | object | Disabled declaration names; hooks are identified by declaration digests. |
| settings.outputStyle | string | Case-sensitive output style name: Default adds no style instructions; Concise and Explanatory are built in. Unknown names use Default. Enabled plugin styles marked force-for-plugin override this selection. The result is frozen for the main conversation when the session starts; changes apply to new sessions. Owner instructions take precedence. |
| models | object | Praxis extension: switchable model ids on /agent/v1 only. The default model must be included. When omitted, only the default model is selectable. |
| models.allowed | array<string> | Model ids a session may select with its model field; it must be non-empty and must contain the agent's default model. |
| avatar | string | null | Avatar image URL of this agent version (absolute https), shown in agent lists, the agent detail, the chat header and as the default avatar of embedded chat; null when none is set. Follows the version like other configuration: a version saved with apply=false does not change the avatar in effect. /agent/v1 only. |
| creation_source | string | null | Channel the agent was created through (for example api or console); null for historical agents whose channel is unknown. Display only. /agent/v1 only; /anthropic neither returns it. |
| managed_by | string | null | Application that manages this agent (for example praxis-work); null when no application does. Set when the agent is created, or claimed once by an update that sends the same value in the Praxis-Managed-By header; never changes after. Archiving a managed agent without the managing application's Praxis-Managed-By header returns 409 AGENT_MANAGED_BY_APPLICATION; configuration stays changeable. An accident guard, not a security boundary. /agent/v1 only; /anthropic neither returns it. |
| identity_number | string | null | Platform-wide identity number of the agent (8 characters), usable wherever an agent is addressed by identity_number; null when the agent has none. /agent/v1 only; /anthropic neither returns it. |
| environment_id | string | null | Default environment of this service agent version: the environment_id new sessions get when they name none; null means no environment. Present for service agents only. Follows the version like other configuration: a version saved with apply=false does not change the environment in effect. Versions saved before this field existed read as light. /agent/v1 only. |
| vault_ids | array<string> | Default vaults of this service or assume agent version: the vault_ids every new session carries; a session's own vault_ids are added to them. Present for service and assume agents. Follows the version like other configuration: a version saved with apply=false does not change the vaults in effect. Versions saved before this field existed read as []. /agent/v1 only. |
| status | string | Current agent lifecycle status; unarchive restores an archived agent to active. |
| output_styles | array<object> | null | Inline custom output styles, including for agents without a computer. Omit to keep the saved list; null or [] clears it. Same-name precedence is inline, project files, personal files, then plugins. Selection is settings.outputStyle; styles apply to main conversations and are frozen per session. |