Skip to content
Code Recycle

Component · for humans & their agents

True Token Ledger

verified · first-partyactively maintained$0 during beta (was $9)

Your cost dashboard multiplies tokens by a rate. Your invoice charges for billing events. On a cache-heavy workload those are different numbers.

by Code Recycle

Get it free — beta

Every claim on this page is refundable if it is untrue — refund policy.

Verified: 48 tests · 7/7 mutations caught

A token counter counts tokens. An invoice charges for billing events. Anthropic prices a 5-minute cache write at 1.25x base input, a 1-HOUR cache write at 2x, and a cache read at 0.1x -- so a dashboard that multiplies a raw count by a base rate is wrong in both directions at once, and it never throws. It looks entirely healthy until the invoice arrives.

A token counter counts tokens. An invoice charges for billing events. Anthropic prices a 5-minute cache write at 1.25x base input, a 1-HOUR cache write at 2x, and a cache read at 0.1x -- so a dashboard that multiplies a raw count by a base rate is wrong in both directions at once, and it never throws. It looks entirely healthy until the invoice arrives.

THE SECOND TRAP IS WORSE BECAUSE IT LOOKS LIKE ARITHMETIC. input_tokens EXCLUDES tokens read from or written to the cache -- documented as "input tokens which were not read from or used to create a cache". The real total is cache_read + cache_creation + input. Code that adds the cache fields to a total it believes already includes them double-counts; code that reads input_tokens alone under-counts enormously on exactly the workloads where caching matters. Both produce a plausible number.

THE 1-HOUR TIER IS THE ONE EVERYONE MISSES. This listing was specced with a single 1.25x multiplier. Checking Anthropic’s documentation before encoding it surfaced the second tier; building to the spec as written would have under-reported 1-hour writes by 37.5% -- the exact silent under-reporting the product exists to detect.

IT REFUSES TO PRICE A MODEL IT DOES NOT KNOW, throwing rather than returning zero. Zero would make an unpriced model look free: the same silent under-reporting, introduced by the tool meant to catch it.

MONEY IS INTEGER PICODOLLARS IN BIGINT. A ledger accumulates, and float drift compounds until a reconciliation fails by an amount nobody can explain -- indistinguishable from the bug you bought this to find. At $0.15 per million tokens a 1.25x write is 187,500 picodollars per token; in nanodollars that is 187.5, truncated on every call.

Ships naiveEstimate() alongside, reproducing the tokens-times-base-rate bug faithfully. The gap between the two is the evidence you check against your own invoice.

DELIVERY: signed download of a hash-verified tarball, immediately on purchase. Permissive licence: unlimited products, unlimited clients, unlimited seats, no attribution, perpetual and irrevocable. One restriction, do not republish the source as source.

Interface

What you call, and what comes back. Types and signatures only — the implementation ships with the source.

  export function costOf(model: string, usage: UsageBlock): CostBreakdown;
  export function naiveEstimate(model: string, usage: UsageBlock): bigint;
  export function perMillionToPico(usdPerMillion: number): bigint;
  export function priceFor(model: string): ModelPrice | null;
  export function picoToUsd(pico: bigint, decimals = 6): string;

01Capabilities

Does

  • + LLM cost accounting

Doesn’t

  • No exclusions declared

02Requirements & stack

Depends on

No declared dependencies

Credentials needed

None declared

Stack

typescript

03Community

No endorsements yet

No verified confirmations yet — be the first.

Confirmations come from verified purchasers, installers, vetted reviewers, or an installation outcome your org reported through the agent tools. They grade quality — security is verified separately, and community votes can never override the security gate.

Open an issue

Sign in to confirm — weight comes from verified usage, not vote count.

0 open · 0 answered · 0 fixed · 1 said it worked

04Trust Passport

Full passport →
–/100

0/0 automated components pass. An automated score is never a security guarantee.

✓ Verified · first-partyreviewed Sep 20, 2026 · re-verification due Dec 19, 2026
  • publisher identity Publisher status verified; 1 verification(s) on file
  • malicious pattern scan No known malicious-behavior patterns across 10 source file(s) plus listing text
  • capability contract All 0 observed capability reference(s) match the declared manifest
  • agent safety scan No injection patterns in agent-readable content
  • provenance No release signature or provenance attestation
  • behavioral sandbox Not performed in this environment — requires the production isolated runner (docs/sandbox-requirements.md). No untrusted code is ever executed on the application host.

Every listing must pass this review before it can be sold, and it is re-run on every release. Verification describes what we checked — it is not a guarantee that the software is safe.

VersionChannelReleasedNotes
1.0.0stableAug 4, 2026First public release.