Skip to main content
POST
https://aihubmix.com
/
api
/
token
Create New KEY
curl --request POST \
  --url https://aihubmix.com/api/token/ \
  --header 'Authorization: Bearer <token>'
{
  "name": "<string>",
  "expired_time": 123,
  "unlimited_quota": true,
  "remain_quota": 123,
  "models": "<string>",
  "subnet": "<string>",
  "data": {
    "id": 123,
    "user_id": 123,
    "status": 123,
    "name": "<string>",
    "created_time": 123,
    "accessed_time": 123,
    "expired_time": "<string>",
    "remain_quota": "<string>",
    "unlimited_quota": true,
    "used_quota": 123,
    "models": "<string>",
    "subnet": "<string>"
  },
  "message": "<string>",
  "success": true
}

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.

Request Body

name
string
required
The name of the new Key.
expired_time
integer
Expiration time. Stored as a UNIX timestamp; -1 indicates it never expires.
unlimited_quota
boolean
Whether there is a quota limit.
remain_quota
integer
remain_quota is: expected quota * 500000
models
text
Restricted models.
subnet
text
Restricted IP.

Response Parameters

data
object
Information related to the user’s newly created Key (typically includes id, name, etc.).
id
integer
Key ID.
user_id
integer
User ID.
status
integer
Key status. 0 means disabled, 1 means enabled.
name
string
Key name.
created_time
integer
Key creation time, stored as a UNIX timestamp.
accessed_time
integer
Key retrieval time, stored as a UNIX timestamp.
expired_time
string
Key expiration time; -1 indicates it never expires.
remain_quota
string
Remaining quota; -1 indicates unlimited quota.
unlimited_quota
boolean
Whether there is a quota limit.
used_quota
integer
Used quota is: used_quota / 500000
models
text
Models restricted for the current Key usage.
subnet
text
IP restrictions.
message
string
Detailed information on request failure. This parameter is not returned on successful requests.
success
boolean
Whether the request was successful.