CreditKit
Next.js, Supabase, and Stripe starter template with a real usage credits system for AI apps
Gallery
About CreditKit
CreditKit is a starter template that gives developers a working usage credits billing system built on Next.js, Supabase, and Stripe. If you're building an AI application and need users to pay per generation, per API call, or per task rather than a flat monthly fee, this template handles the plumbing so you don't have to wire it together yourself.
Usage based billing sounds simple until you actually try to build it. You need to track credits atomically so partial failures don't leave users overcharged or undercharged. You need webhooks that can be retried safely without double charging. You need background jobs that refund credits when something goes wrong. CreditKit ships with all of this already working. The credit spend is atomic, meaning the transaction either completes fully or rolls back entirely. The Stripe webhooks are idempotent, so retrying them won't duplicate charges. And there's a background worker that watches for failed jobs and processes refunds automatically.
The stack choices make sense for the audience it's aimed at. Next.js handles the frontend and API routes. Supabase provides the database and auth layer. Stripe does the actual payment processing. If you're already comfortable with this stack or planning to use it anyway, adding CreditKit means you skip weeks of integration work and start with a billing system that's already tested.
What you're buying is the source code outright. It's not a subscription or a hosted service. You pay the one time price, download the code, and own it. You can modify it, extend it, or rip out pieces you don't need. There's no ongoing fee and no dependency on a third party staying in business.
The template is aimed at indie developers and small teams building AI products where per use pricing makes more sense than subscriptions. Think image generators, document processors, code assistants, or anything where the cost to you scales with usage and you want the pricing to your users to match. If you've been putting off usage billing because it felt like a distraction from the actual product, this is the shortcut.
The pricing is a one time $129. That gets you the full source code with no restrictions. Compared to the time it takes to build a robust credits system from scratch, handle edge cases around failed transactions, and test Stripe webhook retry behavior, the math works out quickly if your time is worth much at all.
CreditKit doesn't try to do everything. It's specifically a billing and credits layer, not a full SaaS boilerplate with user management, dashboards, or landing pages. That narrow focus is a strength if you already have opinions about the rest of your stack, but it does mean you'll need to bring your own frontend components and user interface beyond the billing flow.
Key Features
- Atomic credit spend transactions
- Idempotent Stripe webhook handling
- Background worker for failed job refunds
- Full source code ownership
- Next.js and Supabase integration
- Usage based billing out of the box
Pros & Cons
What we like
- Solves the hardest parts of usage billing upfront
- You own the code outright with no ongoing fees
- Built on a modern stack most developers already know
- Handles edge cases like failed transactions and webhook retries
Room for improvement
- One time cost may feel steep for hobbyist projects
- Requires familiarity with Next.js and Supabase
- Focused only on billing, not a full SaaS template
- No hosted option if you prefer managed services
Frequently Asked Questions
What is CreditKit?
How much does CreditKit cost?
Who is CreditKit for?
What tech stack does CreditKit use?
Best For
Featured in
Alternatives to CreditKit
View all1Lookup
Real-time data verification API for phone, email, IP, and domain validation to fight fraud
Kevin Gabeci
Solo developer building web apps, cozy browser games, and AI creator toolkits.

Codedex
A gamified, story-driven platform that teaches Python, web dev, and more like an RPG quest
Hack2hire
Practice real SDE interview questions from top tech companies with expert worked solutions
Reviews (9)
Does the job, a few gripes
Three months of CreditKit later, here is what holds up. The output quality holds up better than I expected. Mostly using it for charging per api call in a developer product. The catch is one time cost may feel steep for hobbyist projects. Hard to imagine going back to my old setup.
Exactly what I needed
Three months of CreditKit later, here is what holds up. Where it really wins is solves the hardest parts of usage billing upfront. It earns its place in my stack.
Quietly excellent
Three months of CreditKit later, here is what holds up. The full source code ownership is more useful than I expected. It slotted into my routine without much fuss. Found it works best for charging per api call in a developer product. It earns its place in my stack.
Exactly what I needed
Started using CreditKit casually, now it is pinned in my dock. Their take on full source code ownership is genuinely good. Found it works best for adding per generation billing to an ai image tool. Easy yes for anyone weighing the same trade offs.
It just works
Started using CreditKit casually, now it is pinned in my dock. Got real value out of background worker for failed job refunds. No regrets so far.
Finally something that fits
Hadn't planned on switching, but CreditKit was hard to ignore. Their take on next.js and supabase integration is genuinely good. Mostly using it for building a pay per task document processor. Worth it for what I get out of it.
Two months in, no regrets
Found CreditKit on a Show HN thread and I am glad I clicked. Where it really wins is idempotent stripe webhook handling. It handles the boring parts so I can focus on the work that matters. Mostly using it for launching an ai assistant with usage credits. Would sign up again without thinking twice.
Decent with some rough edges
Tried CreditKit on a side project first, then rolled it out everywhere. The interface stays out of my way, which I appreciate. The core workflow is smooth once you are set up. It fits well for charging per api call in a developer product. The catch is requires familiarity with next.js and supabase. Recommending it to people in a similar spot.
Solid daily driver
Tried CreditKit on a side project first, then rolled it out everywhere. What stands out is how it handles atomic credit spend transactions. It does what it says, which is rarer than it should be. It fits well for charging per api call in a developer product. It earns its place in my stack.
Related Tools
Kevin Gabeci
Solo developer building web apps, cozy browser games, and AI creator toolkits.

Coolify
Self-hostable, open source alternative to Heroku and Netlify

Warp
The modern terminal reimagined with AI and collaboration

Bolt.new
Prompt-to-deployed full-stack app inside the browser