cache_control markers to Claude requests that have none, so when turns come less than 5 minutes apart, re-sent context is billed at the cache-read price: on Claude Sonnet 5.5 that’s 1/20 of regular input. There’s nothing to configure. Don’t confuse it with Anthropic’s “automatic caching”, where the client itself puts one cache_control marker at the top level of the request; RuAPI auto-caching mainly kicks in when the client sets no markers at all.
Why this matters: with Claude, prompt caching is switched on by the client — Anthropic only bills re-sent content at the cache price when the request carries a cache_control marker. Claude Code and many other tools that use the native Anthropic format set the markers themselves. But many tools that call Claude in the OpenAI-compatible format set no markers, so with every new turn the whole conversation history is billed again at full price.
What a Claude conversation costs with and without the cache
A coding tool re-sends the whole conversation on every turn: the system prompt, file contents, earlier answers and tool results. The longer the conversation, the more input tokens on each turn. A rough estimate: a 30-turn conversation with Claude Sonnet 5.5, with the context growing gradually from 20K to 100K tokens and less than 5 minutes between turns. Prices are from the pricing page as of Nov 20, 2026; the price on your account may be lower.
On Sonnet 5.5 a cache read costs 1/20 of regular input; a write costs 25% more than regular input but pays off with the very first read on the next turn. On Opus 5.5 and Fable 5.2 a cache read is $0.24 per 1M tokens — 1/20 and 1/40 of regular input respectively.
Why the OpenAI-compatible format often gets no caching
- Anthropic’s own OpenAI-compatible layer doesn’t support prompt caching (Anthropic docs, checked Oct 15, 2026).
- Many coding tools and home-grown agents don’t send
cache_controlwhen the “OpenAI Compatible” provider is selected. For Cline we checked this in the source code (Oct 16, 2026). Without markers, caching doesn’t happen even if the gateway supports it. - Our own data shows the same: in the 30 days before auto-caching launched on Nov 4, 2026, not a single Claude request in the OpenAI format read anything from the cache.
How RuAPI adds cache markers automatically
If the client set no markers at all, RuAPI adds at most two for you, with a 5-minute cache:- System prompt (together with tool definitions) — when the exact same ones came with the same key to the same model in the last 5 minutes. That way the system prompt can be read from the cache even on the first turn of a new conversation and in a series of standalone requests (for example, batch processing).
- The last user message or tool result — when the conversation is continuing and, as a rule, the previous turn came within the last 5 minutes. The whole history then goes into the cache.
/v1/chat/completions) and native (/v1/messages). The full rules are in Prompt caching.
What auto-caching saves in practice
From the launch of the new auto-caching version on the evening of Nov 18, 2026 to the morning of Nov 20, 2026:- in Claude requests where RuAPI added the markers, about 90% of the input tokens were read from the cache. That’s a share of tokens: a cache write costs 25% more than input, so the share saved in money is somewhat lower. Requests RuAPI didn’t mark (for example, a turn after a long break) aren’t included in this figure;
- the longer the conversation and the fewer breaks longer than 5 minutes, the bigger the saving.
Where to see your savings
- Console home page: once you’ve saved something over the last 7 days, a “Prompt cache saved you” card appears on the home page with the amounts for today and the last 7 days (refreshed about every 5 minutes).
- Usage Logs: open an entry — the “Saved by cache” line shows how much cheaper this request was than without the cache (it appears only when there actually was a saving); “Cache Tokens” is how much was read from the cache.
- API response: in the OpenAI format,
usage.prompt_tokens_details.cached_tokens; in the Anthropic format,usage.cache_read_input_tokens.
When it’s still better to set markers yourself
- Long gaps between turns are common: set the markers yourself and use the one-hour cache (
"ttl": "1h"; a write costs twice the regular input price). - Your own code: in the OpenAI-compatible format a single top-level
cache_controlmarker is enough — RuAPI, like Anthropic’s native API, moves it onto the last message. - If a coding tool lets you pick the Anthropic provider, pick it: in the native format the tool manages caching itself, which is the most reliable option.
How this differs from OpenRouter
According to OpenRouter’s documentation, Claude caching requires the client to setcache_control markers: one at the top level of the request (on the Claude providers its docs list) or up to four on content blocks. The documentation doesn’t say that OpenRouter adds markers itself when the client sets none.
The information about OpenRouter is from its official documentation (checked Nov 20, 2026).
FAQ
Do I need to turn auto-caching on?
Do I need to turn auto-caching on?
No, auto-caching works for every key.
Can auto-caching end up costing more?
Can auto-caching end up costing more?
A cache write costs 25% more than regular input, so RuAPI only adds a marker when the cache is likely to be read. If writes repeatedly fail to pay off, auto-caching pauses itself.
Do GPT and DeepSeek need auto-caching?
Do GPT and DeepSeek need auto-caching?
No. Their caching kicks in by itself: if a long enough prefix of the request matches the previous one, it’s usually read from the cache.
Does auto-caching affect Claude Code?
Does auto-caching affect Claude Code?
No. Claude Code puts a marker on the latest message itself, and RuAPI adds nothing.
Why didn't auto-caching kick in?
Why didn't auto-caching kick in?
Common reasons:
- there were no requests for more than 5 minutes and the cache expired;
- it’s the first turn of a new conversation: only a system prompt and tools identical to ones sent in the last 5 minutes are read from the cache;
- the client changes earlier content each turn — for example, it adds the current time to the system prompt;
- several writes in a row didn’t pay off, and auto-caching is paused;
- the request is too short: below the model’s minimum cacheable length.
Next steps
- Prompt caching: the full rules and code examples.
- How to cut your Claude Code and Cline bill: what breaks the cache.
- OpenAI or Anthropic format: how the two formats differ.
- Pricing: input, output and cache prices for every model.