Prompt Caching for Long Roleplay Chats
Prompt caching lets the AI provider reuse the unchanging part of your prompt (the preset, character card, lorebook, and past chat history) at a 90%–95% discount instead of charging full input price on every single reply.
Why your roleplay bill is 95% input tokens
When you write a 100-token message in a 32,000-token roleplay chat, SillyTavern doesn't just send your 100 tokens—it re-sends the entire 32,000-token history so the model remembers the story. Over 50 replies in one evening, that adds up to roughly 1,600,000 input tokens and 20,000 output tokens. On Claude Opus 5.5 ($2.80/MTok input, $14.00/MTok output), that 50-reply evening costs about $4.76 without caching. With prompt caching active, cached input reads drop to $0.14/MTok—bringing that same evening down to about $1.03.
| Model | 50 replies without caching | 50 replies with TavernAPI caching | Estimated savings |
|---|---|---|---|
| Claude Opus 5.5 | ~$4.76 | ~$1.03 | ~78% less |
How TavernAPI applies caching automatically
Normally, SillyTavern's Custom (OpenAI-compatible) mode does not place cache_control breakpoints for you. TavernAPI adds them on the server automatically whether you use our TavernAPI preset or your own local preset:
Three things that break prompt caching (and how to avoid them)
1. Random macros at the top of your prompt
Prompt caching only works when the beginning of the prompt is identical to the previous turn. If a local preset puts {{random}} or {{roll}} in the opening system prompt, the entire cache misses every turn. Keep random macros near the bottom of the prompt order.
2. Constantly shifting lorebook entries at depth 0 (top of prompt)
When world info entries trigger and disappear at the very top of the prompt, everything after them has to be re-cached. If you use heavy dynamic lorebooks, placing triggered entries at a shallow chat depth (like @depth 2 or 4) keeps your main history cache intact.
3. Pausing longer than the provider's cache window
Upstream providers keep cached prefixes in memory for about 5 minutes of inactivity (refreshed every time you send a message). When you take a break and come back an hour later, the first reply rewrites the cache, and subsequent replies go right back to the discounted cache-read rate.
See your exact savings in the console
Most API gateways support caching silently without telling you whether it worked. In the TavernAPI console, your Usage page shows Input tokens, Cache read tokens, Cache write tokens, and the exact USD amount caching saved you over your selected time range.
Common questions
Does my balance expire, and how do 30-day credit packs work?
Regular pay-as-you-go balance added via crypto top-ups or redeem codes never expires. If you want extra credit without a recurring subscription, you can manually buy a 30-day credit pack: pay $9 for $10, $19 for $23 (Recommended), or $39 for $48. Pack credits work on all five models, never auto-renew, and remain valid for 30 days from purchase.
How do your prices compare to official API rates?
Our Claude and Gemini models cost 20%–40% less than official list rates: Claude Opus 5.5 is $2.80/$14 per 1M tokens (30% off), Sonnet 5.5 is $1.60/$8 (20% off), Gemini 4 Argon is $1.20/$6 (40% off), and Gemini 3.8 Flash is $0.49/$2.45 (~35% off). DeepSeek V4 Pro runs on the official DeepSeek API at a single flat rate 24/7 ($1.49/$4.49, close to official peak pricing).
How does automatic prompt caching save money?
Our server places cache breakpoints on your system/preset prefix, character card, and conversation history so upstream providers reuse those tokens at a 90%–95% discount on subsequent replies. In a typical 50-reply, 32k-context session on Claude Opus 5.5 (~1.6M input and 20k output tokens), caching lowers the total cost from roughly $4.76 to about $1.03.
How do I get the $0.30 free trial credit and which models can I use it on?
New accounts receive $0.30 in free trial credit automatically after verifying an email address or signing in with a verified Google or Discord account. You can use the trial credit immediately on Gemini 3.8 Flash (gemini-3.8-flash) and Gemini 4 Argon (gemini-4-argon).