Aggregate analytics across request logs — totals, time-series breakdowns, latency percentiles, and model/prompt breakdowns.
Get aggregated analytics for your request logs using the same filter syntax as Search Request Logs. The response is a set of pre-computed aggregations (not paginated rows), making it easy to power dashboards, alerts, or ad-hoc spend/latency questions.Documentation Index
Fetch the complete documentation index at: https://docs.promptlayer.com/llms.txt
Use this file to discover all available pages before exploring further.
X-API-KEY header.
RequestLogQuery — the canonical query payload also used by Search Request Logs (search additionally accepts page, per_page, and include_prompt_name).
| Field | Type | Description |
|---|---|---|
filter_group | object | Structured AND/OR filter group. Same fields and operators as Search Request Logs. |
q | string | Free-text query applied alongside filter_group. |
sort_by | string | Sort field. Does not affect aggregated output. |
sort_order | asc | desc | Sort direction. |
totalRequests, totalTokens, totalCost, averageLatency, plus cache and thinking-token counts.stats): per-bucket entries with requests, tokens, inputTokens, outputTokens, cost, latency, cachedTokens, thinkingTokens, traceShare, statusCounts, outputShapeCounts (json / toolCall / plainText), avgTurnCount, avgToolCallCount, and toolCallCountP95.latency): average_latency, p50_latency, p90_latency, p95_latency keyed by bucket date.mostUsedModels, modelRequestsByDay, latencyByModelByDay.mostUsedPromptTemplates, promptTemplateRequestsByDay, latencyByPromptTemplateByDay.chartInterval describing the bucket size used for the time series.latency.p90_latency map from the response (per-bucket p90 latency in seconds).
API key for authentication.
Canonical request-log query payload — the filter / search / sort fields shared by POST /api/public/v2/requests/search (which also accepts pagination + include_prompt_name) and POST /api/public/v2/requests/analytics.
Nested filter group with AND/OR logic. Use this for complex queries.
Free-text search query. Searches across the prompt input and LLM output text using fuzzy prefix matching.
Field to sort results by. Does not affect aggregated output for /requests/analytics.
request_start_time, input_tokens, output_tokens, cost, latency_ms, status Sort direction. Must be provided together with sort_by.
asc, desc Aggregated analytics for the matching request logs.
Aggregated analytics across the matching request logs. Bucket size is selected automatically based on the filter time range (seconds → minutes → hours → days).
true Bucket-interval metadata describing how the time-series was bucketed.
Overall average latency across all matching requests, in seconds.
totalCachedTokens / total_input_tokens, or null when there are no input tokens.
Per-bucket time-series.
List of [modelName, requestCount] pairs ordered by usage.
Map of model name → list of [date, requestCount] pairs.
Per-bucket latency percentiles in seconds. Keys are bucket dates (e.g. 2025-03-15); values are seconds.