Skip to content
Usage-based billing for AI apps

Charge for AI usage before it charges you.

Sell credit packs, set limits per plan and top up automatically when a balance runs low. Your users always see what they have left.

Set up credits

What it isBuildBase is one SDK and console for React apps with credits, usage limits, billing and sign-in built in.

Free plan7-day free trial on paid plansNo credit card required
Example: One user's credit balance

100credits left

  1. Bought a pack+100
    Balance after: 100 credits.
  2. Generated 60 images-60
    Balance after: 40 credits.
  3. Balance running low-30
    Balance after: 10 credits.
  4. Auto top-up+90
    Balance after: 100 credits.

Example numbers. Your packs, prices and limits are yours to set.

How a request gets paid for

The same path every time a user runs your AI feature.

  1. Step 1

    Check

    Your server asks BuildBase whether the workspace has the credits or quota for this request.

  2. Step 2

    Run

    The AI call runs only after the check passes, so nobody gets a free request.

  3. Step 3

    Deduct

    Credits are consumed and the user's balance updates at once.

  4. Step 4

    Top up

    When a balance runs low, a workflow can warn the user, or auto top-up buys the next pack.

What AI features cost when nobody meters them

Every request costs you money. Without credits or limits, your best users are also your most expensive ones.

  • Without it: A way to sell usage, not only a monthly plan

    Already covered: Credit packs bought through your own Stripe

  • Without it: A limit on what Free users can run

    Already covered: Usage limits per plan, checked before the request runs

  • Without it: A balance users can see and trust

    Already covered: Balances that update the moment credits are used

  • Without it: A top-up before users hit zero

    Already covered: Auto top-up buys the next pack when a balance runs low

  • Without it: Promotional credits without a spreadsheet

    Already covered: Grants that expire on a schedule

Usage billing for AI, already built

  • Credit packs

    Sell packs on your own Stripe, so heavy users buy more instead of costing you more.

    Credits module
  • Limits per plan

    Set how much each plan may use, so your free plan stays affordable to run.

    Billing module
  • A balance users can see

    Balances update as credits are consumed, so users always know what they have left.

    Credits module
  • Auto top-up

    The next pack is bought when a balance runs low, so work does not stop halfway.

    Credits module
  • Grants that expire

    Give promotional credits on a schedule, so a launch offer costs what you planned.

    Credits module
  • Overage on Stripe meters

    Usage past an allowance can be reported to Stripe Billing Meters, so a big month bills correctly.

    Billing module

Building credits yourself

Credit packs, plan limits, top-ups and payment events, built with an AI coding agent and kept running, against setting them up here.

$60/h

Plan

Compared with building these 3 modules yourself with an AI coding agent: Credits, Billing, Webhooks.

You keep, over 1 year

$7,295

Build it yourself
$7,905
BuildBase
$610

A year of Launch costs the same as 3 h 10 min of your time. See what each plan includes.

Pick your own modules

Credits in three steps

  1. Create your packs

    In the console, define your credit packs, the limit each plan includes and when to top up.

    Console: Credits
    Credit pack
    Starter pack
    Plan limit
    ai-generations, monthly
    Auto top-up
    On when low
    Grant
    Launch offer, expires
  2. Check before you spend

    On your server, before each AI request, check the quota and consume the credits it uses.

    app/api/generate/route.tsTSX
    import BuildBase from '@buildbase/sdk';
    
    const bb = BuildBase({ serverUrl, orgId, getSessionId });
    
    // Record usage and check quota
    const usage = await bb.usage.record(workspaceId, {
      quotaSlug: 'api-calls',
      quantity: 1,
    });
    
    if (usage.available <= 0) {
      return Response.json(
        { error: 'Quota exceeded' },
        { status: 429 }
      );
    }
    
    // Consume credits
    const result = await bb.credits.consume(
      workspaceId,
      { amount: 10, description: 'AI generation' }
    );
  3. Show the balance

    Show what is left, and a prompt to buy more when it runs low, from the same SDK.

    components/ai-feature.tsxTSX
    import {
      useCreditBalance,
      useConsumeCredits,
      useExpiringCredits,
      WhenCreditsExhausted,
      WhenCreditsLow,
    } from '@buildbase/sdk/react';
    
    function AIFeature({ workspaceId }) {
      const { balance } = useCreditBalance(workspaceId);
      const { consumeCredits } = useConsumeCredits(workspaceId);
      const { expiringCredits } = useExpiringCredits(workspaceId, 7);
    
      const handleGenerate = async () => {
        try {
          await consumeCredits({ amount: 10, description: 'AI generation' });
          // proceed with generation
        } catch (err) {
          if (err.code === 'INSUFFICIENT_CREDITS') {
            // err.available and err.requested are available
          }
        }
      };
    
      return (
        <>
          <p>Credits: {balance?.available}</p>
          {expiringCredits > 0 && <p>{expiringCredits} credits expire soon</p>}
    
          <WhenCreditsLow threshold={10}>
            <p>Running low — buy more credits.</p>
          </WhenCreditsLow>
    
          <WhenCreditsExhausted>
            <p>No credits left.</p>
          </WhenCreditsExhausted>
    
          <button onClick={handleGenerate}>Generate (10 credits)</button>
        </>
      );
    }

No fee on your credit sales. Your users' payments go to your own Stripe with a 0% platform fee. BuildBase starts at $0, and Launch is $19 a month.

One price for the whole backend

Start on Free, with paid plans from $19/mo. The plans differ in how much you can run and in some of the features they include, and the full comparison lists every one.

  • The 6 core modules on every plan, with higher limits and more features as you move up.
  • A Free plan at $0 that stops at its allowance and never bills.
  • Paid plans start with a 7-day free trial, no credit card.
  • Users, emails and webhook deliveries are allowances, not meters. Going over does not produce a bill.
  • Three things bill over on the paid plans: workflow runs at $0.25, $0.15 or $0.10 per 1,000 runs on Launch, Grow and Scale, web analytics events at $2 per 100,000 events, and storage at $0.10 per GB-month.
  • Pay yearly and get twelve months for the price of ten.

Prices in USD. Verified 31 October 2026.

AllowancesFree$0/moLaunch$19/moGrowPopular$49/moScale$99/mo
Monthly active users10k25k100k500k
Workspaces501k25k100k
Storage1 GB10 GB50 GB200 GB
Console team members23850

Questions

About credits for ai apps on BuildBase.

Is this a full usage-metering platform?

No. Credits and quotas are built for an app's own pricing: packs, limits per plan, grants, top-ups and overage on Stripe Billing Meters. If you need event-time metering with corrections or aggregations other than a sum, a dedicated metering tool fits better.

Can I mix a subscription with credits?

Yes. Plans carry their own limits, and users can buy credit packs on top of their subscription.

Do you take a fee on credit sales?

No. Payments through your own Stripe account carry a 0% platform fee. Stripe's own fees apply as usual.

What happens when a user runs out?

The check fails before the request runs, so you never pay for a request nobody paid for. Your app shows a prompt to buy more, or auto top-up buys the next pack before the balance reaches zero.

What does BuildBase itself cost?

The Free plan is $0 and stops at its allowance instead of billing you. Paid plans start at $19 a month with a 7-day trial and no card.

Make every AI request pay for itself

Credit packs, limits and top-ups on your own Stripe. Start on the Free plan and turn credits on when your AI feature ships.

Free plan7-day free trial on paid plansNo credit card required