跳轉到主要內容
PUT
更新 KEY

請求參數

請求標頭

請求的身份驗證。本 API 使用 AIHubMix Manage Key 進行身份驗證。
請求的內容類型。此參數必須設定為 application/json。

路徑參數

id
integer
必填
KEY ID。

請求主體

name
string
新建立 Key 的名稱。
expired_time
integer
到期時間(UNIX 時間戳記),-1 表示永不過期。
unlimited_quota
boolean
是否為無限額度。true 表示無限制;false 表示啟用額度限制(需配合 remain_quota)。
remain_quota
integer
剩餘額度。remain_quota 應為:期望額度 * 500000(例如,若期望額度為 10,則傳入 5000000)。當 unlimited_quota 為 true 時,建議傳入 -1。
status
integer
Key 狀態。0 表示停用,1 表示啟用。
models
text
目前 Key 可使用的模型限制(為空或未提供表示無限制)。
subnet
text
IP 限制(為空或未提供表示無限制)。

回應參數

success
boolean
表示請求是否成功。
message
string
請求失敗的詳細資訊。請求成功時可能為空或不傳回。
data
object
更新後的 Key 物件。
id
integer
user_id
integer
status
integer
name
string
created_time
integer
accessed_time
integer
expired_time
integer
remain_quota
integer
unlimited_quota
boolean
used_quota
integer
models
text
subnet
text

最後更新:2026-06-01