Optimisation questions at the Professional level are rarely “name a technique”. They are “here is a workload and a measurement, which lever fits, and what does it cost you in quality?” The method has three rules. Measure first, so you know which driver dominates. Take the free wins first: caching, batching and input hygiene lower cost or latency without lowering output quality. Validate every trade-off: effort, model tier and multi-model designs exchange cost for capability, so each is adopted only after your evaluation set (Lessons 3.1 and 3.2) shows quality holds. The unit to optimise is cost per completed task, not cost per token: a cheaper configuration that fails or retries more often is not cheaper.
Anthropic’s latency guidance adds a sequencing caution: first get a prompt working well, then reduce latency, because doing it prematurely can hide what top performance looks like.
Measure before you optimise
Every response reports token usage: uncached input, cache-creation input, cache-read input and output. Total input is the sum of the first three. Aggregate these by workload step and by model, and record latency as both time to first token and total time. Three tools help:
- The token counting endpoint returns the input token count for a request (system prompt, tools, images and PDFs included) before you send it. It is free, has its own rate limits, returns an estimate, and does not use prompt caching. Use it for budgeting, routing and fitting prompts to a length, and re-count when you change models, because newer tokenizers can produce roughly 30 percent more tokens for the same text.
- The Usage and Cost Admin API (Admin API credentials required) reports usage by model, workspace, service tier and other dimensions in minute, hourly or daily buckets, including cached and uncached tokens, typically within about five minutes; cost is reported daily.
- Your own request log (Lessons 1.4 and 3.6), which is the only place you can join tokens to task outcomes and get cost per completed task.
Match the driver to the lever
| Dominant driver | Lever | What it costs you |
|---|---|---|
| Large stable prefix (system prompt, tools, documents) resent on every call | Prompt caching | Write premium; any prefix change is a miss; cache management |
| Work nobody waits for (nightly jobs, offline evals) | Message Batches API | Asynchronous, up to 24 hours, unordered results |
| Easy steps running on a strong tier | Tiering or routing | Router errors; more moving parts; needs evals |
| Thinking and tool-call depth dominate | Lower effort first, then a smaller tier | Capability reduction, so validate |
| Verbose output | Output shaping | Blunt limits truncate; wording can hurt quality |
| Bulky tool results or history accumulating | Retrieval instead of inlining, context editing, trimming | Can invalidate cache; risk of dropping needed context |
| User-perceived wait | Streaming | Perceived latency only |
Prompt caching: what an architect needs to know
Caching reuses a processed prefix. Requests are assembled in the order tools, then system, then messages, and a change at one level invalidates that level and everything after it. Cache hits need a 100% identical prefix up to and including the block carrying the breakpoint. Put stable content first and the breakpoint after it. You can set breakpoints explicitly (up to four per request) or use automatic caching, which places the breakpoint on the last cacheable block and moves it forward as a conversation grows. Lookback from a breakpoint is limited to 20 blocks, so a fast-growing conversation may need another breakpoint.
The default lifetime is five minutes, refreshed on use, with a one-hour option. At the time of writing the docs price a five-minute write at 1.25 times the base input price, a one-hour write at 2 times, and a cache read at 0.1 times (lower on some models); confirm on the pricing page. The economics: a prefix read even once within its lifetime costs less in total than sending it uncached twice (1.25 + 0.1 against 2), so caching pays on repetition and loses on one-off content. Minimum cacheable length varies by model, so a short prefix may not cache at all.
Things that break the cache are architectural, not incidental: editing tool definitions or their order, toggling web search or citations, changing tool_choice, adding or removing images, changing thinking parameters, or changing the effort setting between requests. Hold these constant inside a cached session (a beta per-message effort change on some models preserves the cache). Track the cache-read share of input tokens as a first-class metric. And remember what caching does not do: it reduces the cost and latency of reprocessing input, and does nothing for how fast output tokens are generated.
Common exam distractor
“Caching speeds up generation” is wrong: it only removes reprocessing of a repeated input prefix. Equally tempting and wrong: downgrading the model first, treating caching, batching and routing as alternatives (they stack), using batches for an interactive path, and assuming batch results arrive in submission order (match on custom_id).
Batching, tiering, effort and multi-model designs
Batches. The Message Batches API bills all usage at 50% of standard prices, with most batches finishing within an hour and a hard expiry at 24 hours. A batch is limited to 100,000 requests or 256 MB, results may come back in any order, and streaming is not supported. Caching inside batches is best-effort because requests run concurrently, so use the one-hour lifetime for shared prefixes. It suits offline evals (Lesson 3.3), backfills and nightly jobs, not user-facing requests.
Tiering and effort. Anthropic describes two starting points: efficiency-first (start on the fast, low-cost tier and upgrade only for demonstrated capability gaps) and capability-first (start on a strong model, then lower effort or change tier once evals justify it). It also states that tuning effort is often a better lever than switching models. Set effort explicitly, sweep it against your evals, and re-sweep when you change models. Routing (a cheap classifier sends only hard requests to a stronger tier) keeps expensive spend proportional to difficulty, but the router has its own error rate and cost.
Multi-model designs. Anthropic’s guidance describes two patterns: an advisor (a cheaper executor consults a stronger model at hard decisions) and an orchestrator (a stronger model delegates bulk independent work to cheaper workers). They pay off only in specific shapes: a real capability gap with a reliable consultation signal, or work that genuinely splits into independent pieces or exceeds one context window. For one dependent chain that fits in a context, a single model at lower effort is usually cheaper. The stated measurement order is: sweep effort on the current model, price the stronger model alone at low effort, and treat that number as the baseline any multi-model design must beat.
Output shaping and context trimming
Ask for concision directly, limiting by sentences or paragraphs rather than word counts, which models follow less reliably. max_tokens is a hard cap that can cut an answer mid-sentence, so it suits short answers and safeguards, not length shaping. On some current models effort controls thinking volume rather than visible length, so prompt for length separately. To trim context, move large reference material behind retrieval, prune unused tool definitions, and consider context editing, which clears old tool results as a conversation grows; clearing invalidates cached prefixes, so clear enough at a time to justify each cache rewrite. Context budgeting is covered in Lesson 6.4 and caching design in Lesson 6.5.
Key concept: an optimisation is a claim you must test
Each change should state its driver, its expected saving and its quality risk, and be accepted only when cost per completed task drops while the gate metrics from Lesson 3.1 hold. If the saving is real but quality regressed, you have not optimised; you have moved the cost somewhere else.