Cache Reads: Cut Prompt Costs Without Wasting Writes
When do cache reads actually save money?
Use cache reads when multiple requests share a large, unchanged prompt prefix: system instructions, tool definitions, reference documents, or conversation history. They are especially useful for coding agents and assistants that repeatedly send the same context. Savings depend on eligible tokens, cache lifetime, model pricing, and whether your API route passes through the discount.
A cache read reuses processed input context. The model still generates a new answer, so output tokens remain billable. It does not return a stored response.
How do you set up a useful cache test?
- Choose a repeatable workload. Start with a long policy document, repository instructions, or stable tool definitions. A short greeting may fall below the model's minimum cacheable length.
- Put stable content first. Keep reusable instructions and documents before the changing question. Move timestamps, request IDs, and user-specific details toward the end where possible.
- Keep the prefix identical. Preserve message order, tool definitions, whitespace, and document formatting. Changes near the beginning can prevent reuse of everything after that point.
- Use the model's caching mechanism. Claude supports explicit cache boundaries through cache_control on eligible content blocks. Supported OpenAI models generally cache eligible prefixes automatically. Confirm the selected model's current rules and the relay's support.
- Send several requests promptly. Keep the prefix fixed and change only the final question. Compare usage fields, latency, and billed cost across the requests.
Which usage fields prove a cache hit?
For Claude, inspect cache_creation_input_tokens and cache_read_input_tokens. A successful initial write can appear in the creation field; subsequent reuse should appear in the read field. Ordinary input_tokens are separate from those cache counts.
For OpenAI Chat Completions, inspect usage.prompt_tokens_details.cached_tokens. For the Responses API, inspect usage.input_tokens_details.cached_tokens. Cached tokens are included in total input tokens, so do not add them again when calculating total usage.
Usage proves reuse; billing proves savings. Compare the cache-read rate with the ordinary input rate on your actual route. A faster response alone does not establish that you received a discount.
Why are cache reads still zero?
- The prefix is too short. Minimum cacheable lengths vary by model. Check the requirement for the exact model ID you request.
- Something changed early. Compare the actual serialized requests, including system messages and tool schemas. A changing timestamp in the first message can defeat an otherwise reusable prefix.
- The cache expired. Retention depends on the provider, model, and caching configuration. Repeat your test within the documented lifetime.
- The route changed. Switching models, provider accounts, or upstream deployments may prevent reuse. Ask your relay how routing affects caching.
- Caching settings were dropped. SDK or gateway transformations can remove unsupported fields. Inspect the outgoing payload and confirm compatibility.
Can cache writes make a workload more expensive?
Yes. Some caching schemes charge a premium to create the cache. If a document is used once, rewritten constantly, or revisited after expiration, that premium may outweigh the read discount.
For illustration, assume a write costs 1.25 times the normal input rate and a read costs 0.10 times. Five requests sharing the same prefix cost 1.25 + 4 × 0.10 = 1.65 normal-prefix units instead of five: a 67% reduction for that prefix. These are illustrative rates; changing question tokens and output costs remain additional.
Should you pad prompts or extend retention?
Adding irrelevant text solely to cross a caching threshold usually creates unnecessary cost. First consolidate useful, stable context. Choose longer retention only when expected reuse justifies its pricing. Measure a representative session, including cold starts, cache writes, reads, and output.
How does 59API fit into the savings?
59API offers low-cost, pay-as-you-go access to native official-quality Claude and GPT models without downgrades, with compatibility for Claude Code, Codex, and OpenAI SDKs. Its API base URL is https://api.59api.com. Low model rates and effective cache reuse can complement each other, but verify caching support and billed read prices for your chosen route.
Sign up for 59API to benchmark your own workload with a small test budget. A referral rebate is also available; evaluate it separately from the cache savings shown in your usage and billing records.
Ready to get started?
Connect Claude & GPT in minutes at the lowest prices — full-power, never downgraded. Sign up to get your API key.
Sign up free