# List metrics

URL: https://docs.hanzo.ai/docs/openapi/eval/get-eval-metrics

> Your org's AI overview board over a window: totals (generations, prompt and completion tokens, cost in cents, errors, success rate, distinct models and users), a gap-filled time series, a per-model breakdown with the long tail folded into "other", and latency percentiles read from the GenAI spans.

`GET /v1/eval/metrics`

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

|               |                                        |
| ------------- | -------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/eval/metrics` |
| **Method**    | `GET`                                  |
| **Operation** | `get_eval_metrics`                     |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY` |

Your org's AI overview board over a window: totals
(generations, prompt and completion tokens, cost in cents, errors, success
rate, distinct models and users), a gap-filled time series, a per-model
breakdown with the long tail folded into "other", and latency percentiles read
from the GenAI spans.

The window the answer was actually computed over is echoed back, so a client
never has to infer it. A platform admin sees the board across ALL orgs;
everyone else sees their own.

The board is HONEST-EMPTY where it cannot be computed: with no datastore wired,
or under a named project scope the usage ledger does not yet carry, it answers a
valid board with zero totals and a flat series rather than a fabricated number
or a 500. Requires a validated principal; 401 without one.

## Request

2 fields.

| Field      | In    | Type   | Required | Description                                                                |
| ---------- | ----- | ------ | -------- | -------------------------------------------------------------------------- |
| `range`    | query | string | —        | Range is 24h (the default), 7d or 30d.                                     |
| `interval` | query | string | —        | Interval overrides the bucket the series is grouped into: "hour" or "day". |

## Response

| Status    | Body            | Meaning |
| --------- | --------------- | ------- |
| `200`     | eval.Board      | ok      |
| `default` | problem-details | refused |

`200` body — 60 fields.

