修改令牌

PUThttps://api.apizt.com/api/token/

修改当前账号下指定令牌的配置,或通过 status_only 仅切换启用状态。

普通修改提交完整配置:先读取原有值,再修改目标字段后提交,避免把未提交字段当作保持不变。

请求参数

Query 参数

status_onlyqueryboolean可选

为 true 时仅更新状态;请求体只需 id 和 status。

Header 参数

Authorizationheaderstring必需

Bearer 后填写个人设置中的系统访问令牌,不使用模型 API Key。

示例: Bearer YOUR_SYSTEM_ACCESS_TOKEN

new-api-userheaderstring必需

当前用户 ID,须与系统访问令牌所属账号一致。

示例: 1

Content-Typeheaderstring必需

请求体使用 JSON。

示例: application/json

Body 参数 application/json

allow_ipsbodystring必需

白名单IP列表: 按\n号分割

expired_timebodyinteger必需

到期时间戳 单位秒 没有到期限制设置为-1

groupbodystring必需

支持分组 按,号分割

model_limitsbodystring必需

可用模型列表: 模型名字按,号分割

model_limits_enabledbodyboolean必需

可用模型限制设置

namebodystring必需

令牌名字

remain_quotabodyinteger必需

50w为1刀

unlimited_quotabodyboolean必需

无限额度设置

返回响应

application/json

data object
accessed_time integer

最近访问时间(Unix 时间戳)

allow_ips string

IP 白名单,换行分隔

created_time integer

创建时间(Unix 时间戳)

expired_time integer

过期时间戳(秒);`-1` 表示永不过期

group string

用户组 / 分组

id integer

资源或任务 ID

key string

令牌密钥(列表场景可能脱敏)

mj_custom_proxy string

Midjourney 自定义代理

mj_image_mode string

Midjourney 图片模式

model_limits string

可用模型列表,逗号分隔

model_limits_enabled boolean

是否启用模型限额

name string

令牌名称(最长约 30)

remain_quota integer

剩余额度

routing_priority string

`""` | `auto` | `price` | `speed` | `success_rate`

status integer

状态

total integer

总数

unlimited_quota boolean

是否不限额度

used_quota integer

已用额度

user_id integer

用户 ID

message string

提示信息

success boolean

是否成功

调用时需携带系统访问令牌和当前账号 ID,填写方式见 Header 参数。

响应为结构示例,实际错误文本以返回的 message 或 error.message 为准。

仅禁用令牌时,请求 PUT /api/token/?status_only=true,Body 为 {"id":123,"status":2}。启用时将 status 改为 1。