Credits are the main usage meter across the apps. Payments can top them up,
and app routes check balances before expensive actions run.
Where Credits Show Up
- the dashboard sidebar
- the account center
- purchase flows
- API routes for paid generation features
Credit Grants In The Repo
The repo currently grants:credits-small-> 50 creditscredits-large-> 100 credits
lib/payments/types.ts.
Shared credit-pack labels, prices, and display metadata live in lib/payments/public-config.ts.
How Credits Change
- new users start with a default balance from the database setup
- app actions consume credits
- failed generation paths can refund credits
- successful credit purchases add more
Billing Flow
- User clicks a checkout link
- Provider sends a webhook
- The webhook is verified
- The purchase is stored in
purchases - The profile is updated
- If it is a credit purchase, credits are added automatically
Verification
Your billing setup is working if:- checkout succeeds
- the purchase appears in the database
- the credits number changes in the UI

