Skip to main content
GET
Usage summary statistics
All /api/api-usage/* endpoints aggregate non-sandbox usage only. Requests made with nex_test_ keys still log rows with is_sandbox = true, but those rows are not included in summary, timeseries, by-agent, by-tool, by-key, or outcome totals. See Sandbox (test API keys) for how test keys isolate data elsewhere.

Operator UI

  • Facility dashboard: /admin/api-usage — requires analytics.view; pass facilityId for keys scoped to that facility.
  • Internal platform dashboard: /admin/platform-usage — cross-facility totals (facilityId omitted) for internal operators only; same JSON endpoints and CSV export (GET /api/api-usage/export).

Authorizations

Authorization
string
header
required

JWT token authentication

Query Parameters

facilityId
integer

When set, restrict aggregates to API keys with this api_keys.facility_id. Required for facility-scoped sessions that are not internal cross-facility operators. Omit for platform-wide totals (internal operators only).

days
integer
default:30

Lookback period in days

Response

Usage summary

totalCalls
integer
uniqueKeys
integer
avgLatencyMs
integer
p95LatencyMs
integer
errorCount
integer
outcomeCount
integer
periodDays
integer