ChangelogNew

Read your credit usage and queue from the API

API
Credit usage split by ChatGPT, Gemini and Perplexity, beside a queue card with 25 of 200 concurrent tasks in use

Your API key now reads what each engine and key spent, and how much room your plan has for new tasks.

What you get

  • GET /v1/usage: the credits and tasks charged over a range of UTC dates, split by day, engine and API key.
  • GET /v1/async/status: your queued and processing tasks, the queued tasks by priority and your concurrency limit.
  • Both read with the same vt_ key you send tasks with.

How it works

Usage adds up what tasks were charged. Credits are charged when a task completes, and a failed task costs 0. credits and tasks at the top are the sum of every row, and a split with no charge has no row.

Split by key to see who spent the credits. Tasks of your sub-accounts appear in your usage, and apiKey.subAccountId names the sub-account that owns a key.

The queue counts QUEUED and PROCESSING tasks together, the same count your plan’s concurrency limit uses. A submit past the limit returns 429 PLAN_CONCURRENCY_LIMIT, so reading concurrency first keeps a batch inside it.

Where it helps

  • Bill your own customers by usage: give each customer a key or a sub-account and read groupBy=key at the end of the month.
  • Pace a large batch: send only as many tasks as max - used allows.
  • Chart daily spend per engine in your own dashboard or alerting.

Get started

Read this month’s usage split by engine:

curl "https://api.querying.ai/v1/usage?groupBy=engine" \
  -H "Authorization: Bearer $QUERYING_API_KEY"
JSON
{
  "success": true,
  "data": {
    "from": "2026-10-01",
    "to": "2026-10-20",
    "groupBy": ["engine"],
    "credits": 66.25,
    "tasks": 65,
    "rows": [
      { "taskType": "CHATGPT", "credits": 49, "tasks": 49 },
      { "taskType": "GEMINI", "credits": 6.25, "tasks": 5 },
      { "taskType": "PERPLEXITY", "credits": 11, "tasks": 11 }
    ]
  }
}
from, tostring
UTC dates as YYYY-MM-DD, both included. They default to the first day of the current UTC month and today. A range spans up to 366 days.
groupBystring
Any of day, engine and key, separated by commas. The default is day,engine. Each row carries the fields of the splits you chose.
rows[].apiKeyobject
With groupBy=key, the key that spent the credits: id, keyPrefix, name and subAccountId. Spend from monitors, the Playground and the dashboard has source set to monitor, playground or dashboard.

Read your queue:

curl "https://api.querying.ai/v1/async/status" \
  -H "Authorization: Bearer $QUERYING_API_KEY"
JSON
{
  "success": true,
  "queuedTasks": 19,
  "processingTasks": 6,
  "priorityBreakdown": [
    { "priority": 8, "count": 3 },
    { "priority": 1, "count": 16 }
  ],
  "concurrency": { "used": 25, "max": 200 }
}
queuedTasks, processingTasksnumber
Your tasks waiting in the queue and running now, including those of your sub-accounts.
priorityBreakdownarray
Queued tasks by the priority they were submitted with, highest first.
concurrencyobject
used is queued plus processing tasks, as your plan counts them. max is your concurrency limit, so max - used is the room left for new tasks.

Errors

VALIDATION_ERRORHTTP 400
A field is missing or out of range. details names the field.
MISSING_API_KEYHTTP 401
The Authorization header is missing, or its key is unknown, expired or revoked.
SUB_ACCOUNT_FORBIDDENHTTP 403
The key belongs to a sub-account. The parent account’s key reads usage and the queue for both.

Pricing

Reading usage and queue status costs 0 credits.

More updates

Stay in the loop

Get new product updates in your inbox.

RSS feed