获取令牌使用情况
GET
https://api.apizt.com/api/usage/token/查询当前请求所使用的模型 API Key 的额度、使用量、有效期和模型限制。
无需传令牌 ID;Authorization 中的模型 API Key 就是查询对象。该接口不返回账号全部令牌的用量。
请求参数
Header 参数
Authorizationheaderstring必需Bearer 后填写要查询的模型 API Key(sk- 开头)。
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 integerremain + used
total_used integer累计已用
unlimited_quota boolean是否不限额度
message string提示信息
success boolean是否成功
application/json
error* object
message* string错误说明(末尾常附带 request id)
type* string错误类型;网关本地错误一般为 new_api_error
使用要查询的模型 API Key,无需 new-api-user;该请求没有 Query 参数或请求体。
各额度字段使用平台额度单位,不是 token 数。unlimited_quota=true 时结合账号余额判断可用性。
请求体示例按参考页保留;此 GET 接口实际不发送请求体。