---
title: "Get LLM metrics over time"
method: POST
path: "/api/dashboard/llm-metrics/"
tags: ["Dashboard"]
---

# Get LLM metrics over time

`POST /api/dashboard/llm-metrics/`

## Request

- Base URL: `https://api.respan.ai`
- URL: `https://api.respan.ai/api/dashboard/llm-metrics/`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Returns LLM usage metrics in time buckets set by `time_tick`.

## Query parameters

- `summary_type` 'daily' | 'weekly' | 'monthly' | 'quarterly' | 'yearly' | 'last_24h' | 'all'
- `date` string, date
- `start_time` string, date-time
- `end_time` string, date-time
- `time_tick` 'minute' | 'hour' | 'day'
- `timezone_offset` number
- `fetch_filters` 'true' | 'false'

## Request body

- DashboardFiltersRequest: Optional POST body. Only `filters` is read from the body; time range controls are URL query parameters.
  - `filters` Filters: Each key is a field to filter on, and each value is a condition: `{"<field>": {"operator": "<operator>", "value": [...]}}`. A result must match every condition. To set two conditions on one field, such as a range, pass a list of conditions. **Operators:** `""` (equals, the default), `not`, `in`, `not_in`, `lt`, `lte`, `gt`, `gte`, `contains`, `not_contains`, `icontains` (ignores case), `startswith`, `not_startswith`, `endswith`, `not_endswith`, `empty`, `not_empty`. Put values in a list: `""` and `in` match any of the listed values, and `not` and `not_in` match none of them. Other operators take one value; for `empty` and `not_empty`, send `[""]`. The fields you can filter on depend on the endpoint; `metadata__<key>` filters custom metadata where the endpoint supports it.
    - `status` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `status_code` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `unique_id` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `customer_identifier` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `thread_identifier` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `custom_identifier` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `group_identifier` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `prompt_id` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `trace_unique_id` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `span_parent_id` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `is_root_span` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `span_workflow_name` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `span_name` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `model` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `log_type` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `stream` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `has_tool_calls` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `cache_bit` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `cache_key` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `prompt_tokens` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `completion_tokens` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `total_tokens` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `cost` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `latency` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown
    - `positive_feedback` FilterValue: A filter condition with an operator and value.
      - `operator` '' | 'not' | 'in' | 'not_in' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'not_contains' | 'icontains' | 'startswith' | 'not_startswith' | 'endswith' | 'not_endswith' | 'empty' | 'not_empty': Comparison operator. An empty string means equals.
      - `value` unknown[], required: Value(s) to filter by.
        - unknown

## Response `200`

Successful response.

- object
  - `data` DashboardLLMMetricsRow[], required
    - `date_group` string, date-time
    - `number_of_requests` integer, nullable
    - `total_cost` number, nullable
    - `total_prompt_tokens` integer, nullable
    - `total_completion_tokens` integer, nullable
    - `total_tokens` integer, nullable
    - `max_tpm` integer, nullable
    - `error_count` integer, nullable
    - `error_percentage` number, nullable
    - `average_prompt_tokens` number, nullable
    - `average_completion_tokens` number, nullable
    - `average_tokens` number, nullable
    - `average_cost` number, nullable
    - `average_latency` number, nullable
    - `average_tps` number, nullable
    - `average_ttft` number, nullable
    - `prompt_cache_hit_tokens` integer, nullable
    - `reasoning_tokens` integer, nullable
    - `cache_hit_percentage` number, nullable
    - `requests_per_second` number, nullable
    - `latency` number, nullable: Legacy empty-bucket field.
    - `time_to_first_token` number, nullable: Legacy empty-bucket field.
  - `summary` object, required
  - `filter_options` object, nullable, required

## Other responses

- `403`: The API key is missing, invalid or expired.

## Changes

- **2026-10-21** `c30bcb383ee8`: 35 breaking, 5 info
  - the response property `data/items/average_completion_tokens` became nullable for the status `200`
  - the response property `data/items/average_cost` became nullable for the status `200`
  - the response property `data/items/average_latency` became nullable for the status `200`
  - the response property `data/items/average_prompt_tokens` became nullable for the status `200`
  - …36 more
- **2026-10-02** `b830b79cfd52`: 55 breaking, 5 warning, 141 info
  - removed the enum value `iexact` of the request property `filters/cache_key/operator`
  - removed the enum value `iexact` of the request property `filters/completion_tokens/operator`
  - removed the enum value `iexact` of the request property `filters/cost/operator`
  - removed the enum value `iexact` of the request property `filters/custom_identifier/operator`
  - …197 more
- **2026-09-17** `6fa8242da8c2`: 1 warning, 1 info
  - deleted the `header` request parameter `Authorization`
  - the endpoint scheme security `RespanApiKey` was added to the API
- **2026-09-12** `22b868ef3f22`: 1 info
  - api operation id `list-llm-metrics` removed and replaced with `dashboard_listLlmMetrics`
- **2026-08-13** `4e064cf81dae`: 1 breaking, 27 warning, 9 info
  - removed the success response with the status `201`
  - removed the request property `average_completion_tokens`
  - removed the request property `average_cost`
  - removed the request property `average_latency`
  - …33 more

[Operation history](https://skmtc.dev/keywordsai/apis/respan-api/changes/api/dashboard/llm-metrics/post.md)

---

[API](https://skmtc.dev/keywordsai/apis/respan-api.md) - [All operations](https://skmtc.dev/keywordsai/apis/respan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/keywordsai/apis/respan-api/revisions/900841387635?raw)
