# Warm assistant cache Pre-warm the Redis cache for an assistant to reduce latency on the first conversation request. Pre-warm the Redis cache for an assistant by fetching it from the database and storing the context in Redis. Subsequent conversation requests will skip the database query entirely, saving 10–50ms per request. The cache TTL is 30 minutes. This is typically called after saving a flow that contains an assistant node. #### Path Parameters **`assistant_id`** string required The unique identifier of the assistant to warm. ## Returns Returns an object containing the assistant ID and current cache status. Request ```bash cURL curl -X POST "https://api.aitronos.com/v1/assistants/asst_abc123/warm" \ -H "X-API-Key: $FREDDY_API_KEY" ``` ```python Python SDK from aitronos import Aitronos client = Aitronos(api_key="your-api-key") result = client.assistants.warm_assistant_cache("asst_abc123") print(f"Cache status: {result.get('cache_status')}") ``` ```python Python import os import requests api_key = os.environ["FREDDY_API_KEY"] assistant_id = "asst_abc123" response = requests.post( f"https://api.aitronos.com/v1/assistants/{assistant_id}/warm", headers={"X-API-Key": api_key} ) result = response.json() print(f"Cache status: {result.get('cache_status')}") ``` ```javascript JavaScript const apiKey = process.env.FREDDY_API_KEY; const assistantId = "asst_abc123"; const response = await fetch( `https://api.aitronos.com/v1/assistants/${assistantId}/warm`, { method: "POST", headers: { "X-API-Key": apiKey, }, } ); const result = await response.json(); console.log(`Cache status: ${result.cache_status}`); ``` Response ```json 200 OK { "assistant_id": "asst_abc123", "cache_status": "warmed", "ttl_seconds": 1800 } ``` ```json 401 Unauthorized { "success": false, "error": { "code": "AUTHENTICATION_REQUIRED", "message": "Authentication required. Please provide a valid API key.", "system_message": "Authentication required. Please provide a valid API key.", "type": "authentication_error", "status": 401, "details": {}, "trace_id": "req_abc123xyz", "timestamp": "2025-12-22T15:30:00Z" } } ``` ```json 404 Not Found { "success": false, "error": { "code": "RESOURCE_NOT_FOUND", "message": "The requested resource could not be found.", "system_message": "Assistant not found.", "type": "client_error", "status": 404, "details": { "assistant_id": "asst_abc123" }, "trace_id": "req_abc123xyz", "timestamp": "2025-12-22T15:30:00Z" } } ``` ## Related Resources - [Retrieve Assistant](/docs/api-reference/assistants/retrieve) - [List Assistants](/docs/api-reference/assistants/list) - [Create Assistant](/docs/api-reference/assistants/create)