Skip to main content
PUT
https://aihubmix.com
/
api
/
token
Update 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>"
  }
}

Request Parameters

Request Headers

Authentication for the request. This API uses the AIHubMix Manage Key for authentication.
The content type of the request. This parameter must be set to application/json.

Path Parameters

id
integer
required
KEY ID.

Request Body

name
string
The name of the new Key.
expired_time
integer
Expiration time (UNIX timestamp), -1 means never expires.
unlimited_quota
boolean
Whether the quota is unlimited. true means unlimited; false means a quota is enabled (requires remain_quota).
remain_quota
integer
Remaining quota. remain_quota should be: desired quota * 500000 (for example, if the desired quota is 10, then pass 5000000). When unlimited_quota is true, it is recommended to pass -1.
status
integer
Key status. 0 means disabled, 1 means enabled.
models
text
Restrictions on the models that the current Key can use (empty or not provided means no restrictions).
subnet
text
IP restrictions (empty or not provided means no restrictions).

Response Parameters

success
boolean
Indicates whether the request was successful.
message
string
Detailed information on request failure. May be empty or not returned when the request is successful.
data
object
The updated Key object.
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