# 29.6 Reading a usage report (/building-ai-workers/model-selection-and-cost/reading-a-usage-report)

---
type: Document
title: "29.6 Reading a usage report"
description: "How to group a week's usage by step, check it against the Console, find the dominant cost and its cache share, and match it to a lever."
status: stable
order: 329.06
ksor:
  owner: team:panaversity
  audience:
    - public
  approval:
    by: process:panaversity
    at: 2026-11-30T10:58:07Z
chapter: '29'
part: III
expert_status: manager
concepts: [ "29.6" ]
last_verified: '2026-11-30'

sources:
  - id: anthropic-cost-and-intelligence
    title: Optimizing for cost and intelligence, Anthropic (verified 2026-11-30)
    resource: https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence
  - id: anthropic-pricing
    title: Pricing, Anthropic (verified 2026-11-30)
    resource: https://platform.claude.com/docs/en/about-claude/pricing
  - id: anthropic-prompt-caching
    title: Prompt caching, Anthropic (verified 2026-11-30)
    resource: https://platform.claude.com/docs/en/build-with-claude/prompt-caching
  - id: anthropic-deprecations
    title: Model deprecations (Anthropic, verified 2026-11-30)
    resource: https://platform.claude.com/docs/en/about-claude/model-deprecations
  - id: anthropic-cache-diagnostics
    title: Cache diagnostics (Anthropic, verified 2026-11-30)
    resource: https://platform.claude.com/docs/en/build-with-claude/cache-diagnostics
  - id: anthropic-usage-cost-api
    title: Usage and Cost Analytics API (Anthropic, beta, verified 2026-11-30)
    resource: https://platform.claude.com/docs/en/manage-claude/usage-cost-analytics-api
  - id: anthropic-sdk-cost-tracking
    title: Track cost and usage, Claude Agent SDK (Anthropic, verified 2026-11-30)
    resource: https://code.claude.com/docs/en/agent-sdk/cost-tracking
generated:
  at: 2026-11-30T10:58:07Z
  by: esl-rewrite/1.2.0+ksor.1
trust_tier: unverified
build_id: sha256:d6ce3f28a2cf8e492a60bae1b426b7cc6466e35e83d70c3b9763db2c55009f4b
dirty: true
ksor_version: 0.0.60
---

**In everyday life.** A family of five shares one electricity bill. The bill says how many units the house used this month. It does not say whether the water heater or the old fridge used the most. So the eldest son writes down how long each appliance ran, and works out its units. When his total matches the bill, he knows which appliance to fix first. And when his mother asks what one hot meal really costs, he can answer, because he wrote the cooker down on its own line. In this section, the bill is the Console, his notebook is the usage log, and the appliance that used the most is the dominant cost.

**What you will learn.** You practice this in Lab 29, Task 1.

- What does Dave's headline divide, and by what?
- How do you know which step each call belongs to?
- How do you check your total against the Console?
- Which step is the dominant cost, and how much of its input came from the cache?
- Which change fits the dominant cost?

**Why it matters.** The bill says what each call cost. Brightline is paid for invoices handled right. A figure that cannot be split by step and by company cannot say where to save, or whether a saving cost Ana anything.

**At work.** Tuesday, May 11, 2027, 9:00 a.m. Dave's forwarded total for the week is open beside his question ([The point](overview.md#the-point)). The Console's rows name models and keys. None of them says "extraction", "morning triage" or "Cedar Ridge".

<!-- OPEN: recorded run. The week's Console total, and every count and dollar figure in this section's story, come from the recorded week (spec, raised point 3f). -->

### What does the headline divide, and by what?

**The week's spend on Brightline's own invoices, divided by the invoices that were handled right.** The number on top is what three model steps spent on Brightline's invoices: the extraction, the morning triage and the month-end review. The number below it counts the distinct new invoices that passed the extraction's three gates ([Chapter 25](../prompts-and-structured-output/overview.md)) and appeared in a posted 7:10 report. "Distinct" means an invoice extracted twice is counted once. This book calls one result that passed its step's checks an **accepted result**. The headline is the **cost per accepted result** of the whole worker.

