Skip to Content
Credits & BillingCredits

Credits & billing

Credit ledger

Balances live in credit_balances; every movement is recorded in credit_transactions.

TypeMeaning
grant / topupAdd credits
debitJob completed
refundJob failed / cancelled
monthly_resetAllowance top-up

Reserve moves credits from availablereserved at submit. Finalize debits or refunds.

Plans

PlanGeneration credits / month
free500
pro3,000
team10,000

Plan changes sync allowance via sync_org_generation_credits_for_plan (service role / internal RPC only).

Billing providers

billingProviderCheckout
mockIn-memory + update_organization_plan (local only, gated)
stripeStripe Checkout + webhooks
customYour Edge webhook → apply_billing_subscription

UI uses BillingPort — no payment SDK in features.

Web app adapter

WebBillingAdapter merges Postgres billing snapshot with mock plan metadata for display. Stripe paths invoke Edge functions; mock paths sync plan to Postgres after checkout.

See Custom provider and Monthly reset.

Last updated on