AI cost dashboard
The Cost dashboard in the AI Cockpit shows what your AI is actually spending — broken out per agent, per turn, and per round.
What's on the screen
Per-day spend strip
A horizontal strip of the last 14 days, each bar colored by agent. Tap a day to drill in.
Per-agent table
For the selected day:
| Column | What it means |
|---|---|
| Agent | accounting / messaging / operations / knowledge / property / general / pulse-copilot |
| Turns | How many user → AI turns ran |
| Avg $/turn | Mean cost per turn |
| Total $ | Sum for the day |
| Avg cache hit % | How often prompt caching reduced cost |
A high $/turn on accounting (e.g. > $4) usually means the agent ran many rounds, the prompt didn't cache well, or a non-trivial chunk of work was retried.
Turn drill-down (gh#414)
Tap a row to expand into per-turn rows. Each turn shows:
- The operator's prompt (first 80 chars)
- Total cost for the turn
- Rounds breakdown —
accounting_round_1,accounting_round_2, … each row showing the model, input tokens, output tokens, cache hits, cost - Per-round scope: which tools were called, with success/failure
This is the surface that gh#414 introduces. Earlier the dashboard showed bare accounting_round_N rows with no context — now each round has its operator prompt + per-round tool scope.
Common patterns to look for
- Cache-write churn — repeated rounds with low cache hit % means the agent rebuilt its system prompt each round. The Sub-Agent registry caches by
(agentName, version); if you edit the prompt mid-day, the cache invalidates and you'll see the % drop. - Long tool loops — if
accounting_round_12keeps showing up, the agent is hitting itsmaxToolRoundscap. Either lower it (cheaper but answers may be incomplete) or raise it (better answers, more cost). - Wrong-model selection — if Haiku is doing OK on invoice math (rare), the dropdown lets you A/B; if Opus is over-spending on simple lookups, swap to Sonnet on the offending agent.
Export
There's a CSV export button at the top right for finance review — downloads the selected date range's per-day per-agent totals.
Implements: gh#414 (turn-grouped drill-down via metadata enrichment). Related: gh#412 (cost analysis + 6 cost-reduction options), gh#415 (Agents editor where you change the dials this dashboard measures).