Skip to Content

Get cache hit summary

POSThttps://api.respan.ai/api/dashboard/cache-hit-metrics/summary/

Returns cache hit metrics aggregated over the time range.

Servers

https://api.respan.ai: Respan API Server

Authentication

RespanApiKey

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.

HTTP scheme: bearer; format: Respan API key.

HTTP
Authorization: Bearer $RESPAN_API_KEY

Or:

DashboardJwt

Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.

HTTP scheme: bearer; format: Dashboard JWT.

HTTP
Authorization: Bearer $RESPAN_DASHBOARD_JWT

Query parameters

Parameter Type Required Description and constraints
summary_type string Optional
Preset time range. Use this or explicit start_time / end_time.
Allowed: "daily", "weekly", "monthly", "quarterly", "yearly", "last_24h", "all"
Default: all
date string Optional
Base date used with summary_type presets.
Format: date
start_time string Optional
Optional explicit ISO start time.
Format: date-time
end_time string Optional
Optional explicit ISO end time.
Format: date-time
time_tick string Optional
Bucket granularity for time-series responses.
Allowed: "minute", "hour", "day"
Default: hour
timezone_offset number Optional
Timezone offset, in hours, used when resolving preset ranges.
Default: 0

Responses

200

Successful response.

application/json

Field Type Requirement Description and constraints
$ object Body
-
summary object Required in parent
Reference: #/components/schemas/DashboardCacheHitSummary
summary.number_of_requests integer Optional
-
summary.total_prompt_tokens integer Optional
-
summary.total_completion_tokens integer Optional
-
summary.total_tokens integer Optional
-
summary.total_time_saved number Optional
-
summary.total_cost number Optional
-

OpenAPI response schema

{
  "type": "object",
  "required": [
    "summary"
  ],
  "properties": {
    "summary": {
      "$ref": "#/components/schemas/DashboardCacheHitSummary"
    }
  }
}

403

The API key is missing, invalid or expired.

application/json

Field Type Requirement Description and constraints
$ object Body
-
detail string Required in parent
-

OpenAPI response schema

{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
Example
JSON
{ "detail": "Your API key is invalid or expired, please check your API key in the platform settings." }

OpenAPI source

The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.

OpenAPI operation

{
  "summary": "Get cache hit summary",
  "operationId": "getCacheHitMetricsSummary",
  "tags": [
    "Dashboard"
  ],
  "description": "Returns cache hit metrics aggregated over the time range.",
  "parameters": [
    {
      "name": "summary_type",
      "in": "query",
      "schema": {
        "type": "string",
        "enum": [
          "daily",
          "weekly",
          "monthly",
          "quarterly",
          "yearly",
          "last_24h",
          "all"
        ],
        "default": "all"
      },
      "description": "Preset time range. Use this or explicit `start_time` / `end_time`."
    },
    {
      "name": "date",
      "in": "query",
      "schema": {
        "type": "string",
        "format": "date"
      },
      "description": "Base date used with `summary_type` presets."
    },
    {
      "name": "start_time",
      "in": "query",
      "schema": {
        "type": "string",
        "format": "date-time"
      },
      "description": "Optional explicit ISO start time."
    },
    {
      "name": "end_time",
      "in": "query",
      "schema": {
        "type": "string",
        "format": "date-time"
      },
      "description": "Optional explicit ISO end time."
    },
    {
      "name": "time_tick",
      "in": "query",
      "schema": {
        "type": "string",
        "enum": [
          "minute",
          "hour",
          "day"
        ],
        "default": "hour"
      },
      "description": "Bucket granularity for time-series responses."
    },
    {
      "name": "timezone_offset",
      "in": "query",
      "schema": {
        "type": "number",
        "default": 0
      },
      "description": "Timezone offset, in hours, used when resolving preset ranges."
    }
  ],
  "responses": {
    "200": {
      "description": "Successful response.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "summary"
            ],
            "properties": {
              "summary": {
                "$ref": "#/components/schemas/DashboardCacheHitSummary"
              }
            }
          }
        }
      }
    },
    "403": {
      "$ref": "#/components/responses/InvalidApiKey"
    }
  },
  "security": [
    {
      "RespanApiKey": []
    },
    {
      "DashboardJwt": []
    }
  ]
}

OpenAPI path metadata

{}

Referenced OpenAPI components

{
  "responses": {
    "InvalidApiKey": {
      "description": "The API key is missing, invalid or expired.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
          }
        }
      }
    }
  },
  "schemas": {
    "DashboardCacheHitSummary": {
      "type": "object",
      "properties": {
        "number_of_requests": {
          "type": "integer"
        },
        "total_prompt_tokens": {
          "type": "integer"
        },
        "total_completion_tokens": {
          "type": "integer"
        },
        "total_tokens": {
          "type": "integer"
        },
        "total_time_saved": {
          "type": "number"
        },
        "total_cost": {
          "type": "number"
        }
      }
    }
  },
  "securitySchemes": {
    "DashboardJwt": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Dashboard JWT",
      "description": "Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.",
      "x-fern-bearer": {
        "name": "dashboardJwt",
        "env": "RESPAN_DASHBOARD_JWT"
      }
    },
    "RespanApiKey": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Respan API key",
      "description": "Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.",
      "x-fern-bearer": {
        "name": "respanApiKey",
        "env": "RESPAN_API_KEY"
      }
    }
  }
}