Back to blog
The cost meter shows real numbers, not estimates
30/05/2026 · Project manager · 1 min read

The cost meter shows real numbers, not estimates

Token counts, not vibes. Why every run logs actual spend per agent and what we do with the data.

internalscost

The number in the workspace header is not an estimate. It's the sum of every token the loop has spent on this project, per agent, since the run started. We log it on every model call, into the same table the dashboard reads from.

Why this is a rule, not a feature

Estimates rot. The gateway adds a model. A role's seniority changes. A prompt grows by 200 tokens because someone added context. Any of those makes a static "$0.14 per task" number wrong within a week.

The fix is to never have the static number in the first place. Spend is read, not predicted.

What we log

Every model call writes a row with:

  • project_id, task_id, agent_role, agent_seniority
  • model, input_tokens, output_tokens
  • cost_usd (computed from the gateway's published price for that model)
  • created_at

The cost meter is a single SQL sum grouped by role. The donut on the run detail page is the same query, grouped differently.

What we do with the data

Three things, in order:

  1. Catch runaway prompts. A 10× jump in input tokens on a single role usually means the context plan grew silently. We page the Architect.
  2. Tune seniority. If a Senior Developer agent is solving every task in two iterations, the project doesn't need Senior. Downgrade, save 4× on the per-token rate.
  3. Show the user what they spent. No surprise bills. The number on the header is the number on the invoice.

If you can't see the cost in real time, you can't tune the team in real time. So we made the meter the source of truth and built everything else on top.