Reduce costs and latency with automatic prompt caching
Prompt caching (reusing previously processed prompt tokens instead of reprocessing them) reduces cost and latency on repeated requests. By default, Auriko handles cache optimization automatically. For fine-grained control, you can specify cache control manually.
Auriko optimizes caching for each provider when your request includes reusable prompt content.On subsequent requests sharing the same prompt prefix, the provider serves cached tokens at reduced cost and lower latency.Auriko accounts for each provider’s caching economics (token thresholds, discount depths, and read/write prices) when choosing where to route.Over time, the system learns your usage patterns to improve estimation accuracy. Create separate workspaces for different use cases to get better predictions.Auriko is a zero data retention proxy. Your prompts, responses, and content are never read, logged, or stored. Pattern calibration uses usage metadata only. Read the Privacy Policy for details.
Auriko handles caching automatically for supported providers. For explicit control, each provider accepts specific fields. When you supply one, Auriko skips automatic injection and uses your value.
Provider
Field
Effect
Anthropic
cache_control: {"type": "ephemeral"} on content blocks
Marks specific content for caching
OpenAI
prompt_cache_key (string)
Improves cache hit rate for repeated conversations
OpenAI
prompt_cache_retention: "24h"
Extends cache lifetime to 24 hours
Fireworks
user (string)
Improves cache reuse across conversation turns
When you provide any of these fields, Auriko skips automatic cache injection for that provider.
Add cache_control to content blocks to mark specific content for caching:
import osfrom openai import OpenAIclient = OpenAI( api_key=os.environ["AURIKO_API_KEY"], base_url="https://api.auriko.ai/v1",)response = client.chat.completions.create( model="claude-sonnet-4-20250514", messages=[ {"role": "system", "content": [ {"type": "text", "text": "You are a helpful coding assistant with deep knowledge of Python, JavaScript, and Rust. You follow best practices and explain your reasoning step by step.", "cache_control": {"type": "ephemeral"}}, ]}, {"role": "user", "content": "Explain async/await in Python."}, ],)
The only supported type is "ephemeral". This follows the provider’s default retention behavior. cache_control applies to Anthropic models only. For other providers, automatic optimization handles caching.
OpenAI — prompt_cache_key and prompt_cache_retention
prompt_cache_key improves cache hit rate for repeated conversations. prompt_cache_retention: "24h" extends the cache lifetime to 24 hours.prompt_cache_retention is supported on gpt-4.1+ and gpt-5+ models only. It isn’t compatible with ZDR data policy. Omit it if your workspace uses ZDR.
cached_tokens shows how many prompt tokens were served from cache. Auriko normalizes this field across all providers in the OpenAI-format response.cache_creation_tokens shows how many tokens were written to prompt cache on this request. This field is populated for Anthropic models.For /v1/messages responses, cache tokens appear as top-level usage fields:
The model directory exposes cache pricing for every supported provider. Query it to see cache_read_price, cache_write_price, and supports_prompt_caching per model:
import osimport httpxresponse = httpx.get( "https://api.auriko.ai/v1/directory/models", headers={"Authorization": f"Bearer {os.environ['AURIKO_API_KEY']}"},)for model_id, model in response.json()["models"].items(): for provider in model.get("providers", []): for tier in provider.get("tiers", []): if tier.get("cache_read_price"): print(f"{model_id} ({provider['provider']}): " f"read=${tier['cache_read_price']}/M, " f"write=${tier.get('cache_write_price', 'N/A')}/M")
Providers offer discounted rates for cache reads compared to standard input pricing. Some charge a surcharge for cache writes. Check the directory for current prices.