> Raw Markdown twin (generated at build time from the source Markdown). Rendered page: https://docs.gatellm.io/en/console/statistics · Doc index: https://docs.gatellm.io/en/llms.txt


# Statistics page

The Statistics page aggregates request usage, breaks it down by model/key/group dimensions, and supports time-series display. Data is persisted to the database at 1-minute granularity.

Entry: Console → **Statistics** (visible to admin and monitor).

## Summary cards

Seven cards at the top, reflecting totals for the selected period:

| Card | Meaning |
|------|------|
| Total requests | All requests in the period |
| Successful requests | 2xx |
| Error requests | 4xx + 5xx |
| Average latency | milliseconds |
| Input Token | Input tokens counted by the upstream |
| Output Token | Output tokens counted by the upstream |
| Cache read Token | Tokens hit in the prompt cache |

## Dimension switching

`group_by` switches the breakdown dimension:

| Dimension | Main table first column |
|------|---------|
| `model` | By model |
| `access_key` | By access key (expandable) |
| `access_key_group` | By key group |

Remaining columns of the main table: request count, success count, error count, success rate, average latency, input tokens, output tokens, cache read tokens.

## Time range

- Presets: `24h` (default) / `7d` / `30d`
- Custom: pick start and end times with the DateRangePicker, supporting relative expressions

## Time-series chart

Granularity is chosen automatically based on the selected period (targeting about 120–720 data points):

| Time span | Granularity |
|---------|------|
| ≤ 24h | 5 minutes |
| ≤ 2d | 15 minutes |
| ≤ 7d | 1 hour |
| ≤ 30d | 4 hours |
| ≤ 90d | 12 hours |
| > 90d | 1 day |

Shows curves of token usage (input+output by model) and request count (total/success/error).

## Export Excel

The export entry is on the billing page (Console → **Settings** → **Billing** → **Monthly costs**): pick a month and click export to get an Excel with 6 sheets (model / access key / key group / access key × model distribution / day / week time dimensions), with costs split into columns by currency. See [Export billing Excel and log troubleshooting](/en/howto/billing-export-and-logs.md) for details.

## Notes

- `count_tokens` requests (the Anthropic token-counting endpoint) are **not counted in statistics**, because they do not actually call the upstream and produce no cost.
- Persisted statistics are stored in 1-minute buckets; the current minute bucket is lost if the gateway crashes, while completed minute buckets are retained.
- **Statistics and billing record the final mapped model name**. If an access key / key group has an identity-scoped model mapping configured (e.g. `claude-opus-5 → qwen3.7-max`), the Statistics page, Excel export, and bills will only show rows with the target name `qwen3.7-max` and will **not** show rows with the source name `claude-opus-5` — mapping is fully transparent to statistics and billing. If you need to attribute by the client-side source name, record it on the client side yourself. See [Configure identity-scoped model mapping](/en/howto/configure-identity-model-mapping.md) for details.

## FAQ

**Q: Request counts in statistics don't match the logs?**
Statistics are aggregated at 1-minute granularity, while logs are per-request records. Within a short time window there may be up to 1 minute of flush delay. `count_tokens` requests appear in logs but are not counted in statistics.

**Q: Token counts are high?**
Confirm whether `count_tokens` was also counted — it is not counted in statistics. If still high, check whether an upstream returned an inflated usage field.

**Q: I configured model mapping, why can't I see the model name the client requested in statistics?**
Because statistics and billing use the final mapped model name. When the client requests `claude-opus-5` and it is mapped to `qwen3.7-max`, statistics only record `qwen3.7-max`. This is expected behavior; see [Configure identity-scoped model mapping](/en/howto/configure-identity-model-mapping.md) for details.

**Next**: [Overview dashboard](/en/console/overview-dashboard.md) for a global view; [Export billing Excel and log troubleshooting](/en/howto/billing-export-and-logs.md) for the export operation; [Log viewer](/en/console/logs-viewer.md) for per-request details.
