Skip to main content

Overview

This guide explains how to implement credit auto-recharge, similar to how OpenAI manages prepaid usage. Customers consume credits as they use your product, and when their balance drops below a defined threshold, credits are automatically recharged up to a target balance. Auto-recharge allows you to monetize usage continuously without requiring customers to manually top up credits, while still enforcing a monthly spending limit. You’ll learn how to model credits, grant an initial balance, and configure auto-recharge for customers using Stigg.

Use case

Credit auto-recharge is ideal for usage-based products where customers consume prepaid credits over time, such as API calls, data enrichment, automations, or AI workloads. Instead of renewing credits on a fixed cadence, customers maintain a rolling credit balance that is automatically replenished when it runs low.

Example credit model

This guide uses the following example:
  • Credits are consumed per API call
  • Customers start with an initial prepaid credit balance
  • When the balance drops below 20 credits, it is automatically recharged back up to 50 credits
  • Auto-recharge spending is capped at $500 per month

Step 1: Create a product

The product represents the commercial offering that will contain your credit-based usage.
  1. Go to Product catalog → Products.
  2. Click + New product.
  3. Select Single active subscription.
  4. Give the product a name.
  5. Click Create.

Step 2: Create meter-based features

Credits are consumed by meter-based features.
  1. Go to Product catalog → Features.
  2. Click + New feature.
  3. Configure the feature:
    • Name – Display name shown in the UI
    • Description (optional) – What the feature enables
    • Feature type – Select Meter
    • Meter type – Select Calculated usage
    • Unit names – For example, request / requests
  4. (Optional) Enable Feature is sold in different units if required.
This feature will later be linked to credit consumption.

Step 3: Create a prepaid credit plan

This plan is used to grant customers an initial credit balance.
  1. Go to Product catalog → Plans.
  2. Click + New plan.
  3. Select the product you created.
  4. Give the plan a name (for example, Prepaid credits).
  5. Click Create.

Step 4: Configure pricing

  1. Go to Product catalog → Plans.
  2. Select the plan.
  3. In the Price section, click + Set.
  4. Select Paid.
  5. Choose One-time as the billing model.
  6. Click Continue.

Step 5: Configure credits

This step defines how many credits are granted to the customer upfront. Under Charges:
  1. Select Credits.
  2. In Credit type, select Credits (Credits).
  3. Choose a pricing model (for example, Flat or Stairstep).
  4. Define the number of credits granted (for example, 50 credits).
  5. Set the price for the credit grant.
  6. Click Add to save the charge.

Step 6: Grant credits to a customer

  1. Go to Customers → Customer accounts.
  2. Select a customer.
  3. In the Subscriptions section, click + Add.
  4. Select the product.
  5. Select the prepaid credit plan.
  6. Add a billing method.
  7. Click Create.
The customer now has an initial credit balance.

Step 7: Enable auto-recharge

Once a customer has a credit balance, you can configure auto-recharge.

Credit usage per customer

  1. Go to Customers.
  2. Select a customer.
  3. Go to the Credits tab.
The Auto-recharge section shows the current credit spend and the configured monthly spending limit.

Auto-recharge settings

  1. Click Manage in the Auto-recharge widget.
  2. In When credit balance goes below, enter the credit balance that triggers auto-recharge, such as 30.
  3. In Then bring credit balance back up to, enter the target balance after recharge.
  4. In Limit total monthly spend to, enter the maximum amount that can be charged per month.
  5. Select a reset interval in Spend limit resets every.
  6. Select a duration in Grant expiration.
  7. Select a payment method under Payment method.
  8. Click Save settings.
Once saved, credits will be automatically recharged according to the configured rules.

Step 8: Monitor credit usage

You can monitor how customers consume and recharge credits over time.
  1. Go to Customers → Customer accounts.
  2. Select a customer.
  3. Open the Credits tab.
This view shows:
  • Current credit balance
  • Credit consumption
  • Auto-recharge spend for the current month
If the monthly spend limit is set lower than the customer’s current spend for the month, auto-recharge will be disabled and no additional credits will be recharged until the limit is increased or the spend limit resets.