Get usage totals
/v1/analytics/summaryGet usage totals.
Returns totals over every request matching the filters: requests, tokens, cost, the cost cache hits saved, error rate, cache hit rate, and average and percentile latency. Without start_time and end_time it covers every log still retained.
With workspace_id, requires access to that workspace: an organization owner or admin, a member of the workspace, an organization-scoped va_ key with the admin role, or a va_ key scoped to the workspace. Without it, requires an organization owner or admin, or an organization-scoped va_ key with the admin role. Fails with 400 for a date-time that is not ISO 8601 with an offset.
Authorization
AuthorizationBearer va_A platform API key (
va_...), created under Settings > API keys. Scoped to an organization or one workspace, with an admin or member role. Used by the management API.
Query parameters
start_timestringonly requests at or after this time (ISO 8601 date-time with offset)
end_timestringonly requests before this time (ISO 8601 date-time with offset)
organizationstringthe organization's slug
workspace_idstring<uuid>only this workspace's requests (UUID)
providerstringonly requests to this provider, as stored: upper case with underscores, e.g.
OPENAImodelstringonly requests for this model id
Responses
total_requestsinteger<int64>How many requests matched.
total_cost_usdnumber<double>What they cost, in USD (cache hits cost 0).
total_cost_saved_usdnumber<double>What cache hits saved, in USD: the sum of
cost_saved_usd.total_tokensinteger<int64>Input plus output tokens.
prompt_tokensinteger<int64>Input tokens.
completion_tokensinteger<int64>Output tokens.
avg_duration_msnumber<double>The average request duration, in milliseconds; 0 when nothing matched.
p50_duration_msnumber<double>The median request duration, in milliseconds; null when nothing matched.
p95_duration_msnumber<double>The 95th percentile request duration, in milliseconds; null when nothing matched.
p99_duration_msnumber<double>The 99th percentile request duration, in milliseconds; null when nothing matched.
error_ratenumber<double>The share of requests that ended with a status of 400 or above, 0 to 1; 0 when nothing matched.
cache_hit_ratenumber<double>The share of requests answered from the cache (
HITorSEMANTIC_HIT), 0 to 1; 0 when nothing matched.