TL;DR

  • Over 32 days of detailed telemetry (~4,300 runs), the agent’s burn fell from $61 to $18 per day: the main loop moved from claude-fable-5-1 to glm-5.3-flash, and the strong model stayed on as a consultant.
  • Counterfactual at identical token volumes: the same GLM workload on Fable 5.1 would have cost $1,521 against $109 in fact (−93%); on Opus 5.5 — $748 (−85%).
  • The bill is driven not by volume but by rare events: 94% of prompt tokens are cache reads costing cents, while 53% of the Fable bill is cache writes at $12.50/MTok.
  • The consultant came to 152 calls, 13.6M prompt tokens, and $146 — 10% of the period’s budget.
  • The first calculation overestimated the Claude-era cost by 37% because of double-counted cache writes; the error is dissected in a dedicated section.

Configuration

Atlas is a desktop agent: a Go service with local SQLite and the usual agent loop of model plus tools. It reads and edits files, runs commands, works with git, queries LSP and databases, and delegates tasks to subagents. It has been part of my daily workflow for a long time, and so has its spend telemetry — every completed LLM run writes a row to the local DB with the model and four token counters. On September 20 the subagents got per-run counters; on September 28 every role got them, and the rows acquired a spend source. From that day the tracking is per-line by role:

SourceRoleModel
mainmain loopuser’s choice: fable-5.1 → glm-5.3-flash
subagentdelegated tasksglm-5.3-flash
reviewcommit reviewglm-5.3-flash
consultantstrong model on demandfable-5.1 / opus-5 (logged as help)

Over the telemetry window the agent went through two configurations differing in a single decision: who runs the main loop.

The first, until October 15: main on claude-fable-5-1 / claude-opus-5-5, with subagents and review on glm-5.3-flash. Every turn of the main loop was a turn of the flagship, including the trivial ones. (In the first week, before full tracking, subagents also ran on claude-sonnet-5, claude-opus-5, and GLM-5.3 before moving to flash.)

The second, from October 16: main on glm-5.3-flash. Fable 5.1 and Opus 5 are invoked only as consultant, in three cases: the main agent has rejected its own hypothesis twice; the same check keeps failing after edits; or a design decision is coming up — a DB schema, a public API, a plan decomposition. The consultant sees only the formulated question and the evidence attached to it: the error, the diff, the schema.

This is a split of roles, not a tariff change. The workload stays on the model that costs $0.15/MTok of input; the strong model’s intelligence is bought in ~90K-token portions, only where the cheap model has exhausted its own options. Now the numbers for both configurations.

Data and formula

Every usage_events row carries a source, a model, and four counters: prompt, completion, cache_read, cache_write. The cost of a row:

(p − cr − cw)·input_price + cr·cache_read_price + cw·cache_write_price + c·output_price

where p is prompt_tokens, c is completion, cr is cache_read, cw is cache_write, all divided by 1e6. One detail matters: the provider’s prompt_tokens is an aggregate that already includes cache_read and cache_write, so both are subtracted. The postmortem section covers what happens when you don’t.

List prices, $ per 1M tokens:

ModelInputOutputCache readCache write
claude-fable-5-110500.2512.50
claude-opus-5-54200.205.00
claude-opus-55250.506.25
claude-sonnet-52100.202.50
GLM-5.31.404.400.26no separate rate
glm-5.3-flash0.150.500.03no separate rate

The first row is the key one: the Anthropic flagship’s cache write costs $12.50/MTok — 125% of its own input rate and 417× the cache-read rate of glm-5.3-flash. Practically the entire economics gap between the two configurations follows from this row.

The observation window is Sep 20 – Oct 21. In the first week (Sep 20–27) main and review were not logged anywhere; subagent spend was reconstructed by a migration from the subagents table: 218 runs, 642M prompt tokens, $325. Per-line tracking across all roles starts September 28. For the period: ~4,300 runs, $1,529.

Two configurations

Claude (Sep 28 – Oct 15, 18 days)GLM (Oct 16–21, 6 days)
mainfable-5.1 / opus-5.5glm-5.3-flash
Consultantfable-5.1 / opus-5fable-5.1 / opus-5
Prompt tokens (per usage_events, from Sep 28)5.04B1.47B
Spend$1,095$109
Price per MTok of prompt$0.217$0.074
Rate≈$61/day (≈$1,830/mo)≈$18/day (≈$550/mo)

