Get analytics metadata
Discover supported metrics, dimensions, filters and analytics query limits.
Last updated on
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.
Request example
Load the key into a server environment variable. TypeScript uses Node.js fetch; Python uses only the standard library.
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());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:
{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key",
"metadata": {}
}
}