Swarmz

The credit model

How a tenant's credits work — free daily credits, the monthly grant, top-ups, and rollover — and exactly when each one is billed to your platform account.

Every AI build a tenant runs spends credits. As the reseller you decide how many credits each tenant gets and when, through entitlements (or a named plan). This page explains the four credit pools, when each one is billed to your platform account, and which endpoint touches which.

The four pools

Each tenant's standing balance is made of four distinct pools. You can read them live in the balances block of usage.

Prop

Type

When each pool is billed

The principle: you are billed when a credit is committed to a tenant, except for free daily credits, which you are billed for only as they are consumed.

PoolBilledCappedNotes
Free dailyOn consumecredits_per_day per dayOnly the credits the tenant actually spends are charged. Unused daily allowance is never billed.
MonthlyOn assignmonthly_credit_capCharged in full when the grant lands at the start of a cycle.
Top-upOn assignCharged when added via topup.
RolloverNever (already charged)derived from rollover_monthsUnused monthly credits carried forward; re-charging would double-bill.

Monthly and top-up credits are billed when granted, not when used

Free daily credits are pay-as-you-go. Monthly and top-up credits are pay-on-grant: once you assign them to a tenant they are billed to your platform account regardless of whether the tenant spends them. Size the monthly grant to match what you actually charge the customer.

Spend order

When a tenant runs a build, credits are drawn in this order:

  1. Free daily credits — up to that day's credits_per_day allowance.
  2. Monthly credits (the current grant, then any rollover from prior cycles).
  3. Top-up credits.

So a tenant only dips into the paid pools after exhausting the free daily allowance.

How each endpoint touches credits

EndpointEffect on credits
createProvisions the tenant with its initial entitlements (or a plan_code). The monthly grant is set up here; the first grant lands per the plan.
planChanges the caps. With a plan_code it rewrites the credit knobs (monthly_credits, credits_per_day, rollover_months, …) from the named plan. With raw entitlements it replaces only the keys you send. A plan change does not itself re-grant — the new monthly size takes effect at the next refresh.
plan-refreshThe cycle boundary. Rolls unused monthly credits forward per rollover_months, resets the monthly grant to monthly_credits, and resets the daily/monthly free-credit counters. This is when the next monthly grant is billed. Idempotent per (tenant, cycle_anchor).
topupAdds purchased top-up credits to the tenant (billed on assign). Idempotent on idempotency_key.

Read live balances from usage

The current size, used, and remaining figures for every pool — plus rollover expiry and the live caps — are returned in the balances block of usage. Treat balances: null as "unavailable", not "zero".

See also

  • Entitlements — the per-tenant caps that define the pools.
  • platform-plans — your named plans, addressable by plan_code.
  • Data model — why the bill always meters to your platform account.

On this page