根据智能体 ID 返回完整配置。默认返回最新版本,可通过 version 参数指定历史版本。
前提
已完成 Endpoint 与鉴权配置,详见API 总览与认证。
接口
GET
/agents/{agent_id}路径参数
agent_idstring必填Agent ID,格式 agent_<ULID>
查询参数
versionstring可选版本号(大于等于 1 的整数字符串)或 latest;不传时返回最新版本,传正整数字符串时读取固定版本快照
请求示例
# 默认返回最新版本
curl "$AGENTSTUDIO_URL/agents/agent_xxx" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
# 指定版本
curl "$AGENTSTUDIO_URL/agents/agent_xxx?version=3" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
# 默认返回最新版本
agent = client.agents.retrieve("agent_xxx")
# 指定版本
agent = client.agents.retrieve("agent_xxx", version=3)
// 默认返回最新版本
Agent agent = client.agents().retrieve("agent_xxx");
// 指定版本
Agent agentV2 = client.agents().retrieve("agent_xxx", 2);
响应字段
idstring智能体 ID,格式 agent_<ULID>
typestring固定为 agent
versionint当前版本号,每次更新自动递增;会话创建时锁定该值
namestring智能体名称
descriptionstring用途说明
systemstring系统提示词
modelobject模型配置,包含 id 等模型参数
idstring模型 ID,如 qwen3.7-max
enable_thinkingboolean是否启用思考模式
max_tokensinteger最大生成长度
temperaturenumber温度参数,控制随机性
thinking_budgetinteger思考预算长度
toolsarray<object>工具包列表,按类型分组
typestringbuiltin_toolkit 或 mcp_toolkit
default_configobject默认工具配置,包含 enabled 与 permission_policy
configsarray<object>逐工具配置,覆盖 default_config;支持 params
mcp_server_namestringMCP 类工具需指定
mcp_serversarray<object>MCP Server 引用列表
typestringofficial 或 customer
namestringMCP Server 名称
skillsarray<object>挂载的技能列表
typestringofficial 或 customer
skill_idstringSkill ID
versionstring必须锁定到具体版本号
multiagentobject多智能体协作配置
typestring当前仅 coordinator
agentsarray<object>编队条目,1-20 个;每项含 type、id、version
metadataobject业务自定义键值,不影响模型行为
archived_atstring / null归档时间,未归档时为 null
created_atstring创建时间,ISO 8601
updated_atstring最近更新时间,ISO 8601
workspace_idstring所属工作空间 ID
request_idstring本次请求的唯一标识
响应示例
{
"type": "agent",
"id": "agent_xxx",
"name": "data-analyst",
"model": {
"id": "qwen3.8-max",
"temperature": null,
"max_tokens": null,
"enable_thinking": null,
"thinking_budget": null
},
"system": "你是数据分析专家。",
"description": "数据分析助手",
"tools": [],
"mcp_servers": [],
"skills": [],
"multiagent": {
"type": "coordinator",
"agents": [
{"type": "self"},
{"type": "agent", "id": "agent_researcher", "version": 3}
],
"workflows": {
"type": "enabled",
"inline_agents": {"type": "enabled"},
"predefined_agents": []
},
"reuse_workflows": {
"type": "enabled",
"workflows": [
{"id": "wf_01M7RMD9PRNVEPY2QKW1MA36TE", "version": 1}
]
}
},
"metadata": {},
"version": 1,
"created_at": "2026-05-28T16:23:11.456+08:00",
"updated_at": "2026-05-28T16:30:00.000+08:00",
"archived_at": null,
"workspace_id": "ws_xxx",
"request_id": "req_xxx"
}
该文章对您有帮助吗?