API reference / Account

Usage history

Your recent API calls: which route, when, how long it took and whether it succeeded.

GET/v1/usage
Authentication
Bearer token
Scope
Any valid key

Before you integrate

  • This reply is not wrapped in the usual request_id and result envelope; the fields are at the top level.
  • The list holds your recent calls, not necessarily your whole history.

Sample code

Set your key in the GRAPPI_API_KEY environment variable. Sample values are placeholders.

curl -sS -X GET 'https://grappi.ai/v1/usage' \
  -H "Authorization: Bearer $GRAPPI_API_KEY"

Sample response

{
  "tenant_id": "ten_0123456789abcdef0123456789abcdef",
  "total_calls": 2,
  "events": [
    {
      "id": "evt_0123456789abcdef0123456789abcdef",
      "tenant_id": "ten_0123456789abcdef0123456789abcdef",
      "api": "POST /v1/verify/passport",
      "units": 1,
      "latency_ms": 412,
      "success": true,
      "at": "2026-11-01T09:30:00.000Z"
    },
    {
      "id": "evt_fedcba9876543210fedcba9876543210",
      "tenant_id": "ten_0123456789abcdef0123456789abcdef",
      "api": "POST /v1/vehicle/dl",
      "units": 1,
      "latency_ms": 380,
      "success": true,
      "at": "2026-11-01T09:31:12.000Z"
    }
  ]
}

Response fields

FieldTypeDescription
tenant_idstringYour account id.
total_callsintegerNumber of usage records returned.
eventsarrayOne record per logged call.
events[].idstringUsage record id.
events[].tenant_idstringYour account id.
events[].apistringThe route that was called, for example POST /v1/verify/passport.
events[].unitsintegerUnits used; 1 per call, or the number of minutes for a voice call.
events[].latency_msintegerHow long the call took, in milliseconds.
events[].successbooleanWhether the call succeeded.
events[].atstringWhen the call was recorded, as an ISO 8601 UTC time.

Errors

Every failure has the same shape. A call that fails on our side or at the data source is refunded to your wallet; a "no record found" answer is charged. See the error reference.