2-Minute SetupWorks with Your Stripe Account · $0/mo to Start

Drop-in credit wallets &instant paywalls.

Gate usage-based features, sell credit packs and rollover subscriptions, and auto-refund failed runs—without building ledger tables or billing UI.

Start Free ($0/mo)Read Documentation →
// app/api/generate/route.ts (1-file helper from /docs)
import { CreditKitClient } from '@/lib/creditkit';

export const credits = new CreditKitClient({
  apiKey: process.env.CREDITKIT_SECRET_KEY!, // sk_test_... or sk_live_...
});

export async function POST(req: Request) {
  const session = await getSession(req); // Clerk, Supabase, Better Auth, NextAuth
  if (!session?.user?.id) return Response.json({ error: 'Unauthorized' }, { status: 401 });

  const hold = await credits.withCrashProofHold(
    { req, userId: session.user.id, placementKey: 'run_action', units: 1 },
    async () => await runJob() // Auto-refunds exact lots on 5xx
  );
  if (!hold.allowed) {
    return Response.json(hold, {
      status: hold.configError ? 500 : hold.refundedOnCrash ? 502 : 402,
    });
  }
  return Response.json(hold.data);
}
✓ Server-authoritative holds✓ 5xx auto-refunds✓ Credits, 100x, or 1k tokens
0 credits remaining

Refill usage credits

Standard Pack
1,000 credits · One-time · Never expires
$12
Studio MonthlyPopular
5,000 credits · Monthly · 2x rollover
$29/mo
Annual Pro
60,000 credits · Annual · Save 20%
$290/yr
Promo codeSecured by CreditKit
CreditKit.openTopUp() · GatePops up when credits hit 0 (HTTP 402). Supports packs, monthly plans, promos, and upgrades.
Free starter:
Default pack:
Get API Keys
HOW IT WORKS

From zero to live credit billing in three steps.

01 / CONFIGURE YOUR PRICING

Set credit costs & free tiers

Define what each action costs (run_action = 10 cr, export_batch = 10 cr), signed-in starter allowances (50 cr), and credit packs in the console—change pricing anytime without redeploying.

02 / GATE YOUR ENDPOINT

Deduct credits—and auto-refund crashes

Wrap your API route or button in one call. CreditKit checks the user's balance, locks the credits while your code runs, and puts them right back if your server or upstream API fails.

03 / COLLECT PAYMENTS IN STRIPE

Show an instant top-up modal at 0 credits

When a user runs out, CreditKit opens your branded top-up modal automatically. Customers buy credit packs or subscriptions via Stripe, and payouts go straight to your bank.

PRODUCTION LEDGER

Everything a simple credit column doesn’t handle.

5xx Crash Refunds

Failed upstream AI, scraper, or API runs automatically restore the exact source lot.

FIFO Packs + Rollover

Daily free and expiring monthly rollover credits always burn before permanent packs.

Prorated Plan Changes

Mid-cycle upgrades grant +delta credits immediately; downgrades schedule at period end.

Abuse & Compute Cap

Signed-in HMAC identity binding plus a hard daily free-tier spend circuit breaker.

Refund & Dispute Safety

Proportional refund clawbacks, chargeback auto-freezes, and past-due subscription dunning.

Per-Action Net Margins

Track real profit per endpoint after API/GPU cost and run 50/50 quota A/B split-tests.

TRANSPARENT PRICING

$0/mo until you have real volume.

Monthly Volume: $2,500Best: Builder ($79/mo)
Starter5% fee
$0 / mo
  • ✓FIFO ledger & 5xx crash holds
  • ✓Packs + Monthly / Annual plans
  • ✓Web, React & Mobile checkout surfaces
Start Free →
Builder2% fee
$29 / mo
  • ✓White-label (removes CreditKit badge)
  • ✓Configurable Exit-Intent Offers
  • ✓Up to 25 Promo Codes / project
Start with Builder →
Studio1% fee
$99 / mo
  • ✓Lowest 1% fee for high-volume apps
  • ✓Up to 100 Promo Codes & 20 Projects
  • ✓50/50 Starter Quota A/B Split-Testing
Start with Studio →