---
title: "Get cache hits over time"
method: POST
path: "/api/dashboard/cache-hit-metrics/"
tags: ["Dashboard"]
---

# Get cache hits over time

`POST /api/dashboard/cache-hit-metrics/`

## Request

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

Returns semantic cache hit metrics (count, tokens, savings, hit %) as a time series.

## 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

## Response `200`

Successful response.

- object
  - `data` DashboardCacheHitRow[], required
    - `date_group` string, date-time
    - `number_of_requests` integer, nullable
    - `total_prompt_tokens` integer, nullable
    - `total_completion_tokens` integer, nullable
    - `total_tokens` integer, nullable
    - `total_time_saved` number, nullable
    - `total_cost` number, nullable

## Other responses

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

## Changes

- **2026-10-21** `c30bcb383ee8`: 8 breaking, 5 info
  - the response property `data/items/number_of_requests` became nullable for the status `200`
  - the response property `data/items/total_completion_tokens` became nullable for the status `200`
  - the response property `data/items/total_cost` became nullable for the status `200`
  - the response property `data/items/total_prompt_tokens` became nullable for the status `200`
  - …9 more
- **2026-10-02** `b830b79cfd52`: 6 breaking, 1 info
  - the response property `data/items/number_of_requests` became nullable for the status `200`
  - the response property `data/items/total_completion_tokens` became nullable for the status `200`
  - the response property `data/items/total_cost` became nullable for the status `200`
  - the response property `data/items/total_prompt_tokens` became nullable for the status `200`
  - …3 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-cache-hit-metrics` removed and replaced with `dashboard_listCacheHitMetrics`

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

---

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