AI Gateway Statistics and Monitoring
The AI Gateway logs all requests that pass through it and presents usage, cost, and operational status across three pages: Overview, Statistics, and Monitoring. This article describes the content and usage of these three pages.
Overview
The Overview page provides a snapshot of the overall state of the AI Gateway:
- KPI Cards — Number of active channels, number of virtual keys, today's request count, today's cost (and Token usage).
- Channel Health Overview — Real-time health status of each channel (normal / degraded / unavailable).
- Recent Events — A stream of the most recent routing events (event type, model, channel, latency, time).
The Overview page is ideal for a quick daily check on whether the gateway is healthy and what today's spending and request volume look like.
Statistics
The Statistics page is used for in-depth analysis of usage and costs.
KPI Summary
The top of the page displays core metrics: Total Requests, Total Token Usage, Cost (USD), Average Latency (milliseconds).
Summary and Grouping
- Overall Summary — Total / successful / failed request counts, input / output / total Token counts, average Tokens per request, total cost, and distribution by event type (routed, failover, failed, no_channel).
- Group by Dimension — Switch between grouping perspectives:
- By Model — Request count, Tokens, cost, and latency for each model.
- By Key — Consumption for each virtual key.
- By Date — Daily usage trends.
- By Request Type — Grouped by request type.
Multimodal Usage
In addition to text conversations, the Statistics page also displays multimodal usage separately: Image generation count, voice input units, voice output units, making it easy to account for image and voice call costs.
Trend Chart
A line chart displays the daily aggregated request volume trend, helping you observe changes in usage.
Budget Management (VIP)
- A gauge chart displays the used amount and percentage for each budget, with a prompt when approaching the threshold.
- Budget management is a paid feature; when not subscribed, this area is locked and prompts you to upgrade.
Subscription Quota Tracking
If you have linked subscription-based provider accounts (see Subscription Accounts and Quota Tracking), the Statistics page also displays the real-time status of subscription quotas:
- Used / Remaining Percentage — A progress bar shows the quota consumption progress for each subscription window.
- Quota Exhausted Status — When a window's quota is exhausted, the corresponding channel is marked as "Exhausted," and the gateway automatically degrades to a backup channel (if failover is configured).
- Reset Time — Displays the reset time of the quota window to help you estimate recovery time.
- Credential Expiration Prompt — When the authorization credentials of a subscription account expire, it is clearly marked on the interface, reminding you to re-authorize.
Subscription quota information is also displayed in summary form in the expanded area of the Channel List.
Monitoring
The Monitoring page provides a more real-time operational view:
- Real-time Event Log — Displays routing events one by one (request ID, model, channel, latency, etc.).
- Count by Event Type — Categorized counts for normal routing, failures, failovers, no available channels, etc., making it easy to quickly identify anomalies.
Prerequisites
- You are logged into a ServBay account and have configured channels and virtual keys.
- Actual requests have passed through the gateway (otherwise statistics will be empty).
Usage Tips
- Control Costs — Use the "By Model / By Key" grouping to identify high-cost sources, and if necessary, set rate limits for the corresponding virtual keys or set quotas for channels.
- Troubleshoot Anomalies — If the success rate drops, check the proportion of failed / no_channel in the event type distribution, and use the channel health status to locate the failing channel.
- Optimize Latency — Monitor the average latency KPI and per-model latency to evaluate the response speed of different providers / regional endpoints.
Frequently Asked Questions (FAQ)
- Q: No data on the Statistics page?
- A: Statistics are based on real requests passing through the gateway. Please confirm that an application or a managed tool has already made requests through the gateway.
- Q: The Budget Management area is locked?
- A: Budget management is a paid feature. Subscribe to the corresponding plan to use it.
- Q: How is cost calculated?
- A: The gateway estimates cost based on each channel's pricing (including any pricing multiplier you set) and actual Token / call volume. Pricing parameters can be adjusted in Channel Advanced Configuration.
Summary
The Overview, Statistics, and Monitoring pages make every call through the AI Gateway observable: from a quick glance at today's spending, to in-depth breakdowns by model / key / date, to real-time event streams and budget controls. By making good use of these views, you can continuously optimize the cost and stability of your AI development.
