Choosing and Using the ToolsLesson 33 of 76

Module 4 · What it actually costs

The two discounts almost nobody uses

In this lesson

  • 8 min read
  • 5 reading sections
  • Knowledge check
  • Lesson 5 of 10 in this chapter

This chapter’s goalEstimate the cost of a job from a measured sample before running it, cut that cost with prefix caching, batching and model routing without lowering quality, choose between a subscription, prepaid credit and pay-as-you-go for your own pattern of use, and set an enforced cap so the worst case is bounded.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
Order the request so the cache can matchLong instructionsByte-identical every time. Cached.Reference documentByte-identical every time. Cached.The questionVaries. Everything from here down is charged infull, which is correct and unavoidable.Today’s date, the user’s nameMove these below the question. One variable fieldnear the top invalidates every cached block afterit.The cache matches on an exact prefix, so every stable block goes at the front and everything variableat the back. Discounts run from a half to nine tenths on the matched portion, and the commonestmistake is a date sitting two lines from the top.
The cache matches on an exact prefix, so every stable block goes at the front and everything variable at the back. Discounts run from a half to nine tenths on the matched portion, and the commonest mistake is a date sitting two lines from the top.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 6Free · no account needed
Lesson steps

Prompt caching

If you send the same long block of text repeatedly (a system prompt with detailed instructions, a policy document, a code file, a knowledge base) the provider can store its processed form and charge a fraction to reuse it. Discounts are typically 50% to 90% on the cached portion, and some providers apply it automatically while others need a marker in the request.

The mechanism decides how you use it. The cache matches on an exact prefix: the request has to begin with byte-identical text. So the rule is to put everything stable at the front and everything variable at the back.

Text
[ long instructions        ]  <- identical every time, cached
[ reference document       ]  <- identical every time, cached
[ today's date, user's name]  <- CHANGES: breaks the cache from here on
[ the question             ]

move the date and the name to the END, after the question,
and the whole block above stays cached

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the AI at Work exam.

Stuck on something?Ask Rukmini, your AI tutor

How to cite: Addaly (2026) ‘The two discounts almost nobody uses’, in Choosing and Using the Tools. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/choosing-your-tools/caching-and-batching (Accessed: 29 November 2026).