Skip to Content

Get cache summary

POSThttps://api.respan.ai/api/caches/summary/

Returns the number of unexpired cached responses matching the filters.

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

Request body

The request body is optional.

application/json

Field Type Requirement Description and constraints
$ object Optional body
-
filters object Optional
Each key is a field to filter on, and each value is a condition: {"<field>": {"operator": "<operator>", "value": [...]}}. A cached response 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 [""].

Fields: cache_key_by_org_uuid (the cache_key value the API returns), timestamp (when the response was cached), updated_at, and expiry_date. Send dates as ISO 8601 strings. Unsupported fields return a 400 error.

Example:

json<br />{<br /> "timestamp": {"operator": "gte", "value": ["2026-09-01T00:00:00Z"]}<br />}<br />
Example: {"cache_key_by_org_uuid":{"operator":"","value":["cached_response_550e8400"]}}

OpenAPI request schema

{
  "type": "object",
  "properties": {
    "filters": {
      "type": "object",
      "description": "Each key is a field to filter on, and each value is a condition: `{\"<field>\": {\"operator\": \"<operator>\", \"value\": [...]}}`. A cached response must match every condition. To set two conditions on one field, such as a range, pass a list of conditions.\n\n**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 `[\"\"]`.\n\n**Fields:** `cache_key_by_org_uuid` (the `cache_key` value the API returns), `timestamp` (when the response was cached), `updated_at`, and `expiry_date`. Send dates as ISO 8601 strings. Unsupported fields return a 400 error.\n\n**Example:**\n\n```json\n{\n  \"timestamp\": {\"operator\": \"gte\", \"value\": [\"2026-09-01T00:00:00Z\"]}\n}\n```",
      "example": {
        "cache_key_by_org_uuid": {
          "operator": "",
          "value": [
            "cached_response_550e8400"
          ]
        }
      }
    }
  }
}

Responses

200

Filtered cache summary statistics.

application/json

Field Type Requirement Description and constraints
$ object Body
-
total_count integer Required in parent
Total number of cached responses that match the query.
Example: 25

OpenAPI response schema

{
  "type": "object",
  "required": [
    "total_count"
  ],
  "properties": {
    "total_count": {
      "type": "integer",
      "description": "Total number of cached responses that match the query.",
      "example": 25
    }
  }
}

400

Bad Request

application/json

Field Type Requirement Description and constraints
$ object Body
-
error string Optional
-

OpenAPI response schema

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    }
  }
}
Example
JSON
{ "error": "Invalid filters" }

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 summary",
  "operationId": "getFilteredCachedResponsesSummary",
  "tags": [
    "Caches"
  ],
  "description": "Returns the number of unexpired cached responses matching the filters.",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "filters": {
              "type": "object",
              "description": "Each key is a field to filter on, and each value is a condition: `{\"<field>\": {\"operator\": \"<operator>\", \"value\": [...]}}`. A cached response must match every condition. To set two conditions on one field, such as a range, pass a list of conditions.\n\n**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 `[\"\"]`.\n\n**Fields:** `cache_key_by_org_uuid` (the `cache_key` value the API returns), `timestamp` (when the response was cached), `updated_at`, and `expiry_date`. Send dates as ISO 8601 strings. Unsupported fields return a 400 error.\n\n**Example:**\n\n```json\n{\n  \"timestamp\": {\"operator\": \"gte\", \"value\": [\"2026-09-01T00:00:00Z\"]}\n}\n```",
              "example": {
                "cache_key_by_org_uuid": {
                  "operator": "",
                  "value": [
                    "cached_response_550e8400"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Filtered cache summary statistics.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "total_count"
            ],
            "properties": {
              "total_count": {
                "type": "integer",
                "description": "Total number of cached responses that match the query.",
                "example": 25
              }
            }
          }
        }
      }
    },
    "400": {
      "description": "Bad Request",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          },
          "example": {
            "error": "Invalid filters"
          }
        }
      }
    },
    "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."
          }
        }
      }
    }
  },
  "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"
      }
    }
  }
}