Browse documentation
Connect billing to plan limits
Checkout, customer portal routing, webhook storage, and plan-aware word limits stay in sync with your subscription, so upgrades and usage always line up.
Your platform
Overview
View pricing
Start from public plans
Plans define the upgrade story, word limits, API access, and support expectations.
Open billing
Manage workspace billing
Workspace billing connects account state, word balance, and Stripe portal access.
/api/billing/checkoutfetch('/api/billing/checkout', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ plan: 'pro', cycle: 'monthly' })
})
Review board
01
Checkout
Plan selection posts to the checkout route and limits update with the subscription.
02
Portal
Signed-in users can be routed to Stripe customer portal after a subscription exists.
03
Webhooks
Billing events are stored so subscription state can be reconciled with the workspace.
Billing loop
What happens after a user upgrades
Choose a plan
The pricing page determines plan, cycle, word allocation, API access, and checkout copy.
Open checkout
The billing route creates a Stripe Checkout session when live credentials are configured.
Receive webhook
Stripe sends subscription events that can update account plan and word balance.
Manage portal
Subscribed users return to Stripe portal for card, invoice, cancellation, or plan-management flows.
Configuration