Prompt caching can reduce the cost of repeatedly sending the same instructions, reference material, or tool definitions. But a reusable prompt is not automatically a discounted prompt. This first-run checklist shows you how to structure requests, calculate a realistic monthly estimate, and verify the savings in actual usage.
1. Identify the input you pay to repeat
Start with one recurring workflow: a coding assistant, support agent, or document-review pipeline. Split each request into stable material and changing material. Stable material might include system instructions, a product handbook, or tool schemas. Changing material includes the latest question, retrieved passages, and current task details.
Prompt caching generally reuses processing for an eligible input prefix; it does not simply return a previously generated answer. Output tokens still incur their applicable charges. A repeated question alone does not guarantee a cache hit.
2. Check the model's caching rules first
Before changing your application, check the selected model and endpoint for cache eligibility, minimum prefix size, retention rules, and pricing. Some implementations cache automatically; others require explicit cache controls. Cache writes may have a separate price, and cached reads may receive a discount.
If you are considering Claude Sonnet 5.5 through SwiftRelay, confirm the current caching behavior and applicable rates for that route. Do not assume every model exposed through an OpenAI-compatible interface shares the same cache semantics.
3. Put reusable content before changing content
Arrange requests so the stable prefix stays identical across calls. Put shared instructions and reference material first, then append the changing task. Keep tool definitions and their ordering consistent when possible.
- Move timestamps, request identifiers, and user-specific details out of the shared prefix.
- Avoid rebuilding equivalent instructions with different whitespace or ordering.
- Keep distinct customer data properly isolated; never weaken access controls to improve reuse.
Prefix matching matters: an early change can prevent later content from qualifying for reuse. Treat the reusable prefix as a versioned application asset, not text assembled differently on every request.
4. Establish an uncached monthly baseline
Use a fixed workload so the calculation stays comparable. Assume 10,000 monthly requests, each containing 8,000 stable input tokens, 2,000 changing input tokens, and 1,000 output tokens. That produces 100 million input tokens and 10 million output tokens.
The following rates are illustrative, not SwiftRelay quotes: ordinary input costs $2 per million tokens, cached reads cost $0.20, cache writes cost $2.50, and output costs $8. Here, the write rate is the total charge for those tokens, not an additional surcharge.
Without caching, input costs $200 and output costs $80. Your baseline monthly bill is $280.
5. Calculate the cached monthly bill
Assume 90% of the stable input tokens qualify as cache reads. Of the 80 million stable tokens, that means 72 million cached-read tokens and 8 million cache-write tokens. The 20 million changing input tokens remain ordinary input.
- Cached reads: 72 million × $0.20 = $14.40.
- Cache writes: 8 million × $2.50 = $20.
- Ordinary input: 20 million × $2 = $40.
- Output: 10 million × $8 = $80.
The resulting monthly estimate is $154.40, saving $125.60 against the baseline. This assumes all eligible misses become writes under the illustrative pricing model. Actual provider accounting may differ.
6. Verify hits instead of assuming savings
Run a representative sample and inspect the usage fields or billing records available for your route. Record ordinary input, cache writes, cache reads, output, and total charges. Map these categories to the provider's accounting so you do not count cached tokens twice.
Repeat the test with realistic gaps between requests. Expiration, prefix changes, and traffic distribution can reduce reuse. If writes cost more than ordinary input, frequently rebuilding a cache without enough subsequent reads can erase the benefit.
7. Make cache accounting part of your monthly review
SwiftRelay is a practical place to consolidate pay-as-you-go token usage across supported models. Sign up for SwiftRelay, use the small gift credit to test a representative workload, and check the applicable pricing before expanding it.
Track cache-read share alongside total spend and output volume each month. Your target is not the highest hit rate at any cost: it is a lower verified bill for the same useful work.