An application frequently generates the same type of report (daily sales summary) with only the data changing each time. Which optimization strategy would MOST reduce API costs?
Select an answer to reveal the explanation.
Short Explanation and Infographic
When your prompt structure is the same and only the data changes, caching the static parts (system prompt + template) means you only pay full price for the variable data tokens.
Full explanation below image
Full Explanation
Prompt caching is designed exactly for this scenario. The system prompt and report template remain constant while only the sales data changes. By caching the static prefix, subsequent calls pay cache read prices (significantly cheaper than full input token prices) for the cached portion and only full input prices for the new data. This can reduce input token costs by 50-90% for such use patterns. Option A (high temperature) doesn't reduce costs and would make reports inconsistent. Option C is impossible — you can't batch-generate reports for future unknown data. Option D (using Opus) would increase costs dramatically.