TokmeterDocsGitHub

Open source · local first v1.15.0

Every AI coding agent,
on one ledger.

Tokmeter reads the session files your agents already write and turns them into token and cost totals by project, model and day. No API keys, no account, no telemetry.

$ npx -y @sriinnu/tokmeter --today

Built-in parsers for 24 agents, plus any you register

How it works

From session file to ledger.

Every agent already keeps a log of what it sent and received. Tokmeter reads those logs where they sit and keeps the totals.

  1. Read

    Each agent's own session files, JSONL or SQLite, straight from disk. Counted once per API response, even when a provider writes a turn across several lines.

    "message": {"id": "msg_01…",
      "model": "claude-sonnet-4-6",
      "usage": {
        "input_tokens": 1840,
        "output_tokens": 312,
        "cache_read_input_tokens": 42210
      }}
  2. Price

    Tokens are priced against a live model catalog, with your pricing-overrides.json on top. Tool-reported costs are kept as reported.

    model        input  output  per M
    sonnet-4-6   $3.00  $15.00
    source       catalog · exact match
  3. Seal

    At midnight the day is sealed into an append-only ledger. A sealed day keeps the prices of its day, even after the raw logs age out.

    10-10  4.21M  $12.40  sealed
    10-11  2.87M   $8.15  sealed
    10-12  1.02M   $2.45  live

Today, at a glance

The same day, in your terminal and your menu bar.

Sample data. The popover is drawn by the app's own views; the table follows the CLI's project table, column for column.

zsh
$ tokmeter --today
┌─────────────┬──────────┬───────┬────────┬───────────┬─────────────┐
│ Project     │ Tokens   │ Cost  │ Models │ Providers │ Active Days │
├─────────────┼──────────┼───────┼────────┼───────────┼─────────────┤
│ sample-web  │ 375.0K   │ $1.40 │ 2      │ 2         │ 1           │
├─────────────┼──────────┼───────┼────────┼───────────┼─────────────┤
│ sample-api  │ 625.0K   │ $1.05 │ 1      │ 1         │ 1           │
└─────────────┴──────────┴───────┴────────┴───────────┴─────────────┘
Sample data
The menu bar popover in the Paper theme with usage details open, showing sample data
Paper theme · sample data

Surfaces

One scan, everywhere you look.

The CLI, the menu bar, your agents and your statusline all read the same numbers from the same local daemon.

The menu bar popover in the Paper theme, showing sample data
PaperA broadsheet, set in serif
The menu bar popover in the Meter theme, showing sample data
MeterA utility meter under glass
The menu bar popover in the Pump theme, showing sample data
PumpA fuel-pump computer
The menu bar popover in the Rams theme, showing sample data
RamsA calculator, colour only where it means something
The menu bar popover in the Deck theme, showing sample data
DeckAn 80s hi-fi display
The menu bar popover in the Passbook theme, showing sample data
PassbookA savings passbook
The menu bar popover in the Terminal theme, showing sample data
TerminalGreen phosphor
The menu bar popover in the Prism theme, showing sample data
PrismLight through glass
The menu bar popover in the Lagoon theme, showing sample data
LagoonDeep water
The menu bar popover in the Carbon theme, showing sample data
CarbonQuiet, dark, dense
The menu bar popover in the Glass theme, showing sample data
GlassNative desktop frost

Numbers you can check

Wrong numbers are worse than no numbers.

Tokmeter shows its work, and says so when a figure is an estimate.

Estimates are labelled

API-rate estimates and costs a tool reported itself are kept apart and named as such. Neither is your subscription bill.

History doesn't move

Only today reprices. A completed day keeps the cost it was sealed with, and a rebuild may grow a sealed day, never shrink it.

Your data stays put

Usage is read and stored on your machine. The only network calls are an optional public price-catalog fetch (--light skips it) and the app's update check.

Every rate has a source

The $/M panel shows each model's input, output and cache prices, and whether they came from your override, an exact or fuzzy catalog match, or nowhere.

How the numbers work

Know what today cost.

Free and open source. Install the CLI in one line, or the menu bar app from GitHub or Homebrew.