Aira

Usage

Monitor your case usage, plan limits, and billing events.

Overview

The Usage API lets you track how many cases your organization has consumed in the current billing period, check your plan limits, and browse individual usage events.


Get Usage Summary

GET /api/v1/usage
Authorization: Bearer aira_live_xxxxx

Returns your current period usage, plan limit, and remaining quota.

Example Response

{
  "usage": 1247,
  "limit": 5000,
  "remaining": 3753,
  "plan": "pro",
  "request_id": "req_01J8X..."
}

Response Fields

FieldTypeDescription
usageintegerCases consumed in the current billing period
limitintegerMaximum cases allowed by your plan
remainingintegerCases remaining (limit - usage)
planstringYour current plan name (e.g. starter, pro, enterprise, selfhosted)

When limit is -1, the plan has unlimited cases (enterprise and self-hosted deployments). In this case, remaining is also -1.

Usage resets at the start of each billing period. When remaining reaches 0, case execution returns 429 QUOTA_EXCEEDED.


List Usage Events

GET /api/v1/usage/events?page=1&per_page=20
Authorization: Bearer aira_live_xxxxx

Returns a paginated list of individual usage events — one entry per billable action.

Example Response

{
  "data": [
    {
      "id": "ue_01J8X...",
      "event": "case.execute",
      "units": 1,
      "run_id": "prn_01J8X...",
      "metadata": { "models_count": 3 },
      "created_at": "2026-03-14T10:30:59Z"
    },
    {
      "id": "ue_02K9Y...",
      "event": "case.execute",
      "units": 1,
      "run_id": "prn_02K9Y...",
      "metadata": null,
      "created_at": "2026-03-14T09:15:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 20,
    "total": 1247,
    "has_more": true
  },
  "request_id": "req_..."
}

Event Fields

FieldTypeDescription
eventstringThe billable action type (e.g. case.execute)
unitsintegerNumber of units consumed (typically 1 per case)
run_idstring|nullAssociated case run ID
metadataobject|nullAdditional event metadata
created_atstringWhen the event occurred (ISO 8601 UTC)

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number (min: 1)
per_pageinteger20Results per page (1-100)

On this page