批量修改令牌
PUT /api/token/batch
概览
| Method | PUT |
|---|---|
| Path | /api/token/batch |
| Type | http |
| Status | -2 |
| Module | 2102810 |
| Folder | 53539301 |
参数
{ "header": [ { "required": false, "description": "", "type": "string", "id": "c8Y8hgdO7d", "enable": true, "name": "content-type", "sampleValue": "application/json" }, { "required": false, "description": " 你的账户id", "type": "string", "id": "ibM5mMeOIy", "enable": true, "name": "new-api-user", "sampleValue": "1" }, { "required": false, "description": "系统令牌", "type": "string", "id": "Y46PW6TgLX", "enable": true, "name": "Authorization", "sampleValue": "" } ] }
请求体
{ "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", "properties": { "ids": { "type": "object", "properties": { "873,869": { "type": "string", "description": "某个id 或多个id,用逗号分隔" } }, "x-apifox-orders": [ "873,869" ], "description": "这里是要修改的token id,多个以逗号分隔", "required": [ "873,869" ] }, "group": { "type": "string", "description": "【可选】分组 多个逗号分隔,顺序优先" }, "expired_time": { "type": "integer", "description": "【可选】过期时间" }, "remain_quota": { "type": "integer", "description": "【可选】额度 50w为1刀" }, "unlimited_quota": { "type": "boolean", "description": "【可选】true 为无限额度,false 则填写 remain_quota有效" }, "model_limits": { "type": "string", "description": "【可选】模型限制列表 多个以逗号分隔" }, "model_limits_enabled": { "type": "boolean", "description": "【可选】访问限制【可用模型限制设置】" }, "allow_ips": { "type": "string", "description": "【可选】白名单 按\\n号分割" }, "mj_image_mode": { "type": "string", "description": "【可选】配置图片代理方式 暂时只有 origin 和 proxy 两种" }, "mj_custom_proxy": { "type": "string", "description": "【可选】自定义图片代理地址 只有 mj_image_mode 为" }, "update_fields": { "type": "object", "properties": { "group": { "type": "string", "description": "【可选】分组" }, "expired_time": { "type": "string", "description": "【可选】过期时间" }, "remain_quota": { "type": "string", "description": "【可选】额度 50w为1刀" }, "unlimited_quota": { "type": "string", "description": "【可选】true 为无限额度,false 则填写 remain_quota有效" }, "model_limits": { "type": "string", "description": "【可选】模型限制列表" }, "allow_ips": { "type": "string", "description": "【可选】白名单 按\\n号分割" }, "mj_image_mode": { "type": "string", "description": "【可选】配置图片代理方式" }, "mj_custom_proxy": { "type": "string", "description": "【可选】自定义图片代理地址" }, "model_limits_enabled": { "type": "string", "description": "【可选】访问限制【可用模型限制设置】" } }, "x-apifox-orders": [ "group", "expired_time", "remain_quota", "unlimited_quota", "model_limits", "allow_ips", "mj_image_mode", "mj_custom_proxy", "model_limits_enabled" ], "required": [ "group", "expired_time", "remain_quota", "unlimited_quota", "model_limits", "allow_ips", "mj_image_mode", "mj_custom_proxy", "model_limits_enabled" ], "description": "修改的" } }, "x-apifox-orders": [ "ids", "group", "expired_time", "remain_quota", "unlimited_quota", "model_limits", "model_limits_enabled", "allow_ips", "mj_image_mode", "mj_custom_proxy", "update_fields" ], "required": [ "ids", "group", "expired_time", "remain_quota", "unlimited_quota", "model_limits", "model_limits_enabled", "allow_ips", "mj_image_mode", "mj_custom_proxy", "update_fields" ] }, "required": true, "mediaType": "", "examples": [ { "mediaType": "application/json", "value": "{\r\n // 这里是要修改的token id,所以要先获取token id\r\n \"ids\": [\r\n 873,\r\n 869\r\n ],\r\n\r\n // 【分组优先级选择】,可以多个逗号分隔\r\n \"group\": \"default\",\r\n\r\n // 【过期时间】,如果是【永不限制】,则填-1,也可以填写时间戳\r\n \"expired_time\": 1776410923,\r\n\r\n // 【额度】\r\n \"remain_quota\": 0,\r\n\r\n // 【额度】,如果为true 则为【无限额度】\r\n \"unlimited_quota\": true,\r\n\r\n // 【模型限制列表】多选,逗号分隔开来\r\n \"model_limits\": \"gpt-4o,gpt-4o-2024-11-20\",\r\n\r\n // 访问限制【可用模型限制设置】\r\n \"model_limits_enabled\": true,\r\n\r\n // 访问限制【白名单】\r\n \"allow_ips\": \"192.168.1.1\",\r\n\r\n // 此列对应【Midjourney 设置 配置图片代理方式】 \r\n \"mj_image_mode\": \"origin\",\r\n\r\n // 自定义图片代理地址 【目前只有:配置图片代理方式为 <(proxy) 图片代理地址(国外很慢,国内可以访问)>】\r\n \"mj_custom_proxy\": \"\",\r\n \r\n // 需要批量修改的列【字段】,可以选择其中的一个或者全部\r\n \"update_fields\": [\r\n \"group\",\r\n \"expired_time\",\r\n \"remain_quota\",\r\n \"unlimited_quota\",\r\n \"model_limits\",\r\n \"allow_ips\",\r\n \"mj_image_mode\",\r\n \"mj_custom_proxy\"\r\n ]\r\n}" } ], "oasExtensions": "" }
响应
[ { "id": 191256670, "name": "成功", "code": 200, "contentType": "json", "jsonSchema": { "type": "object", "properties": { "data": { "type": "integer", "description": "修改的行数" }, "success": { "type": "string", "description": "是否执行成功" }, "message": { "type": "string", "description": "执行说明" } }, "x-apifox-orders": [ "data", "success", "message" ], "required": [ "data", "success", "message" ] }, "itemSchema": {}, "description": "", "mediaType": "", "headers": [] } ]