# Get Agent Statistics

`GET /api/evaluations/{agent_id}/statistics`

Usage figures for one agent: reach counts plus per-unit averages.

Defaults to the last 7 days when no range is given.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `agent_id` | path | string | yes | Unique UUID of the target AI Agent. |
| `start_date` | query | string | no | Filter analytics and usage starting from this ISO 8601 date (inclusive). |
| `end_date` | query | string | no | Filter analytics and usage ending at this ISO 8601 date (inclusive). |
| `user_id` | query | string | no | Unique UUID of the target system user. |
| `source` | query | string | no | Filter token consumption by origin source ('chat', 'api_key', 'evaluation', 'webhook'). |
| `model_id` | query | string | no | Unique identifier of the LLM model configuration or catalog entry. |

## Responses

### 200 — Successful Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `start_date` | string | yes |  |
| `end_date` | string | yes |  |
| `distinct_users` | integer | yes |  |
| `conversations` | integer \| null | no |  |
| `input_messages` | integer \| null | no |  |
| `output_messages` | integer | yes |  |
| `input_tokens` | integer | yes |  |
| `output_tokens` | integer | yes |  |
| `total_tokens` | integer | yes |  |
| `avg_input_messages_per_conversation` | number \| null | no |  |
| `avg_output_messages_per_conversation` | number \| null | no |  |
| `avg_input_tokens` | number | yes |  |
| `avg_output_tokens` | number | yes |  |
| `avg_total_tokens` | number | yes |  |
| `assistant_messages` | integer | yes |  |
| `used_as_sub_agent` | boolean | no |  |

```json
{
  "start_date": "string",
  "end_date": "string",
  "distinct_users": 0,
  "conversations": 0,
  "input_messages": 0,
  "output_messages": 0,
  "input_tokens": 0,
  "output_tokens": 0,
  "total_tokens": 0,
  "avg_input_messages_per_conversation": 0,
  "avg_output_messages_per_conversation": 0,
  "avg_input_tokens": 0,
  "avg_output_tokens": 0,
  "avg_total_tokens": 0,
  "assistant_messages": 0,
  "used_as_sub_agent": false
}
```

### 400 — Bad Request - The request parameters or headers are invalid (e.g. unsupported API-Version).

### 401 — Unauthorized - Missing, invalid, or expired JWT Bearer token.

### 403 — Forbidden - Insufficient role permissions or resource access denied by RBAC policy.

### 404 — Not Found - The requested resource ID was not found.

### 422 — Validation Error

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `detail` | object[] | no |  |
| `detail[].loc` | string | integer[] | yes |  |
| `detail[].msg` | string | yes |  |
| `detail[].type` | string | yes |  |
| `detail[].input` | object | no |  |
| `detail[].ctx` | object | no |  |

```json
{
  "detail": [
    {
      "loc": [
        null
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
```

## Example

```bash
curl -X GET "$PINTER_URL/api/evaluations/agnt_risk_compliance_01/statistics" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```
