更新 Agent
/v1/agents/{agent_id}SDK 风格的部分更新。提供的字段会替换已保存的值并创建新版本;省略的字段保持原值。无需 row_version。此处不接受 description 和 note;如需修改请使用 Replace (PATCH)。已归档的 Agent 返回 404。
路径参数
Agent ID(agt_ 前缀)。
请求头
可选。省略时服务会自动生成一个,因此重试请求可能会创建重复项。重试时请发送你自己的固定键。
请求体
以下字段的任意子集。其他字段返回 400。
来自 Models API 的模型 ID,最多 200 个字符。
显示名称,最多 128 个字符。
系统指令,最大 256 KiB。
执行运行时:codex(默认)、claude 或 mcode。
技能引用:{"skill_id": "skl_…", "version": null | "<version>"}。最多 32 个。对于新绑定,null 会在保存 Agent 时固定为当前默认版本。对于已有绑定,null 会保留其固定版本;如需升级,请指定明确版本。
MCP 引用:{connection_id, server_label, allowed_tools, required}。最多 32 个;server_label 在 Agent 内必须唯一。
最多 64 个 function 工具,以及最多一个 web_search 工具。目前会话要求 web_search 的 mode 为 disabled,且暂不支持客户端返回 function 结果。
format.type 为 text 或 json_schema(使用对象 schema);verbosity 为 low、medium 或 high。
effort 为 none、minimal、low、medium、high、xhigh 或 max;summary 为 concise、detailed 或 auto。
auto(默认)、default、flex、priority 或 fast。
最多 16 个字符串键值对;键最多 64 个字符,值最多 512 个字符。