跳转到主要内容
PUT
https://aihubmix.com
/
api
/
token
更新 KEY
curl --request PUT \
  --url https://aihubmix.com/api/token/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "id": 123
}'
{
  "success": true,
  "message": "<string>",
  "data": {
    "id": 123,
    "user_id": 123,
    "status": 123,
    "name": "<string>",
    "created_time": 123,
    "accessed_time": 123,
    "expired_time": 123,
    "remain_quota": 123,
    "unlimited_quota": true,
    "used_quota": 123,
    "models": "<string>",
    "subnet": "<string>"
  }
}

请求参数

请求头(headers)

请求身份认证。接口使用 AIHubMix Manage Key 进行身份认证。
请求内容类型。此参数必须设置为 application/json。

路径参数(Path)

id
integer
必填
KEY ID。

请求体(Request Body)

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