Ballmac UI home

Run Ledger

New

What an agent run cost, step by step: sortable time, tokens and money with each row's share, a total, the most expensive step marked, and an optional budget meter that warns in words.

v1.0.0Updated Oct 24, 2026Ships with a test
What changed

Run ledger

6 steps, 3 min 27 s, 175.3k tokens

$1.97/ $3.00$1.03 left in the budget

Run ledger
CoderModelMost expensive1 min 32 s101.3k$1.2865%
ResearcherModel38.4 s45.2k$0.423121%
ReviewerModel17.3 s21.5k$0.198710%
PlannerModel14.2 s7,300$0.06123%
Run the testsTool41.6 s—$0.0121%
Search the repoTool3.8 s—$0.000%
Total3 min 27 s175.3k$1.97

Installation

$ pnpm dlx shadcn@latest add @ballmac/run-ledger

Usage

import { RunLedger, formatDuration } from "@/components/ballmac/run-ledger"

The full example is in the Code tab above.

Examples

Over budget

Migration run

3 steps, 6 min 52 s, 429.6k tokens

$4.77/ $4.00Over budget by $0.77

Migration run
Rewrite 38 call sitesModelMost expensive3 min 53 s254k$2.9161%
Fix the type errorsModel1 min 58 s114.5k$1.1223%
Draft the migrationModel1 min 1 s61.1k$0.7416%
Total6 min 52 s429.6k$4.77

API reference

PropTypeDefault
rows*

One row per step, agent or tool.

LedgerRow[]—
budget

Spending limit for the run, in the same currency. Adds a budget bar with a warning.

number—
warnAt

Percent of the budget at which the warning starts.

number80
currency

ISO currency code.

string"USD"
locale

Locale for money. Fixed by default so the server and browser agree.

string"en-US"
title

Heading.

string—
defaultSort

Which column is sorted first.

SortKey"cost"

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
TabReaches each column's sort button
Enter / SpaceSorts by the column, then reverses; aria-sort says which way
Screen readersA real table with a caption, row headers and a total row; the budget is a meter with a value such as '$4.20 of $5.00. 80 cents left in the budget.'
ColourThe warning and over-budget states add an icon and words; the top cost row says 'Most expensive'

Use with AI

rows is [{ id, label, kind?, tokensIn?, tokensOut?, ms, cost }] with cost as a number in currency (default USD). Optional budget (same currency), warnAt (80), locale (en-US), defaultSort. Columns sort by label, time, tokens or cost; totals are computed. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Run Ledger (@ballmac/run-ledger) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Showing where an agent run's time and money went
  • A cost breakdown people check before approving a repeat run

Not for

  • Plan quotas and billing limits; use usage-meter
  • The context window; use token-meter
  • A general data table; use data-table

Registry JSON: https://ui.ballmac.com/r/run-ledger.json

Credits

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.