
tokenomics
One ledger for what your AI coding tools spend.
What it is
tokenomics collects usage from AI coding tools and puts it in one record, so spend from different tools lands in one report. From that record it can print a spend report, and a FinOps view that shows what routing work to free models saved.
- Each usage record keeps the time, provider, model, tokens in and out, and cost. Optional tags can say who made the call, the task, the tier and how much came from cache.
- It works as a small core plus an adapter for each tool, so a new tool needs only a new adapter.
- The adapters for Goose, Hermes, osrun and freebuff only read the tool's own files. They do not change the tool.
Tools it reads
- zoder writes the same record as it runs. See zoder.
- OpenClaw through a ClawHub plugin, which listens to OpenClaw's usage events.
- Goose, from its local session database, using the cost Goose already records.
- Hermes, from its local state database.
- osrun and freebuff, from their local files. The freebuff record shape is a draft.
How cost is worked out
The cost the tool reports comes first. If it reports none, tokenomics estimates it from a price list. If there is no price, the cost is zero: it never invents a number.
Tools billed by a flat subscription, or reached through a login instead of a pay-per-use key, report zero per token. They show as free even though a fixed fee sits behind them. The project lists subscription-aware costs as work in progress.
Install and use
pip install ncz-tokenomicsThe package is on PyPI as ncz-tokenomics. The command is tokenomics. Examples from the README:
tokenomics ingest --host goose --ledger ledger.jsonl
tokenomics report --ledger ledger.jsonl --days 30
tokenomics finops --ledger ledger.jsonl --days 30Repositories
- tokenomics on GitLab (home)
- tokenomics on GitHub (mirror)
- ncz-tokenomics on PyPI
Licensing
Apache-2.0, as detected by GitHub.