Get analytics graph
portkey_get_analytics_graphGet a time-series analytics graph for a single metric (cost, requests, tokens, latency, error-rate, cache-hit-rate, …) over a time window. Optionally scope by virtual keys, configs, or metadata. Portkey: GET /analytics/graphs/{metric}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| metric | Yes | Which metric graph to return. | |
| configs | No | Comma-separated config slugs to scope the graph. | |
| metadata | No | JSON string of metadata key/values to scope the graph. | |
| total_units | No | Bucket size for the series, e.g. "day" or "hour". | |
| virtual_keys | No | Comma-separated virtual key slugs to scope the graph. | |
| time_of_generation_max | Yes | End of the window (ISO8601, format YYYY-MM-DDTHH:MM:SS±HH:MM). | |
| time_of_generation_min | Yes | Start of the window (ISO8601, format YYYY-MM-DDTHH:MM:SS±HH:MM). |