Under the headline, each model step has a row of its own, because each step's own check decides what it accepted. A step's cost per accepted result is what it spent in the week, divided by the results its check accepted:

| Step | What accepts a result | One accepted result |
| --- | --- | --- |
| The extraction | The three gates: the stop reason, the schema, the values | An invoice that passed all three |
| The morning triage | The check by code of [23.16](../hosted-agents/loops-check-feedback-and-stop.md) | A morning report the check passed |
| The month-end review | Lab 26's check by code ([Lab 26](../context-engineering/lab.md)) | A review the check passed |
| The suite | Nothing. It measures, and does no work for an invoice | None: "n/a" |
| Ana's questions in the portal | Nothing live ([29.3](tiers.md)) | None: "n/a" |

The last two rows still show their spend, so nothing is hidden.

A result stopped at a gate is counted for Ana in the 7:10 report, and never priced ([Why it matters](overview.md#why-it-matters)). So each step's row shows how many results it stopped, beside the dollars.

### How do you know which step each call belongs to?

**Your code writes it down, one line per model call, because the Console cannot.** The Console groups usage by model, workspace or key. Its programmatic form, the Usage and Cost Analytics API, is in beta. It can group by up to five dimensions, such as `model`, `workspace_id`, `api_key_id`, `service_tier` or `speed`.[^anthropic-usage-cost-api] None of them is a step of your worker, or a company in your portal.

So each step's code adds one line to the portal's **usage log**, `usage/week.jsonl`, after every model call. The line names the step, the company, the model and the time. It also copies the response's usage fields ([21.12](../agent-loop-by-hand/tokens-caching-and-what-a-call-costs.md)). Here is the shape of one line, with each count shown as `<n>`:

```text
{"time": "2027-05-03T06:12:40Z", "step": "extraction", "company": "brightline", "invoice": "INV-8340", "request": 1, "model": "claude-sonnet-5-5", "usage": {"input_tokens": <n>, "cache_creation_input_tokens": <n>, "cache_read_input_tokens": <n>, "output_tokens": <n>}}
```

The morning triage and the month-end review run as hosted sessions, so their lines copy the usage the session reports. Then your code prices each line. Each kind of token has its own price. Here are Claude Sonnet 5.5's prices per million tokens. Input costs $2, a five-minute cache write $2.50, a one-hour cache write $4, a cache read $0.10, and output $10.[^anthropic-pricing] `input_tokens` counts only the tokens after the last cache breakpoint, so it is the part paid at the full input price.[^anthropic-prompt-caching] Output includes the model's thinking ([29.2](thinking-and-effort.md)). Prices change, so the log is priced with the prices copied on the day, and the date goes with them.

### How do you check your total against the Console?

**Add up the priced log for the week, compare it with the Console's cost for the same days, and give every difference a name.** The Console's Usage page exports a CSV by API key and model.[^anthropic-deprecations] The analytics API's cost endpoint gives the same in dollars, with an Admin API key.[^anthropic-usage-cost-api] Wait before you compare. The analytics data "typically refreshes within 4 hours" and "can take up to 24 hours". Values can still change until about seven days after the month ends.[^anthropic-usage-cost-api] On Tuesday, the week that ended on Sunday is in.

Three things explain a gap, and each has a place in the report:

- **The lines for Cedar Ridge.** Cedar Ridge Supply's invoices run on the same portal, for a fixed monthly fee ([23.5](../hosted-agents/a-budget-on-every-run.md)). Its calls are in the Console's total and in the log. The log's `company` field sets them apart. They are not a difference, and they are not in Brightline's headline.
- **Hosted-session charges.** 23.5 says some platforms add charges for the time a session spends running. Your log sees tokens only. Any such charge is the named difference.
- **A figure from an SDK.** If a step runs on the Claude Agent SDK, its `total_cost_usd` field is a "client-side estimate", "not authoritative billing data". The SDK works it out from a price table built into it.[^anthropic-sdk-cost-tracking] Log that step's usage fields and price them yourself, as for every other step.

<!-- OPEN: hosted-session charges. The facts read on 30 November 2026 give no figure for a charge on Claude Managed Agents sessions beyond tokens (spec, raised point 10). The triage's cost is its session's reported usage until a page states one. -->

### Which step is the dominant cost, and how much came from the cache?

**The dominant cost is the step with the largest spend in the recorded week. Its cache share says how much of its input was read from the cache.** Which step it is comes from the week, not from a guess. Sort the step rows by spend, and the top row is the one to work on first.

This book's **cache share** is the part of a step's input that was read from the cache. It is `cache_read_input_tokens` divided by the sum of `input_tokens`, the cache writes and `cache_read_input_tokens`. The analytics page gives the fields, but names no such measure, so the division is yours.[^anthropic-usage-cost-api]

Anthropic gives a figure to compare with. Agent loops "read a median 84%" of their input from the cache, and the top tenth read 94% or more. Anthropic adds: "Below about 80%, look for something breaking the cache."[^anthropic-cost-and-intelligence] That figure is for agent loops, where each turn resends a long conversation. Each extraction reads one invoice that no earlier request held, so part of its input can never come from the cache. Read a share under 80% as a reason to look, not as a final answer.

To look, turn on **cache diagnostics**. Send `"diagnostics": {"previous_message_id": null}` on the first request, then the previous response's `id` on the next. The response then says why the cache missed: `model_changed`, `system_changed`, `tools_changed`, `messages_changed`, or that it could not tell. It reports only the earliest place where the two requests differ. Its `cache_missed_input_tokens` is an estimate, "a magnitude indicator rather than a billing number".[^anthropic-cache-diagnostics]

At 9:00 your step rows show the extraction as the largest line, with little of its input read from the cache.

<!-- OPEN: recorded run. The dominant step and its cache share come from the recorded week. The rest of this chapter's story assumes the extraction, as the spec's worked run does. If the recorded week shows another step, 29.7 to 29.9's "At work" lines change with it. -->

### Which change fits the dominant cost?

**Match the kind of spend to the change that can lower it, then check that change the way it can fail.** The usage fields show which kind of spend is large:

| What the step's row shows | The change to try | How it is checked |
| --- | --- | --- |
| Large repeated input, and a low cache share | Cache breakpoints ([29.7](caching-by-how-often-content-changes.md)) | The cache share. The output cannot change |
| Work that nobody waits for | A batch ([29.8](realtime-or-batch.md)) | The deadline. The output cannot change |
| Large output or thinking | Lower effort first ([29.2](thinking-and-effort.md)), then a smaller tier ([29.3](tiers.md)) | The step's suite cases, three trials on each model |

The first two change the price or the timing, and leave the text the model reads alone. The third changes the output, so only the suite can say whether it still passes. Which requirement each change must still meet is the step's binding constraint ([29.4](the-binding-constraint.md)).

One setting looks like a saving and is not one. A lower `max_tokens` only cuts answers off, and the tokens already written are still paid ([29.2](thinking-and-effort.md)). Section [29.9](token-budgets-and-a-saving.md) sets it.

**The operating rule:** tag every model call with its step and company, and check the log's total against the Console. Divide each step's spend by the results its check accepted.

[^anthropic-usage-cost-api]: Usage and Cost Analytics API, Anthropic, read November 30, 2026.
[^anthropic-pricing]: Pricing, Anthropic, read November 30, 2026.
[^anthropic-prompt-caching]: Prompt caching, Anthropic, read November 30, 2026.
[^anthropic-deprecations]: Model deprecations, Anthropic, read November 30, 2026.
[^anthropic-sdk-cost-tracking]: Track cost and usage, Claude Agent SDK, Anthropic, read November 30, 2026.
[^anthropic-cost-and-intelligence]: Optimizing for cost and intelligence, Anthropic, read November 30, 2026.
[^anthropic-cache-diagnostics]: Cache diagnostics, Anthropic, read November 30, 2026.
