All articles
LLM Economics

How to Read the True Cost of Your AI Coding Agent

Reconstruct a per-session cost floor from your own agent transcripts, then re-price the same tokens on a cheaper model to see what you could save.

Jul 18, 2026 · 4 min read
How to Read the True Cost of Your AI Coding Agent

Key takeaways

  • AI coding agents spend tokens invisibly: you see the diff, not the token ledger.
  • The open-source tool aireceipts turns local transcripts (Claude Code, Codex, Gemini, OpenCode, Cursor) into itemized, cited cost receipts.
  • The sharpest line is arithmetic: the same tokens re-priced on a cheaper model, 78% lower in one worked example.
  • The figure is an 'observable floor', a lower bound, not an invoice.
  • Before you standardize on a frontier model for every turn, model the swap.

Why is AI agent cost invisible?

You approve the pull request, not the token bill. A coding agent can fire dozens of tool calls, retries, and thinking turns in a single session, and none of it surfaces until the monthly invoice lands. For a founder watching gross margin, that is the wrong moment to find out.

The core problem is attribution. A session mixes models (say an Opus orchestrator with Sonnet or Haiku helpers), cache reads, and tool calls. Without a per-turn breakdown, 'AI cost' stays a single scary number you cannot act on.

What does an itemized agent receipt show?

aireceipts, a new open-source CLI, reconstructs what it calls an observable Standard-API list-price floor from transcripts that never leave your machine. A receipt itemizes spend by tool and turn, for example:

  • Bash: at least $0.0517 (3 calls)
  • Edit: at least $0.0455 (2 calls)
  • TOTAL: at least $0.1764

In that same example, cache served 85% of input tokens, which is exactly the kind of detail that explains why two similar-looking sessions cost very different amounts.

Why the 'cheaper model' line matters most

The receipt ends with a line that is pure arithmetic: the same tokens on a smaller model (claude-haiku-4-5) would floor at about $0.0392, roughly 78% lower. It is not a prediction, and it does not claim the cheaper model would do the job as well. It just answers the question every builder should ask: what am I paying for frontier quality on this exact workload?

That question is a margin question. If most of your agent turns are trivial edits and reads, routing those to a cheaper model can move your cost of goods sold materially, while you keep the expensive model for the turns that need it.

How do you turn a receipt into a pricing decision?

A receipt tells you what one session cost. Your pricing needs the shape across thousands of sessions. The bridge is a simple model: average tokens per session, model mix, cache-hit rate, and a blended price per 1M tokens. Change one input, say route half your turns to a cheaper model, and watch the blended cost per user move.

This is the modeling gap Calcaas is built for: you can simulate model swaps, user tiers, and blended token cost, then check whether your per-seat or usage-based price still clears a healthy margin. A receipt is the ground truth; the model is where you decide what to charge.

Treat the floor as a floor

One discipline worth copying: aireceipts rounds every figure down and labels it a lower bound, because traces omit things like cache writes, discounts, and credits. Your own cost modeling should do the same. Underclaim savings, overclaim cost, and you will never be unpleasantly surprised by a real invoice.

Takeaway: measure the real per-session floor, then model the cheaper-model swap before you standardize your stack. You can build that model in Calcaas in a few minutes.

Frequently asked questions

What is an observable cost floor for an AI agent?

It is a lower-bound estimate of what a session would cost at standard list prices, reconstructed from the transcript. It excludes discounts, credits, and untraceable components, so the real bill is usually at or above it, never below.

Can I compare AI models on the same workload?

Yes. Because the token counts are fixed by the transcript, you can re-price identical tokens on a cheaper model. That is arithmetic, not a benchmark, so it shows cost difference, not quality difference.

How much can routing to a cheaper model save?

It depends on your turn mix, but the gap is often large: one worked example showed a 78% lower floor on a cheaper model for the same tokens. Model your own mix before assuming the average applies.

Does this replace my provider invoice?

No. A receipt is an estimate for visibility and planning. Use it to spot waste and model pricing, then reconcile against the provider's actual invoice. Place this JSON-LD in a `<script type="application/ld+json">` tag in the page head. The questions and answers match the visible FAQ above.

ShareXLinkedInFacebook

More from the blog

The Margin Memo

Pricing math, in your inbox.

One short note a week on AI pricing, token economics, and margin. No spam, unsubscribe anytime.