Skip to main content
GET
Usage by API key

Authorizations

Authorization
string
header
required

JWT token authentication

Headers

NexSpace-Version
string

Pin the request to a dated API version (e.g. 2026-05-10). Applied by app-level middleware to every /api route (server/routes/index.ts → apiVersionMiddleware), which echoes the resolved value back in the NexSpace-Version response header. Omit to get the latest version. Discover the catalog at GET /.well-known/api-versions.

Pattern: ^\d{4}-\d{2}-\d{2}$

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

Response

Per-key breakdown. Each data row is { apiKeyId, keyName, keyPrefix, totalCalls, errorCount, avgLatencyMs }, ordered by call volume.

Shape shared by the by-agent, by-tool, by-key and outcomes analytics endpoints: grouped rows plus the scope they were computed for.

data
object[]

Grouped rows. The grouping key and measures differ per endpoint — see each operation's description for the columns it returns.

scope
object

Which slice of usage the aggregate covers. Facility-scoped sessions get { facilityId }; internal cross-facility operators querying without a facilityId get { global: true }.