Usage-based billing on a single Cloudflare stack
Usage drips in. It lands on a tab. The period closes — and settles.
Record events, generate invoices, collect payments — without running a separate database. Cloudflare Workers + D1 + Durable Objects.
Four moves. Each one idempotent.
Drip in, accrue, close, settle. The same loop for usage-based and flat-fee — on the same plan.
Events drip in
Your backend sends usage events with a transaction ID. Driptab deduplicates and aggregates in real time via Durable Objects.
They land on the tab
The SubscriptionMeter keeps a running tally per subscription, per metric. Counters are durable — survive worker restarts.
The period closes
An alarm fires at period_end. Counters roll up into fee line items; an invoice is written to D1 atomically.
And settles
Pricing is snapshotted into every fee row. A webhook fires. You collect payment. The tab is clean.
The brand, alive
Everything billing needs. Nothing it doesn't.
Usage-based and flat-fee
Mix standard (per-unit) and flat-fee charges on the same plan. Both models in one billing cycle.
Safe to retry
Every event carries a transaction_id. Every API mutation is idempotent. Retry freely — no double-billing.
Catalog-driven pricing
Define prices once in driptab.yaml. Plans reference catalog items — update a price, all future invoices pick it up.
driptab.yaml sync
Commit your billing config. dtab sync upserts plans, metrics, and catalog atomically with a single command.
Full audit trail
billing_events logs every mutation. audit_logs records every API request. Immutable, queryable via the API.
Agent-ready API
Readonly tokens let AI agents query billing state over MCP. Write tokens are separate — safe by default.
Start free. Scale on events, invoices, and customers.
Core billing correctness is never an upsell. Higher tiers raise operating limits, retention, exports, and support.
Open Source
Self-host on your Cloudflare account
- Worker + D1 + Durable Objects
- REST API and dtab CLI
- No hosted SLA
Free
For evaluation and small projects
- 25k events / month
- 50 active customers
- 100 invoices / month
Starter
For first production billing
- 1M events / month
- 1k active customers
- 2.5k invoices / month
Pro
For growing SaaS teams
- 25M events / month
- 10k active customers
- 180-day audit retention
Scale
For usage-heavy products
- 250M events / month
- 100k active customers
- Scheduled exports
Enterprise
For dedicated, BYOC, or regulated use
- Custom limits
- SSO/SAML and SLA
- BYOC or dedicated deployment