Get AI gateway metrics
Returns time-series per model for one AI gateway connection that CostGraph scrapes, sourced from the metrics store: end-to-end request latency quantiles (signal end_to_end, kind quantile, in the unit the gateway reports), requests per second (end_to_end, request_rate), tokens per second by usage kind such as input and output (tokens_per_second, token_rate), spend per hour in USD (spend_per_hour, spend_rate) and tokens per request (tokens_per_request, ratio). Spend per hour prices each model’s token rate at the rate CostGraph charges for this connection’s usage on the latest usage day, so it agrees with the bill; models with no rate are listed in unpriced_models and get no spend series. last_traffic_at is the last point at which the gateway reported any tokens or requests in the window, so a gateway that went quiet or stopped being scraped can be told apart from one that is serving. Signals the gateway does not publish are named in missing_signals rather than returned as zero.