Analytics API
Pre-aggregated summaries of every query that flowed through the Gateway,
served by the Airbrx API at api.airbrx.ai. Use these
endpoints to build custom dashboards, monitor cache effectiveness, or
track per-user query patterns.
Authentication
All requests require a Personal Access Token in the Authorization
header. The token must include the relevant analytics scope; see the
API reference for the full scope
list.
curl -H "Authorization: Bearer YOUR_PAT" \
https://api.airbrx.ai/tenants/your-slug/summaries/2026
Endpoints
| Method | Path | Returns |
|---|---|---|
| GET | /tenants/{tenant}/summaries/{year} |
Yearly summary with daily activity timeline |
| GET | /tenants/{tenant}/summaries/{year}/{month}/{day} |
Daily summary with per-query details |
| GET | /tenants/{tenant}/users/summary.json |
All users summary for the tenant |
| GET | /tenants/{tenant}/users/{userId}/{year} |
User yearly summary |
| GET | /tenants/{tenant}/users/{userId}/{year}/{month}/{day} |
User daily summary (same shape as daily summary, scoped to one user) |
Yearly summary
GET /tenants/{tenant}/summaries/{year}
{
"tenantSummaryReportID": "a1b2c3d4-...",
"tenantId": "acme-corp",
"reportyears": ["2026"],
"totalUsers": 45,
"totalQueries": 12847,
"totalCacheHits": 9234,
"totalHits": 52341,
"cacheSize": 1073741824,
"cacheElements": 12847,
"last365daysQueryActivity": [
{
"date": "2026/01/15",
"queries": 234,
"users": 12,
"cacheHits": 189,
"totalHits": 1205,
"dataTransfer": 52428800,
"cacheSize": 2097152,
"cacheElements": 234
}
]
}
Top-level fields
| Field | Type | Description |
|---|---|---|
tenantSummaryReportID | string | Unique report identifier. |
tenantId | string | Tenant identifier. |
totalUsers | integer | Cumulative unique users for the year. |
totalQueries | integer | Unique SQL statements cached. |
totalCacheHits | integer | Cache hits across all queries. |
totalHits | integer | Total query executions (hits + misses). |
cacheSize | integer (bytes) | Total cached data size. |
cacheElements | integer | Number of cached query results. |
last365daysQueryActivity | array | Daily activity timeline (see below). |
Daily activity entry
| Field | Type | Description |
|---|---|---|
date | string | YYYY/MM/DD format. |
queries | integer | Unique statements on this day. |
users | integer | Unique users on this day. |
cacheHits | integer | Cache hits on this day. |
totalHits | integer | Total executions on this day. |
dataTransfer | integer (bytes) | Bytes served from cache. |
cacheSize | integer (bytes) | New cache data added. |
cacheElements | integer | New cache entries added. |
Daily summary
GET /tenants/{tenant}/summaries/{year}/{month}/{day}
{
"queries": [
{
"queryHash": "a1b2c3d4...",
"statement": "SELECT * FROM customers WHERE region = ?",
"cacheKey": "abc123...",
"cacheHits": 47,
"responseCode": 200,
"averageResponseTime": 234,
"minResponseTime": 45,
"maxResponseTime": 1250,
"responseSize": 15360,
"count": 52,
"users": 8,
"firstRequestTime": "2026-01-15T08:23:45Z",
"lastRequestTime": "2026-01-15T17:45:12Z"
}
],
"uniqueUsers": 23,
"cacheHits": 892,
"totalHits": 1205,
"averageResponseTime": 187,
"minResponseTime": 12,
"maxResponseTime": 3450
}
Query record fields
| Field | Type | Description |
|---|---|---|
queryHash | string | SHA-256 of the standardized SQL. |
statement | string | The standardized SQL. |
cacheKey | string | Cache storage key. |
cacheHits | integer | Times served from cache. |
responseCode | integer | HTTP status (200, 404, 500, …). |
averageResponseTime | integer (ms) | Mean response time. |
minResponseTime | integer (ms) | Fastest response. |
maxResponseTime | integer (ms) | Slowest response. |
responseSize | integer (bytes) | Average response size. |
count | integer | Total execution count. |
users | integer | Unique users who ran this query. |
firstRequestTime | ISO 8601 | First execution. |
lastRequestTime | ISO 8601 | Most recent execution. |
All users summary
GET /tenants/{tenant}/users/summary.json
{
"tenantId": "acme-corp",
"generatedAt": "2026-01-15T18:30:00Z",
"totalUsers": 45,
"users": [
{
"userId": "alice@acme.com",
"uniqueQueries": 234,
"cacheHits": 189,
"totalHits": 567,
"averageResponseTime": 145,
"minResponseTime": 12,
"maxResponseTime": 2340
}
]
}
User yearly summary
GET /tenants/{tenant}/users/{userId}/{year}
Returns the same shape as the tenant yearly summary, scoped to a single
user. The corresponding daily endpoint
(/tenants/{tenant}/users/{userId}/{year}/{month}/{day})
returns the same shape as the daily summary, also scoped to that user.
See also
- Platform Savings Pillar — what these metrics enable you to measure.
- Response headers — per-request, real-time cache info (vs. these aggregated summaries).
- API reference — the live OpenAPI spec for these and all other endpoints.