Analytics
Where Logs show you one request at a time, Analytics rolls every request up into the numbers a team actually plans around: how much you’re spending, how fast you’re responding, how many tokens you’re burning, and where it all goes: by provider, model, key, or user, over any time range.
- Control spend. See total cost and its trend at a glance, then break it down to find the model or team driving it.
- Catch regressions. Latency percentiles and error rate over time tell you when something got slower or started failing.
- Prove ROI. Cache-hit rate and token volume show the savings the gateway is delivering.
Analytics is built from three endpoints. All three accept the same scope filters: start_time, end_time, organization, workspace_id, provider, and model, so you can zoom the whole dashboard to a workspace, a provider, or a window in time.
A single snapshot for the selected scope (GET /v1/analytics/summary):
| Field | Meaning |
|---|---|
| total_requests | How many requests were served. |
| total_cost_usd | Total spend in USD. Cache hits cost $0, so this is what was actually spent. |
| total_cost_saved_usd | What cache hits saved: what they would have cost (the Saved by cache card). |
| total_tokens / prompt_tokens / completion_tokens | Token volume, split by input vs output. |
| avg_duration_ms | Average duration (see duration_ms on the Logs page). |
| p50_duration_ms / p95_duration_ms / p99_duration_ms | Duration percentiles: the tail, not just the average. |
| error_rate | Share of requests that failed. |
| cache_hit_rate | Share of requests served from cache. |
One metric plotted over time (GET /v1/analytics/timeseries). Pick the metric (required) and a granularity (bucket size; defaults to day). The response is a list of { timestamp, value } points.
| metric | Plots… |
|---|---|
| requests | request volume over time. |
| cost | spend over time. |
| cost_saved | what the cache saved over time (the chart’s Saved tab). |
| tokens | token consumption over time. |
| latency | duration over time (the chart labels it Duration). |
| error_rate | failure rate over time. |
| cache_hit_rate | cache effectiveness over time. |
Group the totals by a dimension to find the biggest contributors (GET /v1/analytics/breakdown). Pick a dimension (required) and an optional limit (defaults to 20). Each row reports request_count, error_count, total_cost_usd, total_tokens, and avg_duration_ms for that group.
| dimension | Groups by… |
|---|---|
| provider | each provider (OpenAI, Anthropic, …). |
| model | each model. |
| organization | each organization. |
| user_id | each user. |
| virtual_key_slug | each virtual key. |
| cache_status | hit vs miss vs bypass, etc. |
Latency percentiles over time (GET /v1/analytics/latency), split into the provider’s time and what the gateway added. The Analytics page’s Latency tab draws it for the page’s filters (the last 24 hours when no time range is set), with tabs for Total, Provider, Gateway overhead and Time to first token and an optional range picker of its own (last hour to last 90 days). The answer has a summary for the whole window and one entry per time bucket in data_points, empty buckets included (requests: 0, figures null). Every figure is in milliseconds.
| Field | Measures… |
|---|---|
| avg, p50, p90, p95, p99, max | total latency: from when the request reached the gateway until the whole answer was in. Requests logged before the provider / gateway split existed use their recorded duration. |
| provider | time spent waiting on the provider, every retry and fallback attempt included. Only requests that called a provider; cache hits are left out. |
| gateway_overhead | total minus provider time: what VectorAxis added (key checks, guardrails, cache lookups, routing, pricing). |
| first_token | streams only: from arrival until the first chunk reached the caller. |
| provider_first_token | streams only: the provider’s time until its first chunk. |
Each of the nested fields has the same requests, avg, percentiles and max. Percentiles are within about 3% of the exact value (exact below 18 ms); averages and maximums are exact. regions lists the regions whose logs were read; a region in unavailable_regions did not answer and is left out of the figures.
| Parameter | Meaning |
|---|---|
| organization | Defaults to your va_ key’s organization. |
| workspace_id | One or more workspaces; you need access to each. Left out: every workspace (org owners and admins). A workspace-scoped va_ key reads its own workspace. |
| exclude_workspace_ids | Every workspace except these (without workspace_id only). |
| start_time, end_time | ISO 8601 with an offset. Default: the last 24 hours. At most 366 days. |
| granularity | auto (default: by minute up to 3 hours, by hour up to 7 days, by day up to 90 days, then by week), minute, hour, day or week. At most 1,500 buckets. |
| tz | IANA time zone the buckets line up with, e.g. Asia/Kolkata. Default UTC. |
| provider, model, provider_model | Lists. provider_model pairs them: openai__gpt-5,anthropic__claude-opus-5-5. |
| virtual_key_slug, config_slug, prompt_slug, guardrail_slug, guardrail_status, user_id, request_id, cache_status, operation_type, region, status_code | Lists: comma-separated, or the parameter repeated. A request matches when it has any of the values. |
| status, streaming, tool_scan_status, search | success or error; true or false; as on /v1/logs. |
| min_tokens/max_tokens, min_prompt_tokens/max_prompt_tokens, min_completion_tokens/max_completion_tokens, min_cost/max_cost (USD), min_duration_ms/max_duration_ms | Ranges, both ends included. |
Workspace members and above can view analytics for their workspace; org admins see the whole org. Scope to a workspace with workspace_id. Full breakdown on the Access control page.
Developer API reference
| Method | Path | Who can call it |
|---|---|---|
| GET | /v1/analytics/summary | Member (scope to a workspace) |
| GET | /v1/analytics/timeseries | Member |
| GET | /v1/analytics/breakdown | Member |
| GET | /v1/analytics/latency | Member (each workspace asked for); org admin for every workspace |
# Headline numbers for a workspace, this month
GET /v1/analytics/summary?organization=acme&workspace_id=<uuid>
&start_time=2026-06-01T00:00:00Z
# Daily spend trend
GET /v1/analytics/timeseries?metric=cost&granularity=day&organization=acme
# Top 10 models by cost
GET /v1/analytics/breakdown?dimension=model&limit=10&organization=acme
# Hourly latency of two models' streams, last 24 hours, in India time
GET /v1/analytics/latency?workspace_id=<uuid>&model=gpt-5,claude-opus-5-5
&streaming=true&granularity=hour&tz=Asia/Kolkata
Authorization: Bearer va_...