Daily spend, dollars:

Sep 20: 12.7Sep 21: 65.8Sep 22: 18.7Sep 23: 109.3Sep 24: 15.3Sep 25: 39.8Sep 26: 3.1Sep 27: 60.6
Sep 28: 136.6Sep 29: 53.6Sep 30: 64.4Oct 1: 103.2Oct 2: 118.6Oct 3: 37.9Oct 4: 9.0Oct 5: 49.4
Oct 6: 87.8Oct 7: 57.3Oct 8: 66.6Oct 9: 24.6Oct 10: 21.1Oct 11: 44.9Oct 12: 80.9Oct 13: 68.3
Oct 14: 44.2Oct 15: 26.5Oct 16: 23.7Oct 17: 22.0Oct 18: 18.4Oct 19: 14.9Oct 20: 14.6Oct 21: 15.7

Until October 15 the daily burn swings between $9 and $137; after, it holds in the $15–24 band. The default_model_id change is recorded in settings on October 17; the series breaks on the 16th.

Comparing configurations on absolute numbers is weak: the periods differ and the workload changed. The main conclusions rest on a counterfactual with token volumes held fixed.

Counterfactual

The actual token volumes of every run are priced at a single model’s rates, as if all traffic went through it:

ScenarioSep 20 – Oct 21Savings
Actual (mixed stack)$1,529—
All on Fable 5.1 (fresh input at the input rate)$6,916−78%
All on Fable 5.1 (fresh input billed as cache write, 1.25×)$7,691−80%
All on Opus 5.5$3,298−54%

The most reliable numbers come from the GLM configuration, where volumes were fixed with the scheme unchanged: the same workload on Fable 5.1 would have cost $1,521 against $109 in fact — minus 93%. On Opus 5.5 — $748, minus 85%. These figures do not depend on how the workload shifted between configurations.

The counterfactual assumes token volumes stay the same; on a different model, sessions may behave differently — different context lengths, different turn counts. The order of magnitude of the effect is not explained by this: glm-5.3-flash in the main role consumes the same order of tokens as the subagents of the Claude configuration did.

Bill anatomy

The intuition “you pay for volume” does not survive the data. 94% of the period’s prompt tokens are cache reads. glm-5.3-flash pushed 6.4B prompt tokens over the period (including the first-week backfill), 6.1B of them cache reads at $0.03/MTok, and its entire bill is $245.

The Fable 5.1 bill for the period, broken down by tariff component:

ComponentTokensMoneyShare
Cache write ($12.50/MTok)33M$417.653%
Output ($50/MTok)2.8M$137.517%
Fresh input ($10/MTok)17M$165.221%
Cache read ($0.25/MTok)284M$71.09%
Total$791.3

53% of the flagship’s bill is cache writes — more than all other components combined. The mechanics: every “cold” context the agent assembles from scratch is billed at 1.25× the input rate. Moving main to glm-5.3-flash removed this line entirely: Z.AI has no separate cache-write rate, and it has been zero in telemetry since October 16.

Spend by model over the period:

ModelSpendRole
claude-fable-5-1$791main of the Claude configuration + consultant
glm-5.3-flash$245subagents, review, main from Oct 16
claude-opus-5$211consultant + first-week subagents
claude-opus-5-5$150main of the Claude configuration
claude-sonnet-5$86first-week subagents
GLM-5.3$46subagents before the move to flash

In the Claude window (Sep 28 – Oct 15), Anthropic accounted for 11% of prompt tokens and 81% of the money.

The consultant

The routine work goes to glm-5.3-flash: files, search, edits, tests, diff review. The strong model joins on three triggers: the main agent has rejected its own hypothesis twice; the same check keeps failing after edits; or a design decision is coming up — a DB schema, a public API, a plan decomposition. The consultant receives only the question and the evidence: the error, the diff, the schema.

Over the period: 152 calls, 13.6M prompt tokens, $146 — about 10% of the budget. In the GLM configuration the consultant costs $7.4 per day out of $18.2 total — 41%, comparable to all the agent’s other work combined. Moving the same workload entirely to Fable would have cost $1,521 against $109 — 14 times more.

