# List metrics

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

> Serves the invocations-over-time histogram for the org's Agents dashboard.

`GET /v1/agent/metrics`

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

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

Serves the invocations-over-time histogram for the org's Agents
dashboard. Every point is a REAL count of recorded runs in that time bucket —
one series line per agent that ran in the window. The Resource Usage rollup is
all-null because this store meters no CPU/memory/storage/cost; the console
renders those as "—" rather than a fabricated figure. No runs => empty series
(an honest "not connected / no activity yet"), never a synthesized trend.

## Request

1 field.

| Field   | In    | Type   | Required | Description                                    |
| ------- | ----- | ------ | -------- | ---------------------------------------------- |
| `range` | query | string | —        | Range is the window to bucket: 24H, 7D or 30D. |

## Response

| Status    | Body              | Meaning |
| --------- | ----------------- | ------- |
| `200`     | agent.metricsView | ok      |
| `default` | problem-details   | refused |

`200` body — 11 fields.

| Field                     | In   | Type                 | Always | Description                                                                                                                                                                                                                    |
| ------------------------- | ---- | -------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `range`                   | body | string               | —      | echoes the requested window (24H\|7D\|30D)                                                                                                                                                                                     |
| `resource`                | body | agent.resourceUsage  | —      |                                                                                                                                                                                                                                |
| `resource.costCents`      | body | number (double)      | —      | CostCents would be the window's spend in cents.                                                                                                                                                                                |
| `resource.cpuVcpuHours`   | body | number (double)      | —      | CPUVcpuHours would be vCPU-hours over the window.                                                                                                                                                                              |
| `resource.memGbHours`     | body | number (double)      | —      | MemGbHours would be gigabyte-hours of memory.                                                                                                                                                                                  |
| `resource.storageIoBytes` | body | number (double)      | —      | StorageIoBytes would be bytes moved to and from storage.                                                                                                                                                                       |
| `series`                  | body | agent.seriesLine\[]  | —      | per-agent invocation histogram (real)                                                                                                                                                                                          |
| `series[].key`            | body | string               | —      | agent name                                                                                                                                                                                                                     |
| `series[].points`         | body | agent.seriesPoint\[] | —      | Points is one bucket per interval across the whole window, in time order and never sparse: a bucket with no runs is present with v 0, so two lines drawn from two agents share an x-axis without the client aligning anything. |
| `series[].points[].t`     | body | string               | —      | bucket start, RFC3339 UTC                                                                                                                                                                                                      |
| `series[].points[].v`     | body | integer (int64)      | —      | real invocation count in the bucket                                                                                                                                                                                            |

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

## Examples

**CLI**

```bash
hanzo agent metrics
```

**SDK**

**.ts**

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

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

**.py**

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

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

**.go**

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

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

**.rs**

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

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

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

**.java**

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

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

var result = new AgentApi(client).getAgentMetrics();
```

**HTTP**

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

**MCP**

MCP reaches **agent** through the `agent` tool, which names its 38 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_agents"
         }
       }
     }'
```

---

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