跳至內容

取代 Agent(CAS)

PATCH/v1/agents/{agent_id}

使用 compare-and-set 的產品更新。row_version 為必填,且必須等於目前的值,否則回傳 409。提供的欄位會取代已儲存的值;明確傳入 null 會回傳 400。當多位編輯者可能修改同一個 Agent 時,請使用此形式。

路徑參數

stringagent_id必填

Agent ID(agt_ 前綴)。

標頭

選用<string>Idempotency-Key

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

請求本文

row_version 加上任意 Agent 欄位子集。

integerrow_version必填

您最後讀取到的 row_version。值過期時會回傳 409。

選用<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 模式,且尚未支援用戶端 function 結果。

選用<object>text

format.type 為 text 或 json_schema(搭配 object 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 個字元。

選用<string>description

最多 4096 個字元。

選用<string>note

記錄在新版本上的變更說明。