Prompt caching lets a provider reuse the work it already did on the start of a prompt. When a request opens with the same tokens as a recent one, that part is read from cache and billed at the cached input price.
Prices from the RouterPlus catalog, December 5, 2026. Docs checked December 3, 2026.
174of 182 provider listings on RouterPlus model pages show a cached input price
39open-weight models have at least one provider with a cached price
18%median cached price as a share of the same listing's input price
When caching pays
Long shared prefixes
A system prompt, tool definitions or examples that open every request. The longer the fixed start, the more of each call bills at the cached rate.
Agents
Your app sends the full conversation on every turn. Keep earlier messages unchanged and only append, so each turn opens with the start of the last one.
RAG on the same documents
Many questions against one contract, codebase or manual. Keep those documents in the stable part, and put content retrieved for each turn after it.
It pays little on short prompts, on prompts that change near the start, and on traffic too sparse to keep a cache warm. Providers cache a prompt start once it passes a minimum length, and caches expire.
Cached vs uncached prices
The 10 open-weight models with the most providers listing a cached price, at each model's default route: the provider where routing starts.
USD per 1M input tokens, as of December 5, 2026. Input at 80% cached = 20% of tokens at the input price plus 80% at the cached price, before any cache write. Providers set their own rates; each model page lists every provider.
How routing affects hits
A provider keeps a prompt's cache on one machine. The cache saves money when the next request reaches the same provider with the same prompt start. A turn sent somewhere new starts cold.
Input tokens per turn of one agent sessionExample
Turn 1Provider ACold start
Turn 2Provider ACache hit
Turn 3Provider ACache hit
Turn 4Provider BMoved, cold
Turn 5Provider BCache hit
Read from cacheBilled at full input price
What RouterPlus does
Same route first
Routing is deterministic. For the same model, key and provider object, every request tries the same route first, with or without a session ID.
Session IDs passed through
Send one session ID per conversation. RouterPlus gives it to each provider in that provider's own field, so the provider can send the conversation back to the machine holding its cache.
A short wait before moving
When the capacity pool for your first route is full, a follow-up turn waits up to 5 seconds for that route instead of moving to a cold cache.
What each route receives
Route
Session field sent
OpenAI (house or BYOK), Azure
prompt_cache_key: yours, else the session ID
Morph
x-session-id header: the session ID, else your prompt_cache_key
Anthropic, Bedrock
Nothing: the cache matches the prompt prefix
DeepInfra
Nothing: the cache matches the prefix without a key
A turn moves to the next provider of the same model when the first route fails before it sends output, its capacity pool stays full, or the provider's 429 pause is still running. After two failures in a row, later turns skip that route for 30 seconds. A turn that moves can miss the cache one time.
Send a session ID
Send one ID per conversation as session_id in the body or the x-session-id header. A valid ID is 1 to 256 printable ASCII characters; an invalid one is ignored with no error.
Python, openai package
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.routerplus.com/v1",
api_key=os.environ["ROUTERPLUS_API_KEY"],
)
SYSTEM = open("system_prompt.md").read() # long and fixed: the cached start
reply = client.chat.completions.create(
model="z-ai/glm-5.3-flash",
messages=[
{"role": "system", "content": SYSTEM},
{"role": "user", "content": "Summarize ticket 4812."},
],
extra_body={"session_id": "ticket-4812"}, # one ID per conversation
)
print(reply.usage.prompt_tokens_details.cached_tokens) # tokens read from cache
print(reply.usage.cost) # USD for this request
The same system prompt, the same tool definitions in the same order, and earlier messages unchanged. Add new content at the end.
Put changing content last
The time, IDs and documents retrieved for this turn go after the stable part.
Hold the model and provider object
Keep both the same for every turn of a session, so every turn tries the same route first.
Clear the minimum length
A provider caches a prompt start once it passes a minimum length. A short system prompt shows no cache reads.
Measure your hit rate
Divide cache reads by prompt tokens on each response. usage.cost is the full charge for the request, including any failed attempts on other providers.
Measures
Usage field
Cache readsOpenAI-compatible
usage.prompt_tokens_details.cached_tokens
Cache writesOpenAI-compatible
usage.prompt_tokens_details.cache_write_tokens
Cache readsAnthropic-compatible
usage.cache_read_input_tokens
Cache writesAnthropic-compatible
usage.cache_creation_input_tokens
Questions teams ask
What is prompt caching?
Prompt caching lets a provider reuse the work it already did on the start of a prompt. When a request begins with the same tokens as a recent one, the provider reads that part from its cache and bills it at the cached input price instead of the full input price.
How much cheaper are cached tokens?
Across RouterPlus model pages, 174 of 182 provider listings show a cached input price, at a median of 18% of that listing's input price (catalog as of December 5, 2026). Output tokens are not cached. Each model page lists every provider's input, cached and output price.
Do I need to change my code?
Often not. Turns of a session already try the same route first, and some providers cache long prompt starts on their own. To help providers that place conversations by key, send one session_id per conversation in the request body or the x-session-id header. Keep the prompt start identical and add new content at the end.
Which provider does each turn go to?
Routing is deterministic: for the same model, key and provider object, every request tries the same route first. A turn moves when that route fails before output, its capacity pool stays full, or the provider has paused it after a 429. It moves to another provider of the same model, and a moved turn can miss the cache one time.
What does session_id do?
RouterPlus passes it to each provider in that provider's own field: prompt_cache_key on OpenAI and Azure routes and the x-session-id header on Morph. Anthropic, Bedrock and DeepInfra get nothing because their caches match the prompt prefix. A valid value is 1 to 256 printable ASCII characters; an invalid one is ignored.
Do cache writes cost extra?
On some routes. With automatic caching on Claude, served by Anthropic's own API (the marketplace's anthropic route or your own Anthropic connection, not Bedrock), the first turn pays a cache write at 1.25 times the input price and later reads cost a tenth of input or less, per the RouterPlus docs. Routes that bill a write report it as cache_write_tokens or cache_creation_input_tokens in usage.
Why do I see no cached tokens?
The prompt may be below the provider's minimum cacheable length, something near the start changes between requests, the model or provider object changed, the cache expired, or the turn moved to another provider. Check usage.prompt_tokens_details.cached_tokens on each response.