Skip to content

agentledger 0.4.0

Choose a tag to compare

@garyleelty garyleelty released this 19 Oct 17:01
· 30 commits to main since this release

Install (no npm account needed)

npm install -g https://github.com/garyleelty/agentledger/releases/download/v0.4.0/agentledger-cli-0.4.0.tgz

Or run it once with npx --package=git+https://github.com/garyleelty/agentledger.git agentledger.

The tarball below is attached by the release workflow using the repo's own token — agentledger-cli is still not on the npm registry, so this is the direct-download path.

What's new since 0.3.0

Three more sources (6 → 9). OpenClaw, pi-agent, and Cherry Studio.

  • OpenClaw and pi-agent are token-identical to ccusage 20.0.34 on the same files. OpenClaw: input 28,319,456 / output 614,261 / cacheRead 2,457,344 — every bucket exact. Getting there required reading its archived <uuid>.jsonl.reset.<ts> and .jsonl.deleted.<ts> siblings, which hold 127 of 959 usage rows and 2.03M input tokens that a bare .jsonl matcher silently drops.
  • Cherry Studio is a lane ccusage has no adapter for, covering June and July sessions no other source reads. It is also the only source that can double-count, because it is a GUI hosting other agents and writes a usage row for requests the hosted agent also logs. That is handled explicitly: 3 of its 32 rows are the same request as a pi-agent row (17,858 tokens), and the agent's own log wins.

Two pricing errors fixed with vendor-consensus evidence, not guesses:

  • glm-4.7:cloud was on the $3/$15 default — 2.08M tokens, $6.46 of pure placeholder. Six LiteLLM vendor rows agree exactly on $0.60/$2.20.
  • deepseek-v4-pro was on the default too. Eleven of LiteLLM's 27 rows agree exactly on $1.32/$3.96, and that is the cluster the bare id itself carries.

The pricing audit now checks 29 of 33 entries, up from 27.

The honest comparison, measured not argued. crosscheck runs both tools against the same logs and diffs every bucket. Token counts agree exactly on all six comparable lanes. Where they differ it is stated: ccusage reports $0.00 for every model in its OpenClaw lane (two are missing from its embedded table), and it excludes reasoning tokens from output where this tool bills them. DSH — 1.59B tokens here, more than every other agent combined — is a source ccusage cannot read at all.

One bug class worth naming: a test that asserted a hardcoded source count of 6 was already stale when the seventh source shipped. It is derived from the code now.

Verifying

npm test                                          # 138 tests
node tools/crosscheck.mjs --ccusage /path/to/ccusage   # vs the incumbent
python3 tools/audit_pricing.py litellm.json             # vs the LiteLLM db

Zero dependencies, Node 22.5+, no network calls of any kind.