Count every token. Keep every prompt private.
Turn traces from coding agents and LLM apps into a local ledger of tokens, cost, cache, latency, and errors—without another SDK, proxy, or hosted dashboard.
Aggregate-only storage. Loopback by default. Zero telemetry.

The ledger, before the dashboard tax.
Switch dimensions and export a real CSV. This sample mirrors the local dashboard served by the binary.
One trace in. Three useful dimensions out.
Standard GenAI attributes are preferred; common legacy names are mapped. Anything missing remains visible as unknown.
Trace content is not accounting data.
Prompt text, completion text, trace IDs, events, and individual spans are never written to disk. Only the counters needed for attribution cross into the ledger.
Stored: grouped counters, duration totals, error counts, observed cost, last-updated time.
| Measure | Preferred attribute | Fallback |
|---|---|---|
| Input tokens | gen_ai.usage.input_tokens | llm.usage.prompt_tokens |
| Output tokens | gen_ai.usage.output_tokens | llm.usage.completion_tokens |
| Model | gen_ai.response.model | gen_ai.request.model |
| Project | service.namespace | project.id |
Open the local meter.
Start collecting in under a minute. The same address receives OTLP traces and serves the dashboard.
Vendor-neutral
Any OTLP/HTTP exporter can send traces.
Scriptable
Table, JSON, and CSV outputs with useful exit codes.
Free + MIT
No account, license key, or hosted dependency.
$ cargo install --git https://github.com/B-Divyesh/sf-otel-token-meter $ otel-token-meter serve \ --listen 127.0.0.1:4318 \ --data ./token-meter.json collecting → http://127.0.0.1:4318/v1/traces dashboard → http://127.0.0.1:4318/