Skip to main content
Yes. Caching parameters go to the upstream provider unchanged, cache-hit fields come back in the response unchanged, and cached input is billed at the cache-read price in the model catalog. Models whose cache-read column shows ”—” have no cache price, so all input is billed at the normal input price. The catalog is the source of truth for which models have a cache price and what it is. You don’t need to turn caching on for any vendor above. Only Claude and the GPT-6, GPT-6.1, GPT-6.2, and GPT-5.6 series charge separately for cache writes; other models have no cache-write fee.

GPT-6, GPT-6.1, and GPT-5.6 cache-write pricing

These three series also bill caching in two parts, at the same multipliers as OpenAI’s official pricing:
  • Cache write: the first time a prefix is cached, those tokens cost 1.25× the input price. The call log marks the request as a cache miss that created a cache.
  • Cache read: later requests that hit the prefix pay the cache-read price in the catalog.
Prices are in USD per 1M tokens, for prompts up to 272K tokens. Caching is automatic: any prefix of 1,024 tokens or more is written, and it can’t be turned off. Requests whose content changes every time, such as a new image in each call, usually write and never hit. When the same prefix is reused, hits cost about a tenth of the input price, so you save overall. GPT-5.5 and earlier OpenAI models have no cache-write fee. gpt-6.2-astra and gpt-6.2-sol launched on November 18, 2026; their cache-read and cache-write rates are in the GPT-6.2 launch announcement. Whether a request hits the cache shows in the response’s usage fields and in your call logs.

Claude cache-write pricing

Claude models bill caching in two parts:
  • Cache write: the first time a prefix is cached, those tokens cost 1.25× the input price, the same multiplier Anthropic uses. For example, claude-sonnet-5-5 input is $2 per 1M tokens, so a cache write is $2.5 per 1M tokens.
  • Cache read: later requests that hit the prefix pay the cache-read price in the catalog.
  • Lifetime: 5 minutes by default. If no request uses the prefix for 5 minutes, it expires and the next request writes it again.
cache_control in the request marks what to cache, and Claude Code adds it for you. Without cache_control, a long fixed prefix is usually cached anyway, so the first request with a long prompt can include a cache-write charge. Caching pays off when the same prefix is reused within 5 minutes.

Raise your hit rate

Caching matches on prefixes: only the part of a request that starts exactly like an earlier one can hit. When you build requests:
  • Put content that doesn’t change first: system prompts, tool definitions, long documents.
  • Put content that changes every time last: the user’s question, timestamps, random IDs.
  • In multi-turn chats, append new messages at the end and leave earlier history untouched.
  • Keep one model per workload. Caches are separate per model and aren’t shared when you switch.
OpenAI models also accept prompt_cache_key to group similar requests so they hit more often; see OpenAI prompt caching.

Confirm a cache hit

Check the cache field in the response’s usage; any value above 0 is a hit: For GPT-6 models, tokens written to the cache appear in usage.prompt_tokens_details.cache_write_tokens. For Claude, they appear in usage.cache_creation_input_tokens. When you call Claude through Chat Completions, hits still appear in usage.prompt_tokens_details.cached_tokens. Cached tokens are billed at the cache-read price and the rest of the input at the normal input price; the full formula is in Read the charges in a log entry. Call logs show the actual charge.

Things to keep in mind

  • Gemini’s implicit cache hits unpredictably, because the upstream provider decides when it hits. Budget at uncached prices and treat hits as a bonus.
  • Grok doesn’t guarantee hits upstream either, so budget the same way.
  • Short prefixes don’t trigger caching. OpenAI’s minimum is 1,024 tokens; other vendors document their own thresholds.
  • With long contexts, a cache hit can make the charge much lower than a full-price estimate from prompt_tokens. That’s expected.

FAQ

Do I need to enable caching in my request?

Not for the vendors above; their caching is automatic. With Claude you can also set cache breakpoints with cache_control. LaoZhang API doesn’t rewrite these requests or add its own cache fee. Claude and GPT-6, GPT-6.1, GPT-6.2, and GPT-5.6 cache writes cost 1.25× the input price, the same as official pricing; see GPT-6 cache-write pricing and Claude cache-write pricing. Gemini, DeepSeek, Grok, Kimi, and earlier OpenAI models have no cache-write fee.

What does a cache miss that created a cache mean in my log?

The input in that request appeared for the first time, so it was written to the cache instead of hitting it. For GPT-6, GPT-6.1, GPT-6.2, GPT-5.6, and Claude models, the written tokens cost 1.25× the input price. Send content with the same beginning within a few minutes and the log shows a hit, billed at the cache-read price.

Why did an identical request miss the cache the second time?

Upstream caches expire after a period without use (5 minutes by default for Claude) and may be cleared early at peak times, and a single changed character in the prefix causes a miss. Check whether the start of the request includes a timestamp, random content, or tool definitions in a changing order.