Credits
Credit-based billing alongside Stripe subscriptions. Metered usage without the complexity.
Pay-per-use, already built
Some products need more than flat monthly pricing. AI generation costs, API calls, exports — things where usage varies per user. The framework includes a credit system that runs alongside Stripe subscriptions.
Users get credits based on their plan. They spend credits when they use metered features. The balance updates in real time, and when credits run low, they see upgrade prompts. All of the accounting happens in the database with proper constraints so balances never go negative.
What is wired up
Credit allocation, spending, balance checks, and expiration. The agents know the system exists, so when you describe a feature that costs something per use — "each AI generation costs 5 credits" — they wire in the deduction automatically. No extra configuration on your end.
How to add a credit-based feature
I want to add an AI summary feature. Each summary generation should cost
10 credits. Show the user their remaining balance before they generate.
If they do not have enough credits, show an upgrade prompt instead of the
generate button. Free plan users get 50 credits per month, Pro users get
500 per month.
The orchestrator handles the rest: the balance check in the procedure, the UI conditional, the upgrade prompt, and the monthly credit reset.