管理金鑰
建立 BYOK 金鑰
為組織建立一把 BYOK 上游金鑰並立即同步模型目錄。上游金鑰(apiKey)僅在此請求中以明文出現,儲存時加密,之後永遠只回傳遮蔽形式(keyMask)。建立成功回 201,附上金鑰物件與模型同步結果(sync)。
POST
/api/v1/management/byok-keys驗證
Authorization必填string · header
在 Authorization 標頭以 Bearer token 傳入 API 金鑰。
Body
name必填string
金鑰的顯示名稱。
1-200 chars
baseUrl必填string
上游供應商的 API base URL。私有/內網位址會被拒絕(400)。
1-2000 chars, public HTTPS endpoint
apiKey必填string
上游供應商的 API 金鑰明文。只在此請求出現;儲存加密,之後僅回傳 keyMask。
1-2000 chars
protocolstring
上游的 API 介面協定,預設 openai。
openaianthropicExample:
"openai"fallbackModestring
上游失敗時的行為:seamless(預設)=無縫回退到平台路由;strict=不回退,直接回錯誤。
seamlessstrictExample:
"seamless"disabledCanonicalIdsstring[]
建立時要先停用的模型(canonical id)清單;同步後這些模型不會經此金鑰路由。
≤2000 items
scopedApiKeyIdsstring[]
限定此 BYOK 只套用於哪些平台 API 金鑰(金鑰 id)。空/省略=組織全部金鑰適用。含不屬於你組織的金鑰 id 會被拒(400)。
≤200 items; must be your own keys
回應範例