| title | Azure API Management policy reference - llm-semantic-cache-store |
|---|---|
| description | Reference for the llm-semantic-cache-store policy available for use in Azure API Management. Provides policy usage, settings, and examples. |
| services | api-management |
| author | dlepow |
| ms.service | azure-api-management |
| ms.collection | ce-skilling-ai-copilot |
| ms.custom | |
| ms.topic | reference |
| ms.date | 02/23/2026 |
| ms.update-cycle | 180-days |
| ms.author | danlep |
[!INCLUDE api-management-availability-all-tiers]
The llm-semantic-cache-store policy caches responses to chat completion API requests to a configured external cache. Response caching reduces bandwidth and processing requirements imposed on the backend Azure OpenAI API and lowers latency perceived by API consumers.
Note
- This policy must have a corresponding Get cached responses to large language model API requests policy.
- For prerequisites and steps to enable semantic caching, see Enable semantic caching for Azure OpenAI APIs in Azure API Management.
- Because semantic caching returns responses based on similarity (not exact match), it can surface responses that are incorrect, outdated, or unsafe for the current request. Evaluate this feature carefully for your workload and include safeguards.
[!INCLUDE api-management-policy-generic-alert]
[!INCLUDE api-management-llm-models]
<llm-semantic-cache-store duration="seconds"/>| Attribute | Description | Required | Default |
|---|---|---|---|
| duration | Time-to-live of the cached entries, specified in seconds. Policy expressions are allowed. | Yes | N/A |
- Policy sections: outbound
- Policy scopes: global, product, API, operation
- Gateways: classic, v2, consumption, self-hosted
- This policy can only be used once in a policy section.
- If the cache lookup fails, the API call that uses the cache-related operation doesn't raise an error, and the cache operation completes successfully.
- [!INCLUDE api-management-cache-rate-limit]
[!INCLUDE api-management-llm-semantic-cache-example]
[!INCLUDE api-management-policy-ref-next-steps]