建立 Agent
/v1/agents建立版本為 1 的已儲存 Agent。請求本文為嚴格 JSON:未知欄位會傳回 400。multi_agent 必須省略或為 null。
標頭
選用。省略時由服務自動產生,因此重試的請求可能會建立重複項目。重試時請傳送您自己的固定金鑰。
請求本文
JSON 物件。
必填,來自 Models API 的模型 ID,最多 200 個字元。沒有預設值;省略 model 會傳回 400。範例使用 deepseek/deepseek-v4-flash。
顯示名稱,最多 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 內必須唯一。省略時會使用內建的 SandBase 工具({"connection_id": "builtin:sandbase", "server_label": "sandbase_builtin"});您傳送的清單會取代此預設值,傳送 [] 則會建立沒有工具的 Agent。請參閱內建 SandBase 工具(/agents/mcp-tools#built-in-sandbase-tools)。
最多 64 個 function 工具,以及至多一個 web_search 工具。工作階段目前要求停用 web_search 模式,且尚不支援用戶端 function 結果。
format.type 為 text 或 json_schema(搭配 object 結構描述);verbosity 為 low、medium 或 high。
effort 為 none、minimal、low、medium、high、xhigh 或 max;summary 為 concise、detailed 或 auto。
auto(預設)、default、flex、priority 或 fast。
最多 16 組字串配對;鍵最多 64 個字元,值最多 512 個字元。
較長的描述,最多 4096 個字元。
記錄於版本 1 的變更說明。
Agent 物件
由 create、get、update、archive、unarchive、restore 與 clone 傳回。
帶有 agt_ 前綴的 Agent ID。
固定為 agent。
目前版本。每次有效寫入都會建立新版本。
用於 PATCH、archive、unarchive 與 restore 的比較並設定(compare-and-set)權杖。
active 或 archived。
目前版本的執行就緒狀態。工作階段需要 ready;新建立的 Agent 可能短暫回報 pending。
codex、claude 或 mcode。
您的 Agent 為 private;目錄項目為 public。
Unix 秒數。啟用期間 archived_at 為 null。