| Field                        | In   | Type               | Always | Description                                                           |
| ---------------------------- | ---- | ------------------ | ------ | --------------------------------------------------------------------- |
| `byModel`                    | body | eval.ModelStat\[]  | —      | the top models by spend                                               |
| `byModel[].completionTokens` | body | integer (int64)    | —      | tokens it answered with                                               |
| `byModel[].costCents`        | body | integer (int64)    | —      | what this model cost, in cents                                        |
| `byModel[].costPct`          | body | number (double)    | —      | share of total spend, 0..100                                          |
| `byModel[].errorRate`        | body | number (double)    | —      | share of its calls that failed, 0..1                                  |
| `byModel[].errors`           | body | integer (int64)    | —      | calls to it that did not succeed                                      |
| `byModel[].model`            | body | string             | —      | the model this row is about, or "other" for the fold                  |
| `byModel[].modelCount`       | body | integer (int64)    | —      | >0 only on the "other" fold                                           |
| `byModel[].p50Ms`            | body | number (double)    | —      | median latency, null when no spans carry it                           |
| `byModel[].p95Ms`            | body | number (double)    | —      | 95th-percentile latency, null when unknown                            |
| `byModel[].p99Ms`            | body | number (double)    | —      | 99th-percentile latency, null when unknown                            |
| `byModel[].promptTokens`     | body | integer (int64)    | —      | tokens sent to it                                                     |
| `byModel[].provider`         | body | string             | —      | who serves it                                                         |
| `byModel[].requests`         | body | integer (int64)    | —      | calls to this model in the window                                     |
| `byModel[].totalTokens`      | body | integer (int64)    | —      | prompt plus completion                                                |
| `latency`                    | body | eval.LatencyStat   | —      |                                                                       |
| `latency.available`          | body | boolean            | —      | false when no GenAI spans carry timing; the percentiles are then null |
| `latency.p50Ms`              | body | number (double)    | —      | median latency over the window                                        |
| `latency.p95Ms`              | body | number (double)    | —      | 95th-percentile latency                                               |
| `latency.p99Ms`              | body | number (double)    | —      | 99th-percentile latency                                               |
| `other`                      | body | eval.ModelStat     | —      |                                                                       |
| `other.completionTokens`     | body | integer (int64)    | —      | tokens it answered with                                               |
| `other.costCents`            | body | integer (int64)    | —      | what this model cost, in cents                                        |
| `other.costPct`              | body | number (double)    | —      | share of total spend, 0..100                                          |
| `other.errorRate`            | body | number (double)    | —      | share of its calls that failed, 0..1                                  |
| `other.errors`               | body | integer (int64)    | —      | calls to it that did not succeed                                      |
| `other.model`                | body | string             | —      | the model this row is about, or "other" for the fold                  |
| `other.modelCount`           | body | integer (int64)    | —      | >0 only on the "other" fold                                           |
| `other.p50Ms`                | body | number (double)    | —      | median latency, null when no spans carry it                           |
| `other.p95Ms`                | body | number (double)    | —      | 95th-percentile latency, null when unknown                            |
| `other.p99Ms`                | body | number (double)    | —      | 99th-percentile latency, null when unknown                            |
| `other.promptTokens`         | body | integer (int64)    | —      | tokens sent to it                                                     |
| `other.provider`             | body | string             | —      | who serves it                                                         |
| `other.requests`             | body | integer (int64)    | —      | calls to this model in the window                                     |
| `other.totalTokens`          | body | integer (int64)    | —      | prompt plus completion                                                |
| `range`                      | body | eval.BoardRange    | —      |                                                                       |
| `range.end`                  | body | string             | —      | RFC3339 (UTC)                                                         |
| `range.interval`             | body | string             | —      | hour \| day                                                           |
| `range.range`                | body | string             | —      | echoed label (24h \| 7d \| 30d \| custom)                             |
| `range.start`                | body | string             | —      | RFC3339 (UTC)                                                         |
| `scope`                      | body | eval.BoardScope    | —      |                                                                       |
| `scope.allOrgs`              | body | boolean            | —      | true when a platform admin is seeing every org at once                |
| `scope.org`                  | body | string             | —      | the org the board covers; "" when it covers all of them               |
| `scope.project`              | body | string             | —      | the sub-scope within the org; "" is the whole org                     |
| `series`                     | body | eval.BoardPoint\[] | —      | one gap-filled bucket per interval, so a chart never breaks           |
| `series[].costCents`         | body | integer (int64)    | —      | what this bucket cost, in cents                                       |
| `series[].errors`            | body | integer (int64)    | —      | calls in this bucket that did not succeed                             |
| `series[].generations`       | body | integer (int64)    | —      | model calls in this bucket                                            |
| `series[].t`                 | body | string             | —      | RFC3339 (UTC) bucket start                                            |
| `series[].totalTokens`       | body | integer (int64)    | —      | tokens in this bucket                                                 |
| `totals`                     | body | eval.BoardTotals   | —      |                                                                       |
| `totals.completionTokens`    | body | integer (int64)    | —      | tokens the models answered with                                       |
| `totals.costCents`           | body | integer (int64)    | —      | what the window cost, in cents                                        |
| `totals.errors`              | body | integer (int64)    | —      | calls that did not succeed                                            |
| `totals.generations`         | body | integer (int64)    | —      | how many model calls the window holds                                 |
| `totals.models`              | body | integer (int64)    | —      | how many distinct models were called                                  |
| `totals.promptTokens`        | body | integer (int64)    | —      | tokens sent to the models                                             |
| `totals.successRate`         | body | number (double)    | —      | share of calls that succeeded, 0..1                                   |
| `totals.totalTokens`         | body | integer (int64)    | —      | prompt plus completion                                                |
| `totals.users`               | body | integer (int64)    | —      | how many distinct users called them                                   |

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

## Examples

**CLI**

```bash
hanzo eval metrics
```

**SDK**

**.ts**

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

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

**.py**

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

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

**.go**

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

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

**.rs**

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

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

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

**.java**

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

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

var result = new EvalApi(client).getEvalMetrics();
```

**HTTP**

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

**MCP**

MCP reaches **eval** through the `eval` tool, which names its 16 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_eval_datasets"
         }
       }
     }'
```

---

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