Billing

Payments, the credit ledger, and how Tokener.ai reconciles gateway budgets.

Updated 2026-07-13
Edit on GitHub

Billing has three layers:

  1. Payments — card checkout through Stripe
  2. Ledger — append-only credit grants and usage debits
  3. Gateway budget — enforcement synced from the ledger

Payments

Successful payment creates a durable payment record. Credits are granted only after webhook processing — never on the browser redirect alone.

Ledger

Every credit grant and usage debit is an append-only fact. Balance projections power the console; request paths do not scan the full ledger.

Reconciliation

Jobs keep the gateway budget aligned with the ledger. When they diverge briefly, reconciliation closes the gap. The ledger remains authoritative for billing state.