Skip to main content
Credits in Tanso are a standalone wallet subsystem, linked to subscriptions — not welded into pricing rules. That keeps two questions separate: what does usage cost (pricing rules) and what balance pays for it (credit pools).

The pieces

Pools link to subscriptions with a draw priority and optional draw limit, so multiple pools can back one subscription and drain in a defined order.

How deduction works

When an event arrives for a feature backed by a credit model, credits are deducted synchronously at ingestion — FIFO across grants, respecting draw priority. The deduction is stamped into the event’s context, and credit-covered usage is excluded from Stripe meter forwarding so it isn’t billed twice. If a pool has hardLimit: true and the balance can’t cover the event, the event is rejected at ingestion — real-time enforcement, not an invoice surprise.

Reading balances (Client API)

Pool and grant management (creating models, granting credits, reversing transactions) lives on the admin API and the MCP server’s admin tools.

Design notes worth knowing

  • Deduction assumes 1:1 between usage units and the credit denomination.
  • Expiry is a scheduled job (CreditExpirationJob) — expired grants move their remainder to the pool’s total_expired, visible in the ledger.
  • Plan-included credits are granted on subscription cycle rollover and clawed back on cancellation; upgrades grant the delta.