跳至內容

更新 Agent

POST/v1/agents/{agent_id}

SDK 風格的部分更新。提供的欄位會取代已儲存的值並建立新版本;省略的欄位保留原值。不需要 row_version。此處不接受 description 與 note;請改用 Replace(PATCH)更新這些欄位。已封存的 Agent 會回傳 404。

路徑參數

stringagent_id必填

Agent ID(agt_ 前綴)。

標頭

選用<string>Idempotency-Key

選用。省略時服務會自動產生一組,因此重試的請求可能會建立重複項目。重試時請傳送您自己的固定金鑰。

請求主體

以下欄位的任意子集。其他欄位會回傳 400。

選用<string>model

來自 Models API 的模型 ID,最多 200 個字元。

選用<string>name

顯示名稱,最多 128 個字元。

選用<string>instructions

系統指示,最多 256 KiB。

選用<string>runtime_profile

執行環境:codex(預設)、claude 或 mcode。

選用<array>skills

技能參照:{"skill_id": "skl_…", "version": null | "<version>"}。最多 32 個。對新繫結而言,null 會在儲存 Agent 時固定為當下的預設版本。對既有繫結而言,null 會保留其已固定的版本;若要升級請指定明確版本。

選用<array>mcp_connections

MCP 參照:{connection_id, server_label, allowed_tools, required}。最多 32 個;server_label 在 Agent 內不可重複。

選用<array>tools

最多 64 個 function 工具,加上最多一個 web_search 工具。工作階段目前要求 web_search 模式為 disabled,且尚不支援用戶端回傳的 function 結果。

選用<object>text

format.type 為 text 或 json_schema(搭配物件 schema);verbosity 為 low、medium 或 high。

選用<object>reasoning

effort 為 none、minimal、low、medium、high、xhigh 或 max;summary 為 concise、detailed 或 auto。

選用<string>service_tier

auto(預設)、default、flex、priority 或 fast。

選用<object>metadata

最多 16 組字串鍵值;鍵最多 64 個字元,值最多 512 個字元。