Skip to content

Measure Cache Hits Instead of Assuming Them

2026-09-17openai, prompt-caching

Two requests can look similar to a person while failing to reuse a cached prefix. Measure the actual usage data.

Run a controlled test with a stable prompt and several different synthetic inputs. Record the API's cached-token information, total input and output usage, elapsed time and whether each result passed its check. Then change one part of the stable prefix and compare again.

Keep the experiment tied to the model and configuration you used. A cache observation from one workflow does not establish a guarantee for every workload. If savings are small, inspect whether long outputs or repeated failed attempts dominate the bill. Optimizing the wrong part of the request can produce an impressive chart with little effect on the cost of accepted work.

OpenAI documentation.