Usage Metrics

These endpoints return usage metrics for requests made through AI Runtime Control, including request counts, session counts, and token consumption. Metrics can be filtered by virtual key, provider, and model.

Data model

A usage metric measured for a single date (or hour, when `granularity` is `hourly`).

datestringThe date (or hour) the usage was measured. Formatted as YYYY-MM-DD when granularity is daily, or YYYY-MM-DD HH:00:00 when granularity is hourly. Required.
modelstringThe AI model identifier used.
primary_providerstringThe ID of the provider connection originally requested, before any failover occurred.
providerstringThe name of the provider connection that ultimately served the request.
provider_connection_idstringThe ID of the provider connection that ultimately served the request.
quantityintegerThe quantity of the usage type for this date. Required.
usage_typestringThe type of usage being measured. Required.
virtual_key_idstringThe ID of the virtual key this usage is attributed to.
virtual_key_namestringThe display name of the virtual key this usage is attributed to.
sortstringThe sort value used when making the request.
totalintegerThe count of results matching the request.
metaobjectMetadata about the request.

Endpoints

Get usage metrics

GET/ai-runtime-control/v1/usage-metrics

Export usage metrics

GET/ai-runtime-control/v1/usage-metrics/export