How prompt caching changes API pricing

See how reusing part of a prompt can cut the cost of a request, and why the first request still counts.

Prompt caching lets a provider reuse work on the part of a prompt you send again. That might be the same instructions and tool definitions at the start of every request.

Work out the cost without a cache hit

Track uncached input, cache reads, cache writes, and output separately. Providers can charge different rates for each.

Say 1M uncached input tokens cost $2, 1M cache-read tokens cost $0.20, and 1M output tokens cost $10. Actual rates depend on the model and route.

A request with 48,000 uncached input tokens costs $0.096 for input. The 2,000 output tokens cost $0.020. The total is $0.116 before any separate cache-write charge.

Repeated silhouettes of a bird in flight appear above its reflection.

Run the same numbers with a cache hit

Say the cache covers 40,000 of the 48,000 input tokens.

  • The 40,000 cached tokens cost $0.008 to read.
  • The other 8,000 input tokens cost $0.016.
  • The 2,000 output tokens still cost $0.020.

The total drops to $0.044 before any separate cache-write charge. That saves $0.072 on this request.

Keep the shared opening of your prompt stable. If you change it, check your billed token counts to see whether the cache still works.

Run the same tasks with and without cache reuse. Add up the full bill, including the first request that fills the cache, any misses, and any charges for writes or rewrites.

Send your first API request with the Jarbird quickstart.

Request a Jarbird invite