import Stripe from "stripe"; let _stripe: Stripe | null = null; export function getStripe(): Stripe { if (!_stripe) { const key = process.env.STRIPE_SECRET_KEY; if (!key) throw new Error("STRIPE_SECRET_KEY is not set"); _stripe = new Stripe(key, { apiVersion: "2026-01-28.clover" }); } return _stripe; } export const TIER_CONFIG = { FREE: { name: "Free", generationsLimit: 15, period: "day", price: 0, }, STARTER: { name: "Starter", priceId: process.env.STRIPE_STARTER_PRICE_ID!, generationsLimit: 1000, period: "month", price: 5, }, PRO: { name: "Pro", priceId: process.env.STRIPE_PRO_PRICE_ID!, generationsLimit: 100000, period: "month", price: 20, }, } as const;