Theme
Batch Modify Tokens
PUT
https://www.kkiai.com/api/token/batch
Request Parameters
Header Parameters
| Parameter Name | Type | Required | Description | Example |
|---|---|---|---|---|
content-type | string | Optional | application/json | |
new-api-user | string | Optional | 1 | |
Authorization | string | Optional |
Body Parameters (application/json)
| Parameter Name | Type | Required | Description |
|---|---|---|---|
ids | object | Required | Token IDs to modify, multiple separated by commas |
└ 873,869 | string | Required | Single ID or multiple IDs separated by commas |
group | string | Required | [Optional] Group, multiple separated by commas, order takes priority |
expired_time | integer | Required | |
remain_quota | integer | Required | [Optional] Quota, 500k = 1 dollar |
unlimited_quota | boolean | Required | [Optional] true for unlimited quota, false to use remain_quota |
model_limits | string | Required | [Optional] Model restriction list, multiple separated by commas |
model_limits_enabled | boolean | Required | [Optional] Access restriction [Available with model limit settings] |
allow_ips | string | Required | [Optional] Whitelist, separated by \n |
mj_image_mode | string | Required | [Optional] Configure image proxy method, currently only origin and proxy |
mj_custom_proxy | string | Required | [Optional] Custom image proxy address, only when mj_image_mode is |
update_fields | object | Required | |
└ group | string | Required | |
└ expired_time | string | Required | |
└ remain_quota | string | Required | [Optional] Quota, 500k = 1 dollar |
└ unlimited_quota | string | Required | [Optional] true for unlimited quota, false to use remain_quota |
└ model_limits | string | Required | [Optional] Model restriction list |
└ allow_ips | string | Required | [Optional] Whitelist, separated by \n |
└ mj_image_mode | string | Required | [Optional] Configure image proxy method |
└ mj_custom_proxy | string | Required | [Optional] Custom image proxy address |
└ model_limits_enabled | string | Required | [Optional] Access restriction [Available with model limit settings] |
Request Example
json
{
// Token IDs to modify, retrieve token ID first
"ids": [
873,
869
],
// [Group priority selection], multiple separated by commas
"group": "default",
// [Expiration time], fill -1 for [never expire], or use timestamp
"expired_time": 1776410923,
// [Quota]
"remain_quota": 0,
// [Quota], true for [unlimited quota]
"unlimited_quota": true,
// [Model restriction list] multiple selections, separated by commas
"model_limits": "gpt-4o,gpt-4o-2024-11-20",
// Access restriction [Available with model limit settings]
"model_limits_enabled": true,
// Access restriction [Whitelist]
"allow_ips": "192.168.1.1",
// This column corresponds to [Midjourney Settings Configure image proxy method]
"mj_image_mode": "origin",
// Custom image proxy address [Currently only: configure image proxy method as <(proxy) image proxy address (slow abroad, accessible domestically)>]
"mj_custom_proxy": "",
// Fields to batch modify [fields], can select one or all
"update_fields": [
"group",
"expired_time",
"remain_quota",
"unlimited_quota",
"model_limits",
"allow_ips",
"mj_image_mode",
"mj_custom_proxy"
]
}cURL Example
bash
curl --location --request PUT 'https://www.kkiai.com/api/token/batch' \
--header 'new-api-user: 1' \
--header 'Authorization;' \
--header 'content-type: application/json' \
--data-raw '{
// Token IDs to modify, retrieve token ID first
"ids": [
873,
869
],
// [Group priority selection], multiple separated by commas
"group": "default",
// [Expiration time], fill -1 for [never expire], or use timestamp
"expired_time": 1776410923,
// [Quota]
"remain_quota": 0,
// [Quota], true for [unlimited quota]
"unlimited_quota": true,
// [Model restriction list] multiple selections, separated by commas
"model_limits": "gpt-4o,gpt-4o-2024-11-20",
// Access restriction [Available with model limit settings]
"model_limits_enabled": true,
// Access restriction [Whitelist]
"allow_ips": "192.168.1.1",
// This column corresponds to [Midjourney Settings Configure image proxy method]
"mj_image_mode": "origin",
// Custom image proxy address [Currently only: configure image proxy method as <(proxy) image proxy address (slow abroad, accessible domestically)>]
"mj_custom_proxy": "",
// Fields to batch modify [fields], can select one or all
"update_fields": [
"group",
"expired_time",
"remain_quota",
"unlimited_quota",
"model_limits",
"allow_ips",
"mj_image_mode",
"mj_custom_proxy"
]
}'Response
🟢 200 Success
Response Body
| Parameter Name | Type | Required | Description |
|---|---|---|---|
data | integer | Required | |
success | string | Required | |
message | string | Required |
Response Example
json
{
"data": 0,
"success": "string",
"message": "string"
}