Plans & Pricing
Defining pricing tiers and linking them to Stripe products.
Define plans in config/site.js
Plans render on the landing page from pricing.plans. Each plan can carry its own Stripe price ID; without one, NEXT_PUBLIC_STRIPE_PRICE_ID is used.
// config/site.js
pricing: {
plans: [
{
name: "Pro",
price: 29,
priceOriginal: null, // optional strike-through
description: "One sentence describing this tier.",
features: ["What is included", "in this plan"],
cta: "Get started",
featured: true,
priceId: "price_...", // optional, per plan
mode: "subscription", // or "payment" for one-time
},
],
}Create the price in Stripe
1. Stripe dashboard → Products → Add product
2. Set the price and whether it recurs
3. Copy the price ID (starts with price_)
4. Put it in the plan above, and add it to STRIPE_ALLOWED_PRICE_IDS in .env.local
💡
Checkout refuses any price ID not in STRIPE_ALLOWED_PRICE_IDS, so a tampered request cannot buy at a different price.
Credits
config/billing.js decides how credits work. New signups get a trial of trialCredits (20). In model "credits" (the default) every paid invoice resets the balance to monthlyCredits (500), which needs a recurring Stripe price. In model "license" has_access is the gate and nothing is metered, for a one-time price. Text calls cost 1 credit, images imageCredits (5). trialDailyCreditCap (1000) is a ceiling on credits spent per day by all users without access combined, so someone signing up with many email addresses cannot run up your AI bill. Paying users never count against it.