CometAPI provides two ways to check account balance and usage: the CometAPI CLI and the query service API at query.cometapi.com.
The fastest way to check your balance from the terminal. See CometAPI CLI overview for installation.
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
| Parameter | Type | Required | Description |
|---|
key | string | Yes | Your CometAPI API key |
start_date | string | No | Start date for daily breakdown (YYYY-MM-DD format) |
end_date | string | No | End 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
| Field | Type | Description |
|---|
username | string | Username |
total_quota | number | Current account balance (USD) |
total_used_quota | number | Cumulative usage (USD) |
request_count | integer | Total request count |
keys | array | Per-key quota details |
keys[].name | string | API key name |
keys[].remain_quota | number | Key remaining quota; -1 means unlimited |
keys[].used_quota | number | Key used quota; -1 means unlimited |
daily_quota | object | Daily usage breakdown (only when start_date and end_date are set) |
daily_quota[date] | array | Per-key usage entries for that date |
daily_quota[date][].token_name | string | API key name |
daily_quota[date][].quota_used | number | Usage for that key on that date (USD) |
daily_quota[date][].request_count | integer | Request 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
}
]
}
}