CometAPI provides two ways to check account balance and usage: the CometAPI CLI and the query service API atDocumentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
query.cometapi.com.
CometAPI CLI
The fastest way to check your balance from the terminal. See CometAPI CLI overview for installation.--source token for per-key details:
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.
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) |
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:Response example
Daily breakdown example
Query daily usage for a date range:daily_quota: