Skip to main content
Credit Pools are named buckets of consumable resources tied to a plan. They let you model metered features — AI tokens, SMS messages, API calls, rendered PDFs — with automatic refill, rollover, and hard/soft limit behaviour.

Credit Pool Fields

Credit Sources

A tenant’s balance in a pool comes from two sources:

The Ledger

Credits are tracked in a double-entry ledger table (tenant_credit_ledger). Each entry records:
  • qty_granted — credits issued at the time of grant
  • qty_remaining — credits not yet consumed (decremented on usage)
  • source_typebase or addon
  • expires_at — when these credits expire
When a tenant consumes a resource, Crovver deducts from the oldest non-expired grant first (FIFO within each pool).

Checking Balance

Balances are scoped to one subscription. For multi-product orgs — where a tenant holds one active subscription per product — pass productSlug to select the product’s subscription; otherwise the most recently created active subscription is used.

Recording Consumption

Call credits/consume from your backend whenever a tenant consumes a credit. Every call requires an idempotencyKey — passing the same key twice returns the original result without double-deducting. It accepts the same optional productSlug scoping as the balance endpoint.

Hard vs Soft Limits

Use check-usage-limit to gate actions before consuming:

Rollover Example

A plan with ai_tokens: 1000/month, refill_behavior: rollover, rollover_cap: 500: