Get a cached response
https://api.respan.ai/api/caches/{cache_key}/Retrieve a cached response by its organization-scoped cache key. API-key responses omit internal numeric IDs.
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.
Authorization: Bearer $RESPAN_API_KEYOr:
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.
Authorization: Bearer $RESPAN_DASHBOARD_JWTPath parameters
cache_key string RequiredResponses
200
Cached response details.
application/json
$ object Body
id integer OptionalExample:
123cache_key string Required in parentExample:
"cached_response_550e8400-e29b-41d4_abc123def456"prompt_content string Required in parentExample:
"What is the capital of France?"response_content string Required in parentExample:
"The capital of France is Paris."request_content string OptionalExample:
"What is the capital of France?"prompt_messages array<object> Optional
Example:
[{"role":"user","content":"What is the capital of France?"}]prompt_messages[] object Array itemfull_response object OptionalExample:
{"choices":[{"message":{"role":"assistant","content":"The capital of France is Paris."}}]}hit_count integer Required in parentExample:
42response_time number OptionalExample:
0.5timestamp string Required in parentFormat:
date-timeExample:
"2026-04-10T12:00:00Z"updated_at string Required in parentFormat:
date-timeExample:
"2026-04-10T12:00:00Z"expiry_date string or null Optionalnull returns 404.Format:
date-timeExample:
"2026-05-10T12:00:00Z"OpenAPI response schema
{
"type": "object",
"required": [
"cache_key",
"prompt_content",
"response_content",
"hit_count",
"timestamp",
"updated_at"
],
"properties": {
"id": {
"type": "integer",
"description": "Internal numeric ID. Present only for dashboard-JWT responses.",
"example": 123
},
"cache_key": {
"type": "string",
"description": "Organization-scoped public cache key.",
"example": "cached_response_550e8400-e29b-41d4_abc123def456"
},
"prompt_content": {
"type": "string",
"description": "Prompt text extracted from the cached request.",
"example": "What is the capital of France?"
},
"response_content": {
"type": "string",
"description": "Response text extracted from the cached response.",
"example": "The capital of France is Paris."
},
"request_content": {
"type": "string",
"description": "Stored request text preview. The current backend serializer truncates this field to roughly the first 100 characters.",
"example": "What is the capital of France?"
},
"prompt_messages": {
"type": "array",
"description": "Original prompt message array stored with the cache entry.",
"items": {
"type": "object"
},
"example": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
},
"full_response": {
"type": "object",
"description": "Full cached provider response object.",
"example": {
"choices": [
{
"message": {
"role": "assistant",
"content": "The capital of France is Paris."
}
}
]
}
},
"hit_count": {
"type": "integer",
"description": "Live cache hit count enriched from ClickHouse.",
"example": 42
},
"response_time": {
"type": "number",
"description": "Stored response time for the cached entry, in seconds.",
"example": 0.5
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "When the cache entry was created.",
"example": "2026-04-10T12:00:00Z"
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "When the cache entry was last updated.",
"example": "2026-04-10T12:00:00Z"
},
"expiry_date": {
"type": "string",
"format": "date-time",
"nullable": true,
"description": "When the cache entry expires. Always in the future; an entry whose expiry is past or `null` returns 404.",
"example": "2026-05-10T12:00:00Z"
}
}
}403
The API key is missing, invalid or expired.
application/json
$ object Body
detail string Required in parentOpenAPI response 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."
}404
Cached response not found.
application/json
$ object Body
detail string Required in parentOpenAPI response schema
{
"type": "object",
"required": [
"detail"
],
"properties": {
"detail": {
"type": "string"
}
}
}Example
{
"detail": "Cached response not found"
}OpenAPI source
The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.
OpenAPI operation
{
"summary": "Get a cached response",
"operationId": "api_caches_retrieve",
"tags": [
"Caches"
],
"description": "Retrieve a cached response by its organization-scoped cache key. API-key responses omit internal numeric IDs.",
"parameters": [
{
"name": "cache_key",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "Organization-scoped cache key returned by the cache list endpoint."
}
],
"responses": {
"200": {
"description": "Cached response details.",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"cache_key",
"prompt_content",
"response_content",
"hit_count",
"timestamp",
"updated_at"
],
"properties": {
"id": {
"type": "integer",
"description": "Internal numeric ID. Present only for dashboard-JWT responses.",
"example": 123
},
"cache_key": {
"type": "string",
"description": "Organization-scoped public cache key.",
"example": "cached_response_550e8400-e29b-41d4_abc123def456"
},
"prompt_content": {
"type": "string",
"description": "Prompt text extracted from the cached request.",
"example": "What is the capital of France?"
},
"response_content": {
"type": "string",
"description": "Response text extracted from the cached response.",
"example": "The capital of France is Paris."
},
"request_content": {
"type": "string",
"description": "Stored request text preview. The current backend serializer truncates this field to roughly the first 100 characters.",
"example": "What is the capital of France?"
},
"prompt_messages": {
"type": "array",
"description": "Original prompt message array stored with the cache entry.",
"items": {
"type": "object"
},
"example": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
},
"full_response": {
"type": "object",
"description": "Full cached provider response object.",
"example": {
"choices": [
{
"message": {
"role": "assistant",
"content": "The capital of France is Paris."
}
}
]
}
},
"hit_count": {
"type": "integer",
"description": "Live cache hit count enriched from ClickHouse.",
"example": 42
},
"response_time": {
"type": "number",
"description": "Stored response time for the cached entry, in seconds.",
"example": 0.5
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "When the cache entry was created.",
"example": "2026-04-10T12:00:00Z"
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "When the cache entry was last updated.",
"example": "2026-04-10T12:00:00Z"
},
"expiry_date": {
"type": "string",
"format": "date-time",
"nullable": true,
"description": "When the cache entry expires. Always in the future; an entry whose expiry is past or `null` returns 404.",
"example": "2026-05-10T12:00:00Z"
}
}
}
}
}
},
"403": {
"$ref": "#/components/responses/InvalidApiKey"
},
"404": {
"description": "Cached response not found.",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"detail"
],
"properties": {
"detail": {
"type": "string"
}
}
},
"example": {
"detail": "Cached response not found"
}
}
}
}
},
"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"
}
}
}
}