Decisions

How the numbers are calculated, what is measured and what is deliberately left out, what is stored about whom — and why it was decided that way. Generated from the backend's decision log.

Calculation

How the numbers in the dashboard come about.

Calculation

Free write tokens are counted

Free write tokens (e.g. OpenAI cache writes) are counted in the dashboard even though they don't directly contribute to cost

Read why →
Calculation

Derivation of CO₂ factors

See README.md.

Read why →
Calculation

Ephemeral cache tokens: store the undifferentiated remainder as its own value; bill it at the 1h rate

Claude usage reports carry both a flat cache_creation_input_tokens total and, optionally, a split into ephemeral_5m_input_tokens / ephemeral_1h_input_tokens. Sometimes the sum falls short of the …

Read why →
Calculation

Cost stored as cents (BIGINT), CO₂ stored as grams (DOUBLE PRECISION)

Costs and CO₂ are estimates, not billing-grade figures — pricing and CO₂ factors are themselves approximations (see decision 3), and the dashboard's purpose is trend visibility, not exact accounting.

Read why →
Calculation

Missing price/CO₂ factor defaults to 0, not a distinct "unknown" state

When a model/day has no matching entry in the price or CO₂ factor table (e.g. a new model was used before its price was added), ClaudeUsageIngestService stores costUsdCent/co2Gram as 0 rather than …

Read why →
Calculation

Cost figures are estimates; per-model and total rounding may differ

This applies only to providers that store cost in nano-precision (see decision 12) — currently OpenCode and Copilot, not Claude. For those providers, the total returned by the all-providers endpoint …

Read why →
Calculation

Per-provider cost precision: whole cents vs. nano-precision

Providers store per-prompt cost at different precisions, and for different reasons — this is not one rule applied three times, it is three separate calls. A shared constraint underlies all three: …

Read why →
Calculation

Copilot's reasoning_tokens are parsed but not added to output tokens; OpenCode's are

Copilot's ingest payload includes a reasoning_tokens field per prompt, but it is intentionally not added into the stored output-token count. OpenCode's equivalent field is added to its output-token …

Read why →
Calculation

Total tokens count input and output only; cache tokens are shown separately

The headline "total tokens" figure — company-wide and per provider — sums input and output tokens. Cache-write and cache-read tokens are excluded from it, but stored and shown separately: in the …

Read why →
Calculation

Copilot cost is approximated at one US cent per AI unit

Copilot cost is computed as 1 US cent per AI unit, from the AI-unit total the Copilot CLI reports per session (stored as NanoAiu, see decision 12).

Read why →

Privacy

What is stored, and what can never be derived from it.

Architecture

How plugins, backend and frontend work together — and which tools are covered.