Customization
How to customize pricing, AI settings, and more.
Modify Pricing Plans
Edit constants/billing.ts:
starter_monthly: {
priceCents: 2900, // Minimum currency units (integer)
creditsPerCycle: 1000, // Credits granted per billing cycle
productIds: {
dodo: "pdt_xxx", // Product ID at Dodo
waffo: "PROD_xxx", // Product ID at Waffo
},
grantSchedule: { mode: "per_cycle" },
}Two rules that are easy to get wrong:
priceCentsis minimum currency units, not dollars. USD 29.00 →2900. Currencies differ in decimals (JPY/KRW have none, KWD has 3), so never writeprice * 100anywhere — usefromMinorUnits()fromlib/payments/money.ts.- The price here is the only source of truth. It is never read back from the provider, and the provider price is only used for reconciliation. Changing it in only one place is how "page says $29, charge says $99" happens.
After editing, run pnpm doctor:online — it will tell you if a product ID does not
exist at the provider.
Modify Credit Costs
Edit the cost constants:
| Feature | File | Variable |
|---|---|---|
| Chat | lib/credits.ts | CHAT_CREDIT_COST |
| Image | app/api/image/generate/route.ts | Inline constant |
| Video | app/api/video/generate/route.ts | Inline constant |
Replace AI Provider
To switch from Volcano Engine to OpenAI:
- Install the OpenAI SDK:
pnpm add openai - Replace files in
lib/volcano-engine/with OpenAI equivalents - Update environment variables
- Keep the same credit deduction pattern in API routes
Add a New Language
- Copy
messages/en.jsontomessages/XX.json(new locale) - Translate all strings
- Add locale to
i18n.config.ts:
export const locales = ['en', 'zh', 'XX'] as const;- Update
proxy.tsandlib/i18n.ts
Customize Theme
Colors are defined in app/globals.css using CSS custom properties:
:root {
--background: 0 0% 100%;
--foreground: 0 0% 3.9%;
--primary: 0 0% 9%;
/* ... */
}Dark mode variables are in the .dark class.
Add New Protected Pages
- Create a new page in
app/[locale]/(protected)/your-page/page.tsx - It's automatically protected by the layout's session check
- Add navigation in
features/navigation/config.ts