Prompt caching and usage verification

Understand the differences between cached reads, cached writes, and models.

What may be cached

Some upstreams support hint caching for duplicate prefixes. Hit conditions, minimum prefix length, retention time, and available parameters are determined by the specific model. Maintaining stable system prompts and tool definitions facilitates reuse, but does not guarantee every hit.

View fees

Cache reads and cache writes may have different prices. Combining the model price description with the call record verification, you cannot simply multiply the total number of input tokens by a fixed unit price. Some responses do not have complete cache details, and missing fields cannot directly equate to a zero hit rate.

N/A Third Party Guarantee

The daily cache hit rate, compensation ratio and automatic rebate rules published by other sites belong to their terms of service, and the documents of this site do not inherit these commitments. Whether protection is provided shall be subject to the public rules of this site or the agreement between the parties.

Development suggestions

Don’t put different users’ private data into the sharing prompt in order to improve the cache rate. Re-observe the actual usage after changing the model, tool definition or prefix content to avoid inferring cache validity based on parameter names alone.

How to verify cache

Choose a model that supports caching, use stable system prefixes and the same tool definition, complete the request once, and then repeat the same prefix at reasonable intervals. Align models, groups, and parameters and observe the cache fields visible in actual responses and call records; field names vary by protocol.

Tips for organizing suggestions

Put long-term stable system rules, instructions and tool definitions in the reusable prefix section, and put current round problems at the back. If the model requires explicit cache_control and other fields, configure them according to the model’s support method, and do not add fields with the same name to all protocols.

Hit change troubleshooting

Changes Possible Impact
System prompts or tool order changes Prefixes are no longer the same
Model or source changes Cache scope changes
The interval becomes longer The cache may expire
Content is not of minimum length Caching conditions may not be met
Response does not provide details Hit rate cannot be calculated based on missing fields alone

Caching reduces some of the overhead of repeated input, which is not equal to free calls, nor is it equal to application response caching. Before reusing the final answer directly to other users, still check permissions, timeliness and personalized content.