Prompt caching
On Claude models NordRouter automatically caches long contexts. If your requests share a repeated beginning (system prompt, chat history, a large document) — the repeated part is billed at the cache-read rate, up to 90% cheaper than regular input.
How it works
- First request with a long context — the context is written to the cache.
- Subsequent requests with the same beginning — the matched part is read from the cache at the reduced rate.
- You can see it in the response under
usage.prompt_tokens_details.
What it costs
The cache works like Anthropic's — two rates derived from the model's input price:
| Operation | Multiplier | When it's charged |
|---|---|---|
| Write (cache-write) | ×1.25 | the first time the context enters the cache |
| Read (cache-read) | ×0.1 (−90%) | every repeat of the same context |
Each model has its own exact price — see the model catalog. Example on Claude Fable 5 (input $1.548/1M): write ≈ $1.94/1M, read ≈ $0.155/1M.
Activation threshold
Only sufficiently long contexts are cached (from a few thousand tokens). Short requests go at the regular price — they don't need the cache.
How to use it
1. Automatically — nothing to do
Most users don't need to configure anything. If your tool sends the same prefix (system prompt, history, a large document) — NordRouter caches it by itself. This is already how it works in Claude Code, OpenCode, Cline and any chatbot with history: on every step the agent resends the whole context — the first step writes the cache, every next one reads it at the 90% discount.
2. Check that the cache kicked in
Look at the usage block in the response — if part of the input hit the cache, you'll see cached_tokens:
"usage": {
"prompt_tokens": 21364,
"prompt_tokens_details": {
"cached_tokens": 21361 // ← read from cache at ×0.1
},
"completion_tokens": 40
}cached_tokens > 0 means that part of the input was billed at the read rate, not the full one.
3. Manual control via cache_control
If you want to decide yourself what gets cached (the /v1/messages endpoint), put a cache_control marker at the end of the block you reuse — e.g. on a large reference in system:
curl https://nordrouter.com/v1/messages \
-H "x-api-key: sk-nr-YOUR-KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "anthropic/claude-fable-5",
"max_tokens": 512,
"system": [
{
"type": "text",
"text": "You are an assistant for our documentation. Here is the reference: <...lots of text...>",
"cache_control": { "type": "ephemeral" }
}
],
"messages": [{ "role": "user", "content": "First question about the reference?" }]
}'from anthropic import Anthropic
client = Anthropic(base_url="https://nordrouter.com", api_key="sk-nr-YOUR-KEY")
resp = client.messages.create(
model="anthropic/claude-fable-5",
max_tokens=512,
system=[{
"type": "text",
"text": "You are an assistant for our documentation. Here is the reference: <...>",
"cache_control": {"type": "ephemeral"}, # cache the reference
}],
messages=[{"role": "user", "content": "First question about the reference?"}],
)
print(resp.usage) # cache_creation_input_tokens on the 1st request, cache_read on the nextThe first request writes the reference to the cache, all subsequent ones with the same system read it at ×0.1. Your own cache_control always takes priority — auto-caching stays out of such requests.
The dashboard toggle
Dashboard → Settings → "Prompt caching (Claude)":
- Enabled (default) — auto-cache for all Claude requests without your own markers. Optimal for agents and chats.
- Disable only if every one of your requests is completely unique — to avoid paying for cache writes that are never reused.
- If you pass
cache_controlyourself — the toggle doesn't matter, your markers always win.
Savings example
A 40-page reference (~30,000 tokens) with 10 questions on Claude Fable 5:
| No cache | With cache | |
|---|---|---|
| What's billed | 10 × 30k input | 1 write + 9 reads |
| Input cost | ~$0.46 | ~$0.10 |
That's ≈78% saved — and the more questions against the same context, the stronger the effect. This is exactly why agentic coding (where the context is reused dozens of times) ends up several times cheaper.