查询当前 API Key
GET
/v1/key先选择查询范围与凭证
- 单个 Key 用量/限额:使用该推理 API Key 调用
GET /v1/key,读取usage、limit_remaining、limit_reset。这是 Key 的消费预算,不是企业钱包或授信余额。 - 企业钱包与授信:使用仅含
tenant:billing:read的MANAGEMENTKey 调用GET /enterprise/v1/billing/balance。不要用推理 Key 或 PROVISIONING Key。 - 账户费用汇总/请求对账:现有
GET /v1/billing、GET /v1/billing/requests/{request_id}使用推理 Key 或登录态 JWT;管理 Key 不能调用这些/v1接口。费用明细与余额是不同指标。 - 旧账户余额接口:
GET /v1/billing/balance保留兼容,返回账户级资金,不代表调用 Key 的剩余预算;新企业余额监控优先使用 Enterprise 接口。
查询当前请求所使用的 API Key 信息。
身份验证
Authorization Bearer
在 Authorization 请求头中使用要查询的推理 API Key。管理 Key、PROVISIONING Key 和登录态 JWT 均不支持此接口。
响应
dataobject当前 API Key 信息。
data.hashstring管理接口使用的 hash 标识。
data.namestringAPI Key 名称。
data.labelstring展示标签,与 name 一致。
data.disabledboolean当 Key 状态不是 ACTIVE 或 expires_at 已过期时为 true。
data.workspace_idstringKey 所属 workspace code。
data.creator_user_idstring | null所有者用户公开 UUID。
data.created_atstring创建时间,UTC ISO-8601 格式。
data.updated_atstring | null最后更新时间。
data.expires_atstring | nullUTC 过期时间,或 null。
data.usagenumber该 Key 累计消费金额(USD),不是赠送 Credit 余额。
data.usage_dailynumber当前 UTC 日内该 Key 的消费金额(USD)。
data.usage_weeklynumber当前 UTC 周内该 Key 的消费金额(USD),周一开始。
data.usage_monthlynumber当前 UTC 自然月内该 Key 的消费金额(USD)。
data.limitnumber | null配置的 Key 消费上限(USD);未设置时为 null。
data.limit_remainingnumber | null适用限额周期内的剩余预算(USD);未设置上限时为 null。
data.limit_resetstring | nulldaily | weekly | monthly | null(终身)。
data.is_free_tierboolean当前为 false。
data.is_management_keyboolean本接口接受推理 Key,此字段为 false。
data.is_provisioning_keyboolean当前为 false。
data.rate_limitobject每分钟请求限制信息。
此页面对您有帮助吗?