Aggregate metrics for a period
Call volume, decisions, latency, credits, and an organization-wide billing snapshot for the calling app. Defaults to the org's current billing period when `start`/`end` are omitted. Requires an analytics API key — a regular scan key is rejected.
Call volume, decisions, latency, credits, and an organization-wide billing snapshot for the calling app. Defaults to the org's current billing period when start/end are omitted. Requires an analytics API key — a regular scan key is rejected.
Your API key as a bearer token.
In: header
Query Parameters
Inclusive range start (ISO 8601 date-time). Must be given together with end, or omitted along with it to use the current billing period.
Exclusive range end (ISO 8601 date-time). See start.
Include scans run from the dashboard (free preview scans). Defaults to false, so figures reflect production traffic only.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/analytics/summary"{
"appId": "string",
"generatedAt": "2019-08-24T14:15:22Z",
"period": {
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z"
},
"volume": {
"total": 0,
"completed": 0,
"failed": 0,
"inflight": 0,
"errorRate": 0
},
"decisions": {
"allow": 0,
"softBlock": 0,
"review": 0,
"needsReview": 0,
"sandbox": 0,
"hardBlock": 0,
"classified": 0,
"blockRate": 0,
"avgConfidence": 0
},
"latency": {
"avgMs": 0,
"p50Ms": 0,
"p95Ms": 0
},
"credits": {
"used": 0
},
"byCategory": [
{
"jobCategory": "prompt",
"total": 0,
"blocked": 0
}
],
"byKeyType": [
{
"keyType": "dev",
"total": 0,
"creditsUsed": 0
}
],
"org": {
"periodStart": "2019-08-24T14:15:22Z",
"periodEnd": "2019-08-24T14:15:22Z",
"creditsUsed": 0,
"creditsLimit": 0,
"overageCreditsUsed": 0,
"allowOverage": true,
"overageSpentCents": 0,
"spendCapCents": 0,
"currency": "GBP"
}
}{
"error": "Invalid API key",
"code": "INVALID_API_KEY",
"retryAfter": 0
}{
"error": "Invalid API key",
"code": "INVALID_API_KEY",
"retryAfter": 0
}{
"error": "Invalid API key",
"code": "INVALID_API_KEY",
"retryAfter": 0
}{
"error": "Invalid API key",
"code": "INVALID_API_KEY",
"retryAfter": 0
}Prometheus scrape endpoint GET
The org's current billing period as Prometheus text-exposition format — the native scrape target for Grafana's Prometheus data source and Datadog's OpenMetrics/Prometheus check. Always the current billing period; the only query parameter is `include_preview`.
Bucketed metrics for charting GET
Call volume, decisions, credits, and latency bucketed by hour or day, zero-filled so every interval has a point — for a Grafana JSON-API panel or a Datadog custom HTTP check. Bounded to 90 days and 1000 buckets per request.