Batch Update Tokens
PUT
/api/token/batch
- Batch update the configuration of multiple API tokens
- Can update groups, quotas, expiration time, model restrictions, etc.
- Requires system token authentication
Authorizations
bearer
Type
HTTP (bearer)
Request Body
application/json
ids
integer[]
Required
List of token IDs to update
group
string
[Optional] Groups, separated by comma, priority by order
expired_time
integer
[Optional] Expiration time
remain_quota
integer
[Optional] Quota, 50w equals $1
unlimited_quota
boolean
[Optional] true for unlimited quota, false means remain_quota is effective
model_limits
string
[Optional] Model restriction list, separated by comma
model_limits_enabled
boolean
[Optional] Enable model restrictions
allow_ips
string
[Optional] Whitelist, separated by newline
mj_image_mode
string
[Optional] Image proxy mode, only origin and proxy available
mj_custom_proxy
string
[Optional] Custom image proxy URL, only effective when mj_image_mode is proxy
update_fields
string[]
Required
List of fields to update in batch
Responses
Success
application/json
object
data
integer
Number of rows updated
success
string
Whether execution was successful
message
string
Execution message