Core concepts

Subscriptions and overage

What a paid bundle mints each period, and what happens when it runs out.

A bundle with a price is a subscription. What the end user gets for that price is a grant: an amount minted into their balance, either every period or once. Two customers on the same bundle get the same grant on the same schedule.

Attach a recurring grant to a bundle

Allotments live on the bundle. Wallet top-ups (seams users grant) are separate, always micros, never a named-credit unit. A bundle can carry several includes in its one named currency; other bundles can share that currency or use their own. See Credit systems.

seams bundles include pro monthly-credits \
  --name "Monthly credits" --unit credits --amount 30M

# SLUG              DISPLAY NAME      UNIT       AMOUNT  THEN ON DEMAND  RECURRING
# monthly-credits   Monthly credits   credits  30000000           false       true
FlagMeans
--unit credits · --unit microsGrant your own credits, or grant money
--amountHow much, 30M credits or an amount in dollars
--priceWhat this grant sells for, when it is sold separately
--then-on-demandAllow overage once this grant is gone
--no-recurringMint it once at sign-up rather than every period

The order money is spent in

A call draws on the first grant that can cover it, then on-demand if you allowed it. Nothing falls through to on-demand by accident, because the last step has to be turned on.

text
monthly-tokens  30M tokens   spent
   └─ topup-credit  $4.20 left    spent
        └─ then on-demand         only if --then-on-demand

Turn overage on for one customer

On-demand is per end user, with its own ceiling, so agreeing to overage with one customer is not a change to your bundle.

seams portal on-demand alice --enable --limit 25
seams portal spending alice

Grant money instead of overage

To simply add money rather than allow overage, grant it. A grant lands in the balance immediately and is spent before any overage would be. The CLI takes dollars; the SDKs take micro-dollars.

seams users grant 25.00 --user alice --reason top_up

When it runs out

The call is refused with a 402 before it reaches a provider, and the code says which ceiling stopped it. A stream already running is aborted mid-answer rather than finishing on money the customer does not have.

CodeMeans
insufficient_creditAvailable balance would not cover the reservation
spend_limit_exceededA cap or bundle spend limit is reached for this period