Catalog-building price — 25% off. Code tap to copy

Billing Kit · TypeScript billing kit

AI Usage Billing Kit

Credits that can't double-spend, caps that hold, and margin you can actually see.

⇩ Instant download — yours right after checkout

29% of B2B software companies already bill AI credits and another 33% plan to within a year — while the median AI product targets just 50% gross margin, half what classic SaaS keeps. And the credit layer is where shipped AI apps actually break: webhook retries that double-credit, balance races that go negative, refunds that never happen when a job fails. This kit is that layer done right — a race-safe ledger with reserve-then-finalize burndown, credit packs, hard caps, and the piece Stripe doesn't ship: a per-customer margin cockpit that shows token COGS against revenue before the provider invoice does. Cloudflare Workers-first (D1 + Durable Objects patterns), with a generic Node adapter and a maintained model-price table.

Built for: Developers shipping AI products who must bill credits and usage without losing track of margin

Pick your license

Solo

$79

One developer, unlimited products.

  • The full kit
  • Ledger + caps + margin cockpit
  • Model-price table updates
  • 12 months of updates

One developer's own projects.

Most popular

Team

$149

Your whole team bills with it.

  • Everything in Solo
  • Team-wide license
  • Priority email support

One team, internal and client products.

Agency

$349

Unlimited client work.

  • Everything in Team
  • Unlimited client products
  • Source design files where provided

Unlimited client projects.

14-day money-back guarantee — if the kit doesn't fit your stack, reply to your receipt within 14 days and we refund it in full. Keep nothing, owe nothing.

More from the store

AI Voice Receptionist Kit

Answer every call for your clients — on your own keys, at your own margin.

Agent Eval Harness Kit

The eval layer free runners leave as an exercise — task sets, rubrics & a CI gate that says no.

Signal Foundry — AI Product Studio Kit

The 40 hours before your first prompt — research, architecture, and an app that refuses to make things up.

Questions

What exactly do I get?

An instant download: the full TypeScript kit — the credit ledger (idempotent webhook handling proven against triple redelivery, reserve-then-finalize burndown, clamped refund clawback), credit packs and top-ups with expiry, deny-at-reserve hard caps, the per-customer margin cockpit (a CLI/report generator, not a web UI — we'd rather tell you), Stripe Meters wiring, D1 and Durable Objects adapters with migrations plus a generic Node adapter, a dated model-price table with per-row verification flags, a working Worker example, real docs, and 12 months of updates. npm test runs typecheck plus 90 tests — green at packaging on a clean install.

Why not Stripe's own tools or the free open-source billing projects?

Use them — this kit sits on top of Stripe, not instead of it. Stripe's free SDKs meter tokens and its upcoming Token Billing will sync provider prices; open-source projects cover generic metering. What none of them ship is the operator layer: a ledger hardened against the failure modes practitioners actually report, hard caps that hold, and per-customer margin visibility. That's the part you'd otherwise build and debug yourself.

What does it deliberately not do?

No proration, invoicing or tax; cap windows are UTC-calendar (not rolling); the SQL dialect is SQLite/D1 (a Postgres port is documented, not shipped); the margin cockpit is a report, not a dashboard. And the handful of post-cutoff model-price rows we couldn't verify from primary sources ship flagged 'verify before use' rather than pretending. It's all in the FAQ inside the kit too — fewer surprises, fewer support tickets.

Was this scoped by AI?

Yes — our commercial engine researched it: market surveys, competitor kits and their sales counters, the free alternatives, adverse evidence included, all source-checked. Full honesty: the engine scored this concept below our own demand gate — there was no proof yet that developers pay for this at our price — and the owner shipped it anyway as a bet. What's not a bet is the code: hand-QA'd against the same contract, 90 tests green on a clean-room install at packaging, and the 14-day refund applies if it's not what you needed.

01 / 01

Drag to read · 2880px capture