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.- Go to Product catalog → Products.
- Click + New product.
- Select Single active subscription.
- Give the product a name.
- Click Create.
Step 2: Create meter-based features
Credits are consumed by meter-based features.- Go to Product catalog → Features.
- Click + New feature.
- 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
- (Optional) Enable Feature is sold in different units if required.
Step 3: Create a prepaid credit plan
This plan is used to grant customers an initial credit balance.- Go to Product catalog → Plans.
- Click + New plan.
- Select the product you created.
- Give the plan a name (for example, Prepaid credits).
- Click Create.
Step 4: Configure pricing
- Go to Product catalog → Plans.
- Select the plan.
- In the Price section, click + Set.
- Select Paid.
- Choose One-time as the billing model.
- Click Continue.
Step 5: Configure credits
This step defines how many credits are granted to the customer upfront. Under Charges:- Select Credits.
- In Credit type, select Credits (Credits).
- Choose a pricing model (for example, Flat or Stairstep).
- Define the number of credits granted (for example, 50 credits).
- Set the price for the credit grant.
- Click Add to save the charge.
Step 6: Grant credits to a customer
- Go to Customers → Customer accounts.
- Select a customer.
- In the Subscriptions section, click + Add.
- Select the product.
- Select the prepaid credit plan.
- Add a billing method.
- Click Create.
Step 7: Enable auto-recharge
Once a customer has a credit balance, you can configure auto-recharge.Credit usage per customer
- Go to Customers.
- Select a customer.
- Go to the Credits tab.
Auto-recharge settings
- Click Manage in the Auto-recharge widget.
- In When credit balance goes below, enter the credit balance that triggers auto-recharge, such as 30.
- In Then bring credit balance back up to, enter the target balance after recharge.
- In Limit total monthly spend to, enter the maximum amount that can be charged per month.
- Select a reset interval in Spend limit resets every.
- Select a duration in Grant expiration.
- Select a payment method under Payment method.
- Click Save settings.
Step 8: Monitor credit usage
You can monitor how customers consume and recharge credits over time.- Go to Customers → Customer accounts.
- Select a customer.
- Open the Credits tab.
- 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.