There is no quality metric for decisions, so the “value” of consultations is not being priced in dollars. The measurable fact: 10% of the budget on the strong model. The observed consequence for day-to-day work: delegating tasks to subagents stopped being a decision about manageable costs, and the strong model stopped being a bottleneck in the main loop.

Postmortem: the costing bug

The first calculation gave the Claude era $1,502 and September 28 $190.27. Both figures went into the draft overstated: the era by 37% (1,502 vs 1,095), the day by 39% (190.27 vs 136.59).

The provider’s prompt_tokens is an aggregate that includes cache_read and cache_write. The correct formula subtracts both:

(p − cr − cw)·input + cr·cache_read + cw·cache_write + c·output

The first calculation subtracted only cache_read: (p − cr)·input + ... + cw·cache_write. Cache-write tokens were billed twice — at $10 as fresh input and at $12.50 as cache write. The error did not show on the GLM configuration: Z.AI reports no separate cache writes, so the term is zero. The bug lived in one branch of the data and was invisible in the “new” numbers.

Localization. The era total ($1,502) did not match the sum of daily figures under the correct formula ($1,095) and did match the sum under the wrong one ($1,501 — within rounding of the daily values from the draft’s $1,502). The decisive check sat at the boundary between sources: September 23, computed from the subagents backfill, matched the correct formula to the cent (109.28); September 28, from usage_events, matched only the wrong one (190.27). The asymmetry pointed at the data branch, not at the tariffs. Under the correct formula: Sep 28 — $136.59, the era — $1,095, the period — $1,529.

The same check exposed a second error: token volumes were computed by adding cache_read on top of prompt_tokens — 9.89B instead of 5.04B for the era. Any “price per MTok” derived from such volumes is understated by half.

For anyone building per-line accounting, this yields two rules: store the components (fresh input, cache_read, cache_write, output) separately rather than as the provider’s single aggregate; and reconcile the aggregate total against the sum of daily figures before publishing. Both checks localized the error within minutes here.

Limitations

  1. Prices are list prices. Traffic through an aggregator (OpenRouter and similar) adds a markup. Z.AI’s promotional rates (valid until Sep 9) were not applied.
  2. The counterfactual rests on unchanged token volumes — see above.
  3. There was no per-line tracking by source before Sep 20; from Sep 20–27 main and review were not logged, and the usage_events table did not exist yet — that week’s subagent runs are stored line by line with full counters in the subagents table and were carried over by a migration. The conclusions cover the period of full tracking.
  4. Z.AI’s cache writes may be billed inside the input rate — in which case the real GLM spend is higher than calculated. The $0.15-vs-$12.50-per-MTok ratio leaves the order of the effect unchanged.
  5. The configuration comparison is not a controlled experiment: the workload changed along with the scheme.
  6. Anthropic cache writes come in 5-minute and 1-hour flavors (the latter at 2× the rate); the telemetry does not distinguish them, so $417.6 for cache writes is a lower bound.
  7. ~205 subagent runs after Sep 28 are recorded in subagents but missing from usage_events; the undercount is a few dollars and shifts the actual and counterfactual figures by roughly the same amount.

Takeaways

  1. Per-line tracking gives what a provider’s billing counter cannot: a 4,300-row table broke the bill down by component and by role and localized a bug in my own costing formula.
  2. Cache is a separate economy, not the “cheap part of the bill.” Cache reads are nearly free at 94% of volume; cache writes at flagships are the largest line item. Agent architecture should minimize cold contexts: reuse the system prompt, avoid reassembling context, keep long sessions on one model.
  3. Routing by complexity is the next step in an agent’s evolution and the biggest lever in its economics: the cheap model gets the volume, the strong model is invoked by triggers. Minus 85–93% on the same work is the result of changing the scheme, not picking a tariff.
  4. The consultant is cheap because its context is small: 13.6M tokens over 152 calls — about 90K each. A strong model’s cost scales with context; a narrow context is how you buy intelligence in bulk.
  5. The scheme scales down in price: as long as the routine stays on the cheap model, the headroom after the switch leaves room to experiment with routing — another subagent, another provider — without recalculating the economics every time.

Telemetry keeps running. By mid-January there will be three months of the pure GLM scheme — enough to see the spend trend across task types, compare against previous months, and watch quality over distance. I’ll write that up separately.