CertPrep
Domain 6 · Lesson 6.1 · 7 min read

Cost Architecture at Fleet Scale

Exam skillCost Architecture at Scale

Evaluating fleet-level optimization strategies using usage and cost data, including cost modeling and forecasting, model routing and cascades across the Claude model family, caching strategy and cache diagnostics, batch-versus-realtime economics, and per-tenant budget enforcement.

Model and forecast cost per unit of work, route requests across the model family with validated routers and cascades, design caching from its break-even, move offline work to batch, enforce per-tenant budgets before requests run, and explain bills from usage data.

What you need to know

Fleet-level cost work starts from a breakdown, not a hunch. Spend is volume times cost per unit of work, and cost per unit is the sum of token categories at their prices, across the models each route uses. Most savings come from a few levers applied where the breakdown points: routing, caching, batch, right-sized outputs and context, and sensible defaults.

Cost per unit of work

For each route, model cost per task (a claim, a conversation, a report) from its components:

  • steps per task and tokens per step, split into uncached input, cache reads, cache writes and output;
  • the model each step uses;
  • retries, escalations and human handling for a full cost per successful outcome.

Output tokens cost several times more than input tokens on Claude models, so verbose outputs can dominate even when inputs are larger.

Forecasting

Forecast cost per unit from its components, including planned features (two extra tool calls per claim), then multiply by forecast volume. Scaling last quarter's total by expected growth misses changes in cost per unit. Budget alerts should be forward-looking: project month-end spend from the current run rate, with an early-warning threshold.

Routing and cascades

DesignSaves money whenFails when
Router: classify each request and send it to the cheapest model that meets its floorThe classifier is validated on evaluation data (for example 95% precision on "simple")The router is unvalidated, or routes by guesswork
Cascade: try a small model, check the result, escalate failuresMost items succeed on the cheap tierEscalation is frequent: at 45% escalation, every escalated item pays twice and the cascade costs more than going direct

Escalate on failed checks, never on customer complaints.

Caching strategy

FactConsequence
Reads cost a small fraction of input; writes cost more than inputA prefix pays off after a small number of reuses within its lifetime
The default lifetime is short (five minutes, renewed on use)Requests spaced further apart miss; the one-hour lifetime costs more to write, so check it against the actual reuse rate
The cache matches an exact prefix: tools, system, messagesAnything per-request before the breakpoint (timestamps, user IDs, tool order) creates a new entry every time
A prefix below the model's minimum is not cachedNo error is raised; watch the usage fields

Diagnose with cache reads as a share of input and cache-creation tokens over time (lesson 3.1).

Batch versus real time

Work with no one waiting (nightly classification, catalog generation, evaluation runs) belongs in the Message Batches API at a lower price per token, with the same model and quality. Work with a freshness or interactive requirement stays real time.

Other levers

  • Retrieved context: retrieve fewer, better-ranked passages, guided by recall measurements.
  • Programmatic tool calling: for many independent lookups, a script calls the tools and only its output reaches Claude, cutting tokens and round trips. It helps less when each step depends on reasoning over the last result, and it has its own billing and limits.
  • Defaults: most usage runs on defaults. A mid-tier default model and a moderate default effort, with escalation available, move most spend; bans and flat caps block valuable work.

Per-tenant budgets

Enforce budgets in the request path: check the tenant's remaining budget (using an estimated request cost) before forwarding, with soft limits as tenants approach it (warnings, slowing non-urgent work). Reconciling from the invoice or reading a console weekly does not cap anything.

In the exam

Cost items give a breakdown, a bill that grew, or a proposed design. Find the largest driver and pick the lever for it, checking the economics (escalation rate, reuse within cache lifetime, latency needs). Distractors move everything to one tier, cap everyone flatly, compare per-request instead of per-outcome cost, or enforce budgets after the fact.

Check your understanding

Question 1

A Haiku-class model meets the floor on 70% of requests, which a check identifies with 95% precision. Which design is best?

Show answer

Answer: A. Routing by validated difficulty keeps quality while moving most traffic to the cheaper tier.

Question 2

A cascade escalates 45% of documents, and cost per document now exceeds sending all to the larger model. What does this show?

Show answer

Answer: D. Every escalated item pays twice; at high escalation rates, the direct route is cheaper.

Question 3

Requests that share a 20,000-token cached prompt arrive every 8 minutes, and the hit rate is 15%. What is likely to help?

Show answer

Answer: C. The gap between requests exceeds the default lifetime; the longer one keeps entries alive, at a higher write price.

Apply it: Cut Cobalt's summary-service cost

Exercise · about 30 minCase: Cobalt Health Network

Cobalt's visit-summary service is 62% of a $58,000 monthly bill. Each of 140,000 monthly visits sends a 12,000-token transcript plus a 4,000-token system prompt and template (not cached) to a Tier L model and gets 2,000 output tokens back. Summaries are needed by the next morning. Evaluation shows a Tier M model meets the quality floor on 85% of visit types (routine visits), identified by visit code.

  1. Compute the current cost per visit using the case's assumed prices.
  2. Propose changes and estimate the new cost per visit for routine visits.
  3. Check each change against a constraint that could rule it out.
  4. Say how you will know the savings are real.
Check your work
Show model answer

1. Current cost per visit (Tier L). Input 16,000 tokens x $15 per million = $0.24; output 2,000 x $75 per million = $0.15; total about $0.39. 140,000 visits is about $54,600 a month at list prices (the bill reflects some mix already).

2. Changes (routine visits, 85%).

  • Route by visit code to Tier M: input 16,000 x $3/M = $0.048; output 2,000 x $15/M = $0.03.
  • Batch processing (results by morning): 50% off, so about $0.039.
  • Caching the 4,000-token prefix matters little in batch at these sizes; skip it.

Routine visits fall from $0.39 to about $0.04 each; non-routine visits stay on Tier L, batched: about $0.195.

3. Constraints. Batch: summaries are needed next morning, not in minutes, so it fits. Routing: allowed only for the 85% of visit codes where evaluation shows Tier M meets the floor; the rest stay on Tier L. Data handling: batch and Tier M must be on the covered API surface under the business associate agreement.

4. Proof. Track cost per visit by route from usage data (all token categories), and the clinician correction rate by visit code and model, before and after, for a month. A rise in corrections on routed codes moves them back to Tier L.

Key termsEscalation

Sources