Lab notebook · chapter 4 of 7 · page 2 of 4

LLM agents continued

What the API actually costs

Measured prompt: 1,559 input tokens for the 112-name table. Output is the unknown — thinking bills as output and cannot be predicted from the prompt, so AnthropicClient.usage() records it and turns the estimate into a measurement after the first real call. Watch output_per_input: above ~2, thinking dominates the bill and effort is the lever.

Measured, 2026-09-08, one real call at effort=medium: 4,383 input and 1,108 output tokens, $0.0496 per call. That makes a full nine-year backtest $22.92 and a year of weekly running $2.48.

Two corrections to the estimates that preceded it. Input was 2.8x higher than a chars/4 heuristic predicted — the schema is billed too, and a dense numeric table tokenises badly. Output landed at the low end, so output_per_input is 0.25: thinking does not dominate this call, and effort is therefore not the cost lever it would be on a harder task. The two errors happened to cancel.

Running it is nearly free. Scout rebalances weekly — 50 calls a year:

cadence calls/yr @1k out @2k out @4k out
weekly (Scout today) 50 $1.64 $2.89 $5.39
daily 252 $8.26 $14.56 $27.16
three agents mixed 352 — $20.34 —

Developing it is where the money goes. One full nine-year backtest is 462 calls ≈ $27. The cache keys on system + user + schema, so any prompt edit re-pays the whole thing:

iterations on full history on a 1-year window
5 $134 $14
15 $401 $43
30 $801 $87

Iterate on a one-year window, then run full history once the prompt is settled. That single habit is worth ~90% of the development bill. CallBudget enforces the ceiling in code.