Skip to main content
GET
/
api
/
api-usage
/
summary
Usage summary statistics
curl --request GET \
  --url https://your-production-domain.com/api/api-usage/summary \
  --cookie connect.sid=
{
  "totalCalls": 123,
  "uniqueKeys": 123,
  "avgLatencyMs": 123,
  "p95LatencyMs": 123,
  "errorCount": 123,
  "outcomeCount": 123,
  "periodDays": 123
}
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

connect.sid
string
cookie
required

Session-based authentication cookie

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

200 - application/json

Usage summary

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