Skip to content

Usage ​

Get usage ​

http
GET /v1/usage?from=2026-11-01&to=2026-11-21

Scope: runs:read. Usage of the key's project over a range of UTC days.

QueryDescription
fromfirst day, YYYY-MM-DD (default: first day of the current UTC month)
tolast day, inclusive, YYYY-MM-DD (default: today, UTC)
bash
curl "$HEVKAR_BASE_URL/v1/usage?from=2026-11-01&to=2026-11-21" \
  -H "Authorization: Bearer $HEVKAR_API_KEY"
ts
const usage = await hevkar.usage.get({ from: '2026-11-01', to: '2026-11-21' });
console.log(`${usage.priceMicros / 1_000_000} USD`);

Response 200:

json
{
  "from": "2026-11-01",
  "to": "2026-11-21",
  "priceMicros": 18350211,
  "inputTokens": 9120344,
  "outputTokens": 802113,
  "runs": 12840,
  "errors": 37,
  "daily": [
    { "day": "2026-11-01", "priceMicros": 801233, "inputTokens": 402110, "outputTokens": 35021 }
  ]
}
FieldDescription
priceMicrostotal price in USD micros (all metrics: tokens, audio, embeddings, OCR)
inputTokensinput tokens, cached ones included
outputTokensoutput tokens
runstop-level runs created in the range (child runs of agent tools and workflow nodes belong to their root run)
errorsfailed runs among them
dailyper day with usage: {day, priceMicros, inputTokens, outputTokens}

For breakdowns by agent, model, API key or end user, use the console's usage dashboard and CSV export.

The range works as in the console's usage dashboard: to alone starts at its month's first day, from alone ends today.

Errors: 400 VALIDATION_FAILED when a date is not a valid YYYY-MM-DD, from is after to, or the range spans more than 366 days (fields says which).

Hevkar public API v1