Aira

Usage

Monitor your operations, plan limits, and billing events.

Overview

The Usage API lets you track how many operations your organization has consumed in the current billing period, check your plan limit, and browse individual usage events. An operation is any billable event: case runs, notarized actions, chat messages, compliance bundles, settlements, or drift checks. See Billing for the full list.


Get Usage Summary

GET /api/v1/usage
Authorization: Bearer aira_live_xxxxx

Returns your current period usage, plan limit, and the per-event-type breakdown.

Example Response

{
  "usage": 1247,
  "limit": 10000,
  "remaining": 8753,
  "plan": "pro",
  "overage_ops": 0,
  "overage_cost": "0",
  "overage_enabled": true,
  "breakdown": {
    "case_runs": 42,
    "action_authorizations": 1150,
    "chat_messages": 40,
    "compliance_bundles": 5,
    "settlements": 2,
    "drift_checks": 8
  },
  "request_id": "req_01J8X..."
}

Response Fields

FieldTypeDescription
usageintegerTotal operations consumed in the current billing period
limitintegerMaximum operations allowed by your plan
remainingintegerOperations remaining (limit - usage)
planstringYour current plan name (free, pro, business, enterprise, selfhosted)
overage_opsintegerOperations counted above limit (0 if within plan)
overage_coststringEstimated overage cost in euros (decimal string)
overage_enabledbooleanWhether overage is billable on this plan
breakdownobjectCounts per billable event type

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

Usage resets at the start of each billing period. When remaining reaches 0 on a plan with overage_enabled: false (Free), the next billable request returns 429 PLAN_LIMIT_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_uuid": "prn_01J8X...",
      "metadata": { "models_count": 3 },
      "created_at": "2026-03-14T10:30:59Z"
    },
    {
      "id": "ue_02K9Y...",
      "event": "case.execute",
      "units": 1,
      "run_uuid": "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_uuidstring|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