# Get analytics metadata

Source: https://provod.ai/en/docs/analytics-meta

**`GET /v1/analytics/meta`**

Discover the supported metrics, dimensions, filter operators and query limits.

## Authentication

`Authorization: Bearer <MANAGEMENT_API_KEY>`: a management key bound to the workspace.

The credential determines the workspace. `X-Org-Id` is unsupported.

## Metrics and dimensions


| Field                                          | Type   | Description                                                                  |
| ---------------------------------------------- | ------ | ---------------------------------------------------------------------------- |
| `total_usage`                                  | number | Actual usage and linked guardrail charges; also returns total\_usage\_exact. |
| `request_count, error_count`                   | number | Terminal requests and errors. Paid errors can contribute spending.           |
| `total_prompt_tokens, total_completion_tokens` | number | Recorded input and output tokens.                                            |
| `total_reasoning_tokens, total_cached_tokens`  | number | Recorded reasoning and cached tokens.                                        |
| `avg_latency`                                  | number | Average request duration in seconds.                                         |


Dimensions: `model`, `external_user`, `generation_id`, `api_key_hash`, `api_key_id`, `user_id`, `user`, `workspace_id`, `workspace`.

`api_key_id` returns the same hash as `api_key_hash`. `user` and `workspace` alias `user_id` and `workspace_id`. `external_user` comes from the user field in Chat Completions or Responses: it identifies your application user, not a workspace member. Historical requests may contain null.

## Parameters

No request body or parameters are required.

## Response · 200


| Field                                 | Type      | Description                                                                                                |
| ------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------- |
| `data.currency`                       | string    | Workspace billing currency.                                                                                |
| `data.metrics`                        | object\[] | name, display\_label (strings), display\_format (currency or number), is\_rate (boolean, currently false). |
| `data.dimensions, data.granularities` | object\[] | name and display\_label strings. Granularities: hour, day, week, month.                                    |
| `data.operators`                      | object\[] | name: eq, neq, in or not\_in; value\_type: scalar for eq/neq, array for in/not\_in.                        |
| `data.limits`                         | object    | max\_days: 93, max\_rows: 10000, max\_dimensions: 2, max\_filters: 20.                                     |


### Response example

Identifiers and amounts in these examples are illustrative.


**Response JSON**


```json
{
  "data": {
    "currency": "RUB",
    "metrics": [
      {
        "name": "total_usage",
        "display_label": "total_usage",
        "display_format": "currency",
        "is_rate": false
      },
      {
        "name": "request_count",
        "display_label": "request_count",
        "display_format": "number",
        "is_rate": false
      },
      {
        "name": "error_count",
        "display_label": "error_count",
        "display_format": "number",
        "is_rate": false
      },
      {
        "name": "total_prompt_tokens",
        "display_label": "total_prompt_tokens",
        "display_format": "number",
        "is_rate": false
      },
      {
        "name": "total_completion_tokens",
        "display_label": "total_completion_tokens",
        "display_format": "number",
        "is_rate": false
      },
      {
        "name": "total_reasoning_tokens",
        "display_label": "total_reasoning_tokens",
        "display_format": "number",
        "is_rate": false
      },
      {
        "name": "total_cached_tokens",
        "display_label": "total_cached_tokens",
        "display_format": "number",
        "is_rate": false
      },
      {
        "name": "avg_latency",
        "display_label": "avg_latency",
        "display_format": "number",
        "is_rate": false
      }
    ],
    "dimensions": [
      {
        "name": "model",
        "display_label": "model"
      },
      {
        "name": "api_key_id",
        "display_label": "api_key_id"
      },
      {
        "name": "external_user",
        "display_label": "external_user"
      },
      {
        "name": "user",
        "display_label": "user"
      },
      {
        "name": "workspace",
        "display_label": "workspace"
      },
      {
        "name": "api_key_hash",
        "display_label": "api_key_hash"
      },
      {
        "name": "user_id",
        "display_label": "user_id"
      },
      {
        "name": "generation_id",
        "display_label": "generation_id"
      },
      {
        "name": "workspace_id",
        "display_label": "workspace_id"
      }
    ],
    "granularities": [
      {
        "name": "hour",
        "display_label": "hour"
      },
      {
        "name": "day",
        "display_label": "day"
      },
      {
        "name": "week",
        "display_label": "week"
      },
      {
        "name": "month",
        "display_label": "month"
      }
    ],
    "operators": [
      {
        "name": "eq",
        "value_type": "scalar"
      },
      {
        "name": "neq",
        "value_type": "scalar"
      },
      {
        "name": "in",
        "value_type": "array"
      },
      {
        "name": "not_in",
        "value_type": "array"
      }
    ],
    "limits": {
      "max_days": 93,
      "max_rows": 10000,
      "max_dimensions": 2,
      "max_filters": 20
    }
  }
}
```



## Request example

Load the key into a server environment variable. TypeScript uses Node.js fetch; Python uses only the standard library.




TypeScript



Python



cURL




```typescript
const response = await fetch("https://api.provod.ai/v1/analytics/meta", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.MANAGEMENT_API_KEY}`,
  },
});
if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);
console.log(await response.json());
```



```python
import json
import os
from urllib.request import Request, urlopen

request = Request(
    "https://api.provod.ai/v1/analytics/meta",
    method="GET",
    headers={"Authorization": f"Bearer {os.environ['MANAGEMENT_API_KEY']}"},
)
with urlopen(request) as response:
    print(json.load(response))
```



```bash
curl --fail-with-body --silent --show-error -X GET \
  "https://api.provod.ai/v1/analytics/meta" \
  -H "Authorization: Bearer ${MANAGEMENT_API_KEY}"
```



## Errors


| HTTP  | Error        | Cause                                                                                       |
| ----- | ------------ | ------------------------------------------------------------------------------------------- |
| `401` | Unauthorized | Missing, invalid, disabled, revoked or expired key. The `X-Org-Id` header is also rejected. |
| `403` | Forbidden    | Wrong key kind or insufficient workspace access.                                            |


Authentication error example:

```json
{
  "error": {
    "code": "invalid_api_key",
    "message": "Invalid API key",
    "metadata": {}
  }
}
```

## Next steps

* [Management keys](/en/docs/management-keys)
* [Generation charges](/en/docs/generation-metadata)
