AI Help

Why isn’t prompt caching reducing my AI API costs?

Inspect cached-token usage and the actual shared prompt prefix. Cache eligibility and routing rules depend on the model and endpoint.

Steps to follow

  1. Log model, prompt length, cached input tokens and the stable prefix while protecting private prompt content.
  2. Keep reusable instructions and reference material at the front and variable user input afterward. Verify current cache eligibility and retention guidance.
  3. Compare repeated equivalent requests and their usage breakdown. Lower latency alone does not establish a billing cache hit.

Example in practice

Illustrative example. A timestamp at the beginning of every prompt changes the prefix. Move variable metadata after reusable content and measure cached usage again.

Related AI help

Official guidance

OpenAI documentation