Usage-based billing · keep every cent

Turn usage into revenue you can trust

Every API call, seat and gigabyte becomes revenue you can count on — metered accurately, priced to the cent and reconciled to the penny, from your first customer to your millionth. And you keep all of it: no revenue cut, no platform to rent, no billing team to hire.

Get started$ npm i @quxkit/billing-kit
Apache-2.0
billing-kit crystal
0
rounding errors in your totals — the numbers your customers see are always right
10⁹
events it bills without breaking a sweat — growth never becomes a billing rewrite
0+
currencies billed correctly out of the box — sell anywhere, get paid right
payment providers you can move to without a rewrite — you’re never locked in
What it is

One library, whole — not a platform you rent

Never lose a cent

Money is exact by construction, so a rounding bug can’t quietly eat your margins. Your books and your customers’ invoices always agree.

Scale without fear

Bill billions of events without ever double-charging someone — even when retries and background workers pile up. Getting bigger stops being a billing risk.

Prove any number

Every charge is recorded so it always balances and can be re-derived years later — the answer ready when finance, an auditor, or a customer asks “why this amount?”

Never locked in

Start on Stripe or Paddle and switch whenever it suits you, with no rewrite. Your billing is never hostage to one vendor’s roadmap or pricing.

Launch billing in an afternoon

Pricing tables, usage meters and checkout drop in with one command and are yours to restyle — no billing team required to go live.

Keep all your revenue

It’s a library you run yourself: no per-transaction cut, no second service to pay for as you grow. The upside stays yours.

By the shape of it

Price it however you dream it up — per call, per seat, per tier. Just never wonder whether the total is right.

always right
50% Debit
50% Credit

Your books balance by construction — so the total is something you can trust, not something you hope is correct.

How it works

Three moves, in order

01
Capture the usage

Record what each customer actually does — every call, seat or gigabyte — without retries or duplicates ever inflating the bill.

02
Price it your way

Turn that usage into a bill with tiers, overage, trials and proration — exact to the cent, in every currency you sell in.

03
Get paid, then reconcile

Settle through your provider and close the period knowing every number ties out to the penny.

billing-kit.ts
import { meter, price, post, accrual } from 'billing-kit';

// idempotent: retries & replays converge, workers never double-bill
await meter(sql, { subject, event: 'api.call', quantity: 1n, key: requestId });

// integer minor units in a bigint — never a float
const amount = price(usage, plan);            // Money, exact for any currency

// append-only, balanced at COMMIT by a deferred constraint
await post(sql, accrual(amount, { debit: 'ar', credit: 'revenue' }));

Price it however you dream it up — per call, per seat, per tier. Just never wonder whether the total is right.

billing-kit

Embed it in the app you already run