- Recurring charge — how much and how often (e.g., $25/month)
- Included credits — usage allowance per billing cycle
- Rollover rules — whether unused credits carry to the next cycle
- Linked meters — which meters can draw from plan credits
- Credit bundles — one-time credit packs customers can purchase
Plans and subscriptions are used interchangeably — in the SDK and API, plan templates are called subscription configs (
subscription_config_id), and a customer’s enrollment is an active subscription. Despite the name, a plan doesn’t require a recurring charge — set the period amount to $0 for pure pay-as-you-go pricing where customers only pay for what they use.Plan configuration
Recurring charge
The period amount is what the customer pays each billing cycle. This becomes their usage credit by default.- Billing interval:
day,week,month, oryear - Maximum: $10,000 per cycle
- Period amount and billing interval are immutable after creation
Included credit
The dollar amount of usage allowance included each cycle. Three modes:| Mode | Included credit | Use case |
|---|---|---|
| Full credit (default) | Equals period amount | Standard plan — $25/month plan gives $25 in credits |
| Partial credit | Custom amount ≤ period amount | Platform fee model — $25/month but only $20 in credits |
| No credit | $0 | Access fee — subscription grants access, usage billed separately |
Rollover
Control whether unused credits carry to the next cycle:| Rollover type | Behavior |
|---|---|
none | Unused credits expire at cycle end |
full | All unused credits carry to the next cycle |
full rollover:
none rollover:
Cycle credits and bundle credits have independent rollover settings. See Credit bundles below.
Linked meters
Select which meters can draw from this plan’s included credits. Only linked meters consume plan credits — unlinked meters bill separately. A plan can link multiple meters (e.g., one for chat, one for image generation), all drawing from the same credit balance.Overage
When a customer exceeds their plan credits, Lava auto-charges their payment method for the overage at the meter’s rate. Service continues uninterrupted.Credit bundles
Credit bundles are one-time credit packs that customers can purchase. Each bundle specifies:- Cost — what the customer pays (e.g., $10)
- Credit amount — credits received (e.g., $15 for a 50% bonus)
- Customer is on a plan with credit bundles
- Your app shows available packs
- Customer picks a pack → create a checkout session with
checkout_mode: 'credit_bundle' - Customer pays → credits added to their current cycle
The connection must have an active subscription for the plan that owns the bundle.
Subscription lifecycle
Renewal
Subscriptions renew automatically at the end of each billing cycle. On renewal:- The customer is charged the period amount
- A new cycle begins with fresh included credits
- Rolled-over credits (if rollover is
full) are added to the new cycle’s balance
Upgrades
When a customer upgrades to a higher-priced plan:- The new plan takes effect immediately
- Customer is charged the full new plan amount
- Current cycle updates with the new plan’s included credit
- Unused credits (both cycle and bundle) carry over
Downgrades
When a customer switches to a lower-priced plan:- The current plan continues until the end of the billing cycle
- The new plan takes effect at the next cycle boundary
- Shows as
pending_change.type: 'downgrade'in the API
Cancellation
Scheduled cancellation (customer-initiated):- Subscription stays active until the current cycle ends
- Customer retains access to remaining credits
- Shows as
pending_change.type: 'cancellation'in the API - No further charges after the cycle ends
- Subscription terminates immediately
- Use for fraud, disputes, or refund scenarios
Querying subscription status
The connection subscription endpoint returns a customer’s plan details and remaining credits:credits.total_remaining— total available creditscredits.cycle_remaining— from included credit + cycle rollovercredits.bundle_remaining— from bundle purchases + bundle rollover