Skip to content

API reference

Usage events

GET /v1/usage: one metered event per request, with cursor pagination and time filters.

On this page

Returns one event per metered request on your key's allocation, newest first. These are the same events the supplier sees on their side of the agreement.

GET/v1/usage

Requires the usage:read scope.

Query parameters

ParameterTypeNotes
fromISO 8601Only events at or after this time
toISO 8601Only events before this time
limitintegerPage size. Defaults to 50, capped at 100
cursorstringnext_cursor from the previous page

A from or to that isn't a valid date is ignored.

Example

curl "https://cairva.xyz/v1/usage?from=2026-11-01T00:00:00Z&to=2026-11-02T00:00:00Z&limit=100" \
  -H "Authorization: Bearer $CAIRVA_API_KEY"

Response

JSON
{
  "object": "list",
  "data": [
    {
      "id": "0f6b8a52-3c1e-4e0b-9a77-1d2c3b4a5e6f",
      "occurred_at": "2026-11-01T09:14:02.511Z",
      "request_id": "7d0c2f4e-6a51-4c43-9f0e-2b8f5a1c9e30",
      "upstream_request_id": "chatcmpl-582",
      "client_request_id": "ticket-4812",
      "input_tokens": 31,
      "output_tokens": 18,
      "source": "provider_reported",
      "finality": "observed"
    }
  ],
  "next_cursor": null
}

next_cursor is null on the last page.

Fields

FieldMeaning
idThe usage event id
occurred_atWhen the usage was booked
request_idMatches cairva.request_id on the completion
upstream_request_idThe provider's id for the request, when it sent one
client_request_idThe x-request-id header you sent, if any
input_tokens, output_tokensBooked token counts
sourceWhere the counts came from
finalityHow settled the counts are

source

ValueMeaning
provider_reportedThe model provider returned the counts with the response
reconciliationCairva operations booked the counts later from provider metering, with evidence
sandbox_estimateA stand-in sandbox route that calls no model estimated the counts

finality

Events start as observed. Events booked by reconciliation are confirmed. The field also defines corrected and disputed. Nothing sets either today, but handle them so your code doesn't break if it starts to.

What isn't here

A request appears only once its usage is booked. Failed requests never appear and never consume allowance. Requests waiting on usage (usage_source: "pending" on the response) appear after operations reconcile them.