Skip to main content
PARIXDocs

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

  1. A request enters your application with an organization, workspace, or API key identity.
  2. Your application checks quota state and writes the usage event to the ledger path that backs billing.
  3. Parix stores the durable event trail used for reconciliation and downstream billing jobs.
  4. 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:

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:

ProviderPX-5PX-10PX-20PX-40PX-80PX-160
GCP$85$160$210$600$1210$2420
AWSregion-awareregion-awareregion-awareregion-awareregion-awareregion-aware

Current sizing policy:

  • PX-5: 1 vCPU / 4 GiB and treated as development-only
  • PX-10: 2 vCPU / 8 GiB
  • PX-20: 2 vCPU / 16 GiB
  • PX-40: 2 vCPU / 32 GiB
  • PX-80: 2 vCPU / 64 GiB
  • PX-160: 2 vCPU / 128 GiB

Practical deployment guidance:

  • If you need a portable production default, start at PX-10 or PX-20.
  • Memory-heavy tiers above PX-20 are 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