Creem, per-seat pricing, and metered overage
- New
- Fixed
This release is about how you charge, not only who charges. Creem is the third billing provider, plans can be sold per seat, and Stripe plans can bill AI usage past the included allowance. The shipped Pro and Ultra plans do not change, so an existing install keeps working exactly as before until you opt in.
Creem as a third provider
BILLING_PROVIDER=creem routes checkout, the customer portal, cancel, resume, and webhooks through Creem. As with Polar, the kit keeps the catalog, entitlements, and billing ledger; Creem only moves the money. Creem statuses map onto the kit's existing phases. scheduled_cancel stays entitled until the period ends, unpaid gets the same grace window as a Stripe past_due, and paused blocks access but keeps the slot recoverable.
Two limits are deliberate. Creem does not sell seats in the kit, and a checkout with more than one seat is refused instead of silently billing one. The Creem SDK cannot switch off a product-level trial, so when the kit decides a customer should not get a second trial, checkout fails closed instead of granting one.
Per-seat plans
A catalog price can declare pricingModel: "per_seat". Checkout then sends the seat count: Stripe as an adjustable line-item quantity, Polar as seats. The webhook stays the source of truth for what was actually bought. Once a per-seat subscription is active, members plus pending invitations are capped at the purchased seats, or at the plan's maxMembers if that is lower. Flat plans keep their existing member limits.
Metered AI overage on Stripe
A paid plan can declare a meter. Responses inside the included allowance are never sent to Stripe. Each response past it is written to an outbox after the model call succeeds and reported through Stripe meter events. The outbox status and Stripe's idempotency key keep a retry from billing twice. GET /api/cron/usage-reports, protected by CRON_SECRET, retries anything a request did not finish. Overage only switches on after a webhook confirms the metered price is on the subscription. Polar and Creem do not report usage, so they keep the hard cap even if a meter is declared.
Fixed: monthly AI limits on yearly plans
monthlyAiResponses was counted over the whole invoice period, so a yearly plan got its monthly allowance once a year. Yearly plans now reset on the subscription's monthly anniversary. Monthly plans keep their current reset day.