跳转到主要内容
GET
/
api
/
usage
/
token
cURL
curl https://api.cometapi.com/api/usage/token \
  -H "Authorization: Bearer <COMETAPI_KEY>"
{
  "code": true,
  "message": "ok",
  "data": {
    "object": "token_usage",
    "name": "production",
    "total_granted": 150000,
    "total_used": 50000,
    "total_available": 100000,
    "unlimited_quota": false,
    "model_limits": {
      "gpt-4.1": true
    },
    "model_limits_enabled": true,
    "expires_at": 0
  }
}

Documentation Index

Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt

Use this file to discover all available pages before exploring further.

使用此端点可查看请求所使用的 CometAPI API 密钥。它返回的是该 bearer 密钥的用量和配额字段,而不是账户级别的所有密钥列表。
此端点使用 CometAPI API 密钥:Authorization: Bearer <COMETAPI_KEY>。API 密钥管理端点使用单独的个人访问令牌。

返回字段

FieldTypeDescription
namestringAPI 密钥的显示名称。
total_grantedinteger以 CometAPI 内部配额单位表示,分配给此密钥的总配额。
total_usedinteger以 CometAPI 内部配额单位表示,此密钥已消耗的配额。
total_availableinteger以 CometAPI 内部配额单位表示,此密钥剩余可用的配额。
unlimited_quotaboolean该密钥是否绕过剩余配额检查。
model_limitsobject此密钥的模型限制,按 model ID 作为键。未配置模型限制时为空。
model_limits_enabledboolean是否对此密钥启用模型限制。
expires_atinteger此密钥过期的 Unix 秒级时间戳。在此用量响应中,0 表示不过期。

授权

Authorization
string
header
必填

CometAPI API key used for model requests. Send it as Authorization: Bearer <COMETAPI_KEY>.

响应

200 - application/json

Current API key usage details.

code
boolean
必填

Whether the request succeeded.

message
string
必填

Status message.

data
object
必填