What RuAPI gives you
- Claude over the native Anthropic API — just like Anthropic. Requests to
https://www.ruapi.ai/v1/messagesare passed through with theircache_controlmarkers unchanged,ttlincluded. Claude Code, the Anthropic SDK and agents set to the Anthropic provider get caching with no extra setup. - Claude over the OpenAI-compatible format — cached too. RuAPI passes
cache_controlmarkers on message blocks through to Claude and understands a single top-level marker (automatic caching), using the same syntax as OpenRouter. Anthropic’s own OpenAI-compatible layer doesn’t support caching. - GPT and DeepSeek — automatic. The cache kicks in by itself when the start of a request repeats; there’s nothing to configure.
- Transparent usage. The API response shows how many tokens were read from and written to the cache, and the console shows the same for every request.
- No VPN, no foreign-issued card. RuAPI is reachable from Russia directly, and you top up in USDT.
Pricing
See the exact rates for every model on the pricing page. A cache write costs a little more than regular input, so caching pays off as soon as the same context is sent a second time within the cache lifetime. Every hit extends the cache by another 5 minutes (or an hour).
Claude: how to turn caching on
Which format are you using?
One RuAPI key works with Claude in two formats: the native Anthropic format and the OpenAI-compatible format. How caching is turned on depends on which one you use. If you’re not sure, check any of these:
Claude Code always uses the native Anthropic format and sets the cache markers itself, so there’s nothing to check. In the OpenAI-compatible format, caching only works when the request carries
cache_control markers. For all the differences between the two formats, see OpenAI or Anthropic format.
Claude Code and coding agents
Your own app: Anthropic SDK
Put acache_control marker on the last block of the part of the request that doesn’t change — for example, a long system prompt. Everything before the marker goes into the cache.
"cache_control": {"type": "ephemeral", "ttl": "1h"}.
Your own app: OpenAI SDK
In the OpenAI-compatible format the marker goes on a block incontent, so a message that carries a marker has to send its content as a list of blocks rather than a string.
cache_control marker — Anthropic calls this automatic caching. In that case RuAPI places the marker on the last block of the last message itself, just as Anthropic does, so this option works on all of our Claude channels. With each new message the marker moves forward, and the whole earlier conversation lands in the cache.
A request can carry at most 4 markers. A request start that’s too short isn’t cached; the minimum length depends on the model — for example, 512 tokens for Claude Sonnet 5.5 and Claude Opus 5.5.
GPT and DeepSeek: caching is automatic
- GPT. If the first 1,024 or more tokens of a request match a recent request, the matching part is read from the cache. No markers needed.
- DeepSeek. Caching is always on: a repeated request start is billed at the cache-hit price.
How to check that the cache worked
In the OpenAI format,
prompt_tokens already includes the cached tokens, just as with OpenAI. The console shows the same for every request: Usage Logs → open an entry.
Comparison
Information about other services is based on the Anthropic and OpenRouter documentation (checked Oct 15, 2026); the OpenRouter 403 error is from our own check on Sep 30, 2026.
FAQ
Why isn't the cache working?
Why isn't the cache working?
- The start of the request changed. Even one character before the marker — the current time, a random ID — means a new prefix and a new cache write.
- The start of the request is too short for this model.
- More than 5 minutes passed without requests (or an hour with
"ttl": "1h"). - Claude is called in the OpenAI-compatible format without
cache_controlmarkers.
Claude is draining my balance fast — what should I check?
Claude is draining my balance fast — what should I check?
Most likely the cache isn’t working, so the whole repeated context is billed at full price every time.
- Find out which format you use: open a Claude entry in the console’s Usage Logs and look at “Request path”.
/v1/messagesis the native Anthropic format: caching works just as with Anthropic (Claude Code sets the markers itself), and the usual reasons for misses are in the previous question./v1/chat/completionsis the OpenAI-compatible format: go through the steps below. Other ways to tell the format are in “Which format are you using?” above. - Check whether the cache works: if the entry details show a “Cache Tokens” line, the cache was hit; if repeated requests never show it, caching isn’t working. In your own code, the same number is in
usage.prompt_tokens_details.cached_tokensin the API response. - Check whether your client sets
cache_controlmarkers: without them Claude doesn’t cache anything. Many agents don’t set markers in OpenAI Compatible mode, so pick the Anthropic provider there. In your own code, a single top-levelcache_controlmarker is enough. - If you go through another gateway, check its documentation for Claude caching in the OpenAI-compatible format specifically. Not every gateway has it: Anthropic’s own OpenAI-compatible layer doesn’t support caching, and APIYI’s documentation, for example, says the Claude cache discount only applies in the native Anthropic format (checked Oct 15, 2026). On RuAPI, Claude caching works in both formats.
Does caching cost extra?
Does caching cost extra?
A cache write costs 1.25× the regular input price (2× for the one-hour cache), but every read after that is at least 10× cheaper. If the context is sent at least twice, you’re already saving.
Do I need to turn anything on in the RuAPI console?
Do I need to turn anything on in the RuAPI console?
No. Caching works for any key: for Claude,
cache_control markers are enough (Claude Code sets them itself), and for GPT and DeepSeek the cache is automatic.Next steps
- Claude Code: set it up with caching out of the box.
- Pricing: how caching affects what you pay.
- DeepSeek vs Claude: what one day of work actually costs: a real bill with caching, broken down.
- How to cut your Claude Code and Cline bill: what breaks the cache and how to keep the context short.