# List stats

URL: https://docs.hanzo.ai/docs/openapi/ai/get-ai-router-stats

> Returns the router observability aggregate.

`GET /v1/ai/router/stats`

> [AI →](https://docs.hanzo.ai/docs/openapi/ai) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                           |
| ------------- | ----------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/ai/router/stats` |
| **Method**    | `GET`                                     |
| **Operation** | `get_ai_router_stats`                     |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`    |

Returns the router observability aggregate. Two scopes, one route:

- ?scope=platform — PUBLIC-safe aggregate over ALL orgs, no authentication.
  Emits rates, shares, per-task/per-model counts, throughput, and the cost
  RATIO (saved\_pct) + counterfactual model id, but NEVER absolute $ levels,
  org identity, raw events, or feature vectors. This is what world.hanzo.ai
  polls.
- default (org scope) — requires a signed-in principal; scoped to the caller's
  OWN org (a super admin may pass ?org= to target another org or "" for all).
  Carries the absolute $/MTok indices for the admin savings panel.

Window: ?since= (RFC3339) or ?hours= (default 24, capped). Aggregates only.

## Request

`GET /v1/ai/router/stats` takes no parameters and no body — the credential is the whole request.

## Response

| Status | Body | Meaning                                             |
| ------ | ---- | --------------------------------------------------- |
| `200`  |      | Success.                                            |
| `401`  | —    | No credential, or one this service does not accept. |
| `403`  | —    | A valid credential that may not do this.            |

`200` body — 46 fields.

| Field                              | In   | Type               | Always | Description                                             |
| ---------------------------------- | ---- | ------------------ | ------ | ------------------------------------------------------- |
| `data`                             | body | any                | —      | The operation's own result.                             |
| `data2`                            | body | any                | —      | A second result the operation defines, when it has one. |
| `msg`                              | body | string             | yes    | Empty on success, the reason on failure.                |
| `status`                           | body | string             | yes    | One of `ok`, `error`.                                   |
| `data.by_model`                    | body | object             | —      |                                                         |
| `data.by_model.*`                  | body | integer            | —      |                                                         |
| `data.by_source`                   | body | object             | —      |                                                         |
| `data.by_source.*`                 | body | integer            | —      |                                                         |
| `data.by_task`                     | body | object             | —      |                                                         |
| `data.by_task.*`                   | body | ai.TaskStats       | —      |                                                         |
| `data.by_task.*.events`            | body | integer            | —      |                                                         |
| `data.by_task.*.models`            | body | object             | —      |                                                         |
| `data.by_task.*.models.*`          | body | integer            | —      |                                                         |
| `data.cost`                        | body | ai.CostStats       | —      |                                                         |
| `data.cost.baseline_model`         | body | string             | —      |                                                         |
| `data.cost.counterfactual_index`   | body | number             | —      |                                                         |
| `data.cost.cumulative_saved_index` | body | number             | —      |                                                         |
| `data.cost.priced_events`          | body | integer            | —      |                                                         |
| `data.cost.routed_index`           | body | number             | —      |                                                         |
| `data.cost.saved_pct`              | body | number             | —      |                                                         |
| `data.org`                         | body | string             | —      |                                                         |
| `data.quality`                     | body | ai.QualityStats    | —      |                                                         |
| `data.quality.avg_confidence`      | body | number             | —      |                                                         |
| `data.quality.learned_share`       | body | number             | —      |                                                         |
| `data.quality.reward_rate`         | body | number             | —      |                                                         |
| `data.quality.rewarded_events`     | body | integer            | —      |                                                         |
| `data.quality.shadow_agreement`    | body | number             | —      |                                                         |
| `data.retrain`                     | body | ai.RetrainMeta     | —      |                                                         |
| `data.retrain.events`              | body | integer            | —      |                                                         |
| `data.retrain.gate_base`           | body | number             | —      |                                                         |
| `data.retrain.gate_kind`           | body | string             | —      |                                                         |
| `data.retrain.gate_metric`         | body | string             | —      |                                                         |
| `data.retrain.gate_passed`         | body | boolean            | —      |                                                         |
| `data.retrain.gate_value`          | body | number             | —      |                                                         |
| `data.retrain.note`                | body | string             | —      |                                                         |
| `data.retrain.published`           | body | boolean            | —      |                                                         |
| `data.retrain.trained_time`        | body | string             | —      |                                                         |
| `data.retrain.version`             | body | string             | —      |                                                         |
| `data.scope`                       | body | string             | —      |                                                         |
| `data.throughput`                  | body | ai.ThroughputStats | —      |                                                         |
| `data.throughput.per_hour`         | body | integer\[]         | —      |                                                         |
| `data.throughput.total_window`     | body | integer            | —      |                                                         |
| `data.window`                      | body | ai.StatsWindow     | —      |                                                         |
| `data.window.events`               | body | integer            | —      |                                                         |
| `data.window.since`                | body | string             | —      |                                                         |
| `data.window.until`                | body | string             | —      |                                                         |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo ai router stats
```

**SDK**

**.ts**

```ts
import { Configuration, AiApi } from 'hanzoai';

const api = new AiApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getAiRouterStats();
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AiApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AiApi(client).get_ai_router_stats()
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AiAPI.GetAiRouterStats(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, ai_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = ai_api::get_ai_router_stats(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AiApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new AiApi(client).getAiRouterStats();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/ai/router/stats \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP declares no tool for **ai** — `tools/list` on `https://api.hanzo.ai/v1/mcp` names the products it does reach. Use HTTP or an SDK.

---

[AI API](https://docs.hanzo.ai/docs/openapi/ai) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
