Skip to main content
CometAPI provides two ways to check account balance and usage: the CometAPI CLI and the query service API at query.cometapi.com.

CometAPI CLI

The fastest way to check your balance from the terminal. See CometAPI CLI overview for installation.
cometapi balance
Add --source token for per-key details:
cometapi balance --source token
See the commands reference for all available options.

Query service API

GET https://query.cometapi.com/user/quota Returns account-level balance, cumulative usage, total request count, and per-key quota details. This endpoint uses a separate query service at query.cometapi.com and authenticates via the key query parameter rather than a Bearer Token.
Generate a dedicated API key for balance queries and set its quota to 0 (query-only permission). Even if the key is leaked, it cannot be used for model requests.

Request parameters

ParameterTypeRequiredDescription
keystringYesYour CometAPI API key
start_datestringNoStart date for daily breakdown (YYYY-MM-DD format)
end_datestringNoEnd date for daily breakdown (YYYY-MM-DD format)
When start_date and end_date are provided, the response includes a daily_quota field with per-key usage broken down by day.

Response fields

FieldTypeDescription
usernamestringUsername
total_quotanumberCurrent account balance (USD)
total_used_quotanumberCumulative usage (USD)
request_countintegerTotal request count
keysarrayPer-key quota details
keys[].namestringAPI key name
keys[].remain_quotanumberKey remaining quota; -1 means unlimited
keys[].used_quotanumberKey used quota; -1 means unlimited
daily_quotaobjectDaily usage breakdown (only when start_date and end_date are set)
daily_quota[date]arrayPer-key usage entries for that date
daily_quota[date][].token_namestringAPI key name
daily_quota[date][].quota_usednumberUsage for that key on that date (USD)
daily_quota[date][].request_countintegerRequest count for that key on that date

Code examples

Query account balance:
curl "https://query.cometapi.com/user/quota?key=$COMETAPI_KEY"

Response example

{
  "username": "example_user",
  "total_quota": 2105.23,
  "total_used_quota": 21.07,
  "request_count": 1221,
  "keys": [
    {
      "name": "my-key",
      "remain_quota": 8.94,
      "used_quota": 2.10
    }
  ]
}

Daily breakdown example

Query daily usage for a date range:
curl "https://query.cometapi.com/user/quota?key=$COMETAPI_KEY&start_date=2026-04-13&end_date=2026-04-14"
The response includes the same top-level fields plus daily_quota:
{
  "username": "example_user",
  "total_quota": 2105.23,
  "total_used_quota": 21.07,
  "request_count": 1221,
  "daily_quota": {
    "2026-04-13T00:00:00Z": [
      {
        "token_name": "my-key",
        "quota_used": 4.27,
        "request_count": 59
      }
    ],
    "2026-04-14T00:00:00Z": [
      {
        "token_name": "my-key",
        "quota_used": 0.57,
        "request_count": 36
      }
    ]
  }
}