获取令牌使用情况

GEThttps://api.apizt.com/api/usage/token/

查询当前请求所使用的模型 API Key 的额度、使用量、有效期和模型限制。

无需传令牌 ID;Authorization 中的模型 API Key 就是查询对象。该接口不返回账号全部令牌的用量。

请求参数

Header 参数

Authorizationheaderstring必需

Bearer 后填写要查询的模型 API Key(sk- 开头)。

示例: Bearer YOUR_API_KEY

Body 参数

allow_ipsbodystring必需

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

expired_timebodyinteger必需

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

groupbodystring必需

支持分组 按,号分割

model_limitsbodystring必需

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

model_limits_enabledbodyboolean必需

可用模型限制设置

namebodystring必需

令牌名字

remain_quotabodyinteger必需

50w为1刀

unlimited_quotabodyboolean必需

无限额度设置

返回响应

application/json

data object
expires_at integer

过期 unix 秒;原 `-1` 会表现为 `0`

model_limits object

模型限额配置

model_limits_enabled boolean

是否启用模型限额

name string

名称

object string

对象类型标识,如 chat.completion

total_available integer

累计可用

total_granted integer

remain + used

total_used integer

累计已用

unlimited_quota boolean

是否不限额度

message string

提示信息

success boolean

是否成功

使用要查询的模型 API Key,无需 new-api-user;该请求没有 Query 参数或请求体。

各额度字段使用平台额度单位,不是 token 数。unlimited_quota=true 时结合账号余额判断可用性。

请求体示例按参考页保留;此 GET 接口实际不发送请求体。