Get usage

Daily requests, audio seconds and spend for the key's project, by model and key.

GET/v1/usage

Returns daily usage records for the project the API key belongs to, grouped by day, model and API key, so you can attribute spend to individual keys. Read-only keys can call it.

from wistfareai import WistfareAI

client = WistfareAI()  # reads WISTFARE_API_KEY

usage = client.usage.get(start="2026-10-01", end="2026-10-31")  # default: the last 30 days
print(f"Spend: ${usage.totals.cost_cents / 100:.2f}")
for r in usage.records:
    print(r.date, r.model, r.requests, r.audio_seconds, r.cost_cents)

Query parameters

ParameterTypeDefaultDescription
startstring30 days agoFirst day (inclusive), YYYY-MM-DD.
endstringtodayLast day (inclusive), YYYY-MM-DD.

Response

200 OK:

{
  "records": [
    {
      "date": "2026-10-10",
      "model": "wistfare-stt-v3-beta",
      "key_id": "key_51c7d0",
      "requests": 412,
      "audio_seconds": 18630.4,
      "cost_cents": 189
    }
  ],
  "totals": {
    "requests": 412,
    "audio_seconds": 18630.4,
    "cost_cents": 189
  }
}
FieldTypeDescription
records[].datestringDay, YYYY-MM-DD (UTC).
records[].modelstringModel used, e.g. wistfare-stt-v3-beta or wistfare-tts-v1-beta.
records[].key_idstring | nullPublic id (key_…) of the API key, or null for console usage.
records[].requestsintegerBillable requests (transcriptions, live sessions, job files, generations).
records[].audio_secondsnumberAudio billed, in seconds.
records[].cost_centsintegerTotal charged, in US cents.
totalsobjectrequests, audio_seconds and cost_cents summed over the range.

Errors

StatusCodeMeaning
401unauthorizedMissing, invalid or revoked API key.
422validation_errorA date isn't in YYYY-MM-DD form.

On this page