AI Usage Billing
A reference use case for token-metered products that need hard quota enforcement and a durable billing ledger.
AI usage billing is one of the clearest fits for Parix.
The current product contract already targets AI teams that need real-time quota enforcement and a durable usage ledger without running TigerBeetle themselves.
Where this pattern fits
Use this shape when you need to:
- meter requests, tokens, credits, or model usage as ledger events
- reject over-limit traffic deterministically instead of reconciling later
- retain billable usage history for invoicing and support workflows
- separate customer-facing product logic from the underlying ledger infrastructure
Typical flow
- A request enters your application with an organization, workspace, or API key identity.
- Your application checks quota state and writes the usage event to the ledger path that backs billing.
- Parix stores the durable event trail used for reconciliation and downstream billing jobs.
- Aggregation jobs convert raw usage into priced line items and invoice-ready totals.
What the repo already supports
The repository already contains the pieces for an hourly usage-billing flow:
- D1 usage tables for bucketed usage and priced ledger events
- queue-backed aggregation for profile-hour billing windows
- cron-driven retry and backfill behavior
- Stripe billing setup and invoice generation workflows
For operational detail, see the existing runbooks:
docs/references/runbooks/usage-billing-ledger-runbook.mddocs/references/runbooks/stripe-usage-billing-deploy-runbook.md
Current managed cluster pricing reference
The current catalog and billing-rate source of truth lives in the canonical product spec:
Current active single-replica cluster floors:
| Provider | PX-5 | PX-10 | PX-20 | PX-40 | PX-80 | PX-160 |
|---|---|---|---|---|---|---|
| GCP | $85 | $160 | $210 | $600 | $1210 | $2420 |
| AWS | region-aware | region-aware | region-aware | region-aware | region-aware | region-aware |
Current sizing policy:
PX-5:1 vCPU / 4 GiBand treated as development-onlyPX-10:2 vCPU / 8 GiBPX-20:2 vCPU / 16 GiBPX-40:2 vCPU / 32 GiBPX-80:2 vCPU / 64 GiBPX-160:2 vCPU / 128 GiB
Practical deployment guidance:
- If you need a portable production default, start at
PX-10orPX-20. - Memory-heavy tiers above
PX-20are now available on both GCP and AWS, but the quoted monthly price depends on the selected region and storage backend. - The usage-ledger invoice path is seeded separately from the catalog and carries provider-scoped markup through
billing_rate.
Why TigerBeetle helps here
This pattern benefits from strong ordering and durable writes under contention:
- quota checks and ledger writes need clear failure semantics
- burst traffic cannot tolerate race conditions around remaining balance
- reconciliation should be driven from append-only facts, not reconstructed state