Skip to main content
Provider prompt caching reuses a prompt prefix at the model provider. A cache hit still makes a model call and generates a new answer. Atlaso records the provider’s reported cache reads and writes along with ordinary input and output usage. Model-call costs are billed by your provider, with no Atlaso markup, and never use Atlaso credit. Credits pay only for Atlaso learning, the AI clean-up of saved messages from Gateway calls and the Plugin.

Claude: only when reuse is likely

Atlaso’s automatic Claude cache rule is only when reuse is likely. Atlaso adds a cache marker when the conversation has earlier turns, or the same Atlaso key sent the same long prefix in the last 5 minutes. The prefix must also meet the model’s cache minimum. A first, one-off long request should not get an Atlaso-added cache write just because it is long. If you supply explicit cache_control, Atlaso respects those settings instead of adding its own marker. On Claude, cache_control takes ttl 5m (the default) or 1h. A request can carry at most 4 cache breakpoints, a top-level cache_control included, and every 1h breakpoint must come before every 5m one. Cache markers sit before the changing memory note where possible. Actual cache hits still depend on the provider. For the openai adapter, memory is inserted after leading system or developer messages. That changing note can affect prefix reuse; Atlaso does not promise memory can never increase a bill.

OpenAI cache lifetimes

For supported OpenAI models on /v1/responses, set prompt_cache_options.ttl to 30m or 12h. Individual prompt_cache_breakpoint.ttl settings can override the request default. Atlaso prices each reported write count at its own rate. If a request asks for 12 hours and the provider omits the split, all writes use the higher 12-hour price. Missing write counts on an estimated call are treated as 12-hour writes for all non-read prompt tokens. Activity shows the split. Use Chat Completions with the default 30-minute lifetime, or switch to Responses for 12-hour writes. Extended writes on Azure and Bedrock are refused until their own prices are verified. On OpenAI models, the older prompt_cache_retention field accepts only in_memory or 24h, and 24h is always refused because the catalog has no separate 24-hour write rate. On GPT-5.5, GPT-5.6 and GPT-6 models, and on models with a 12-hour rate, any prompt_cache_retention is refused: remove it and use prompt_cache_options.ttl. These refusals cost $0.00 and name the field to change. See Cache lifetime errors.

Where the saving appears

Overview shows Cache saved. It is the reduction from cached reads minus the extra cost of cache writes, using catalog prices. Writes at every priced lifetime are included. When writes cost at least half a cent more than reads saved, Overview says Cache cost Xmorethanitsaved∗∗instead;asmallernetcostshowsas∗∗CachesavedX more than it saved** instead; a smaller net cost shows as **Cache saved 0.00. Unknown catalog prices cannot establish a saving. Memory adds input tokens. Cache saved measures the cache’s net effect, not a controlled comparison of the same call with memory off. Call costs are calculated from reported usage when available; missing usage and estimates are distinguished.

Per-call cost and cache

Every Chat Completions and Responses reply names the call and what it cost, using the same catalog prices as Activity: On /v1/responses, a Gemini model on Google’s own API (not Vertex AI) refuses such a setting with a 400 instead of ignoring it. A call refused before reaching a provider costs 0.000000. When the provider did not report usage, cost and cache say unknown; that is never a zero bill. Some early refusals (a bad key, body or model, or a rate limit) carry a call ID but get no Activity row. These figures are catalog list prices, not your provider’s invoice. Streams send the call ID, provider and model as headers. A Chat Completions stream carries cost and cache only when you ask for usage with stream_options: {"include_usage": true}. Atlaso then adds an atlaso field (call_id, provider, model, cost_usd, cache, tokens, estimated, reason) to the usage chunk, the one with empty choices just before [DONE]. If the provider sent no usage, Atlaso sends that chunk itself, with usage set to null. Missing values are null. Without include_usage, Atlaso adds nothing to the stream, and the call’s cost is in Activity.
Streaming headers go out before the body, so x-atlaso-model names the routed catalog row. The provider stream’s own model field names the served model. Responses streams carry the same accounting in response.atlaso on the final completed, incomplete or failed event, or in atlaso on a bare error event. Both entrances expose the metadata and retry headers to browser clients. For routed calls, the reply cost covers the final attempt. Each earlier attempt has its own record and cost; see Errors.