Skip to content

Usage Billing

The Billing module replaces tools like Lago, Lotus, and parts of Stripe Billing for usage-based pricing.

  • Usage metering - Track any usage metric
  • Tiered pricing - Volume discounts and tiers
  • Invoice generation - Automatic monthly invoices
  • Customer management - Link to your app’s users
  • Stripe integration - Optional Stripe Connect for payouts
Terminal window
# Create a product
soup billing product create "API Calls" \
--description "Pay per API call"
# Create a tiered price
soup billing price create api-calls \
--product "API Calls" \
--unit-amount 0.001 \
--billing-scheme tiered \
--tiers '0-1000:0,1001-10000:0.0005,10001+:0.0001'
# Create a customer
soup billing customer create \
--external-id user_123 \
--email user@example.com
# Record usage
soup billing usage record \
--customer user_123 \
--event api_call \
--quantity 1
import { Soup } from '@soup-dev/sdk';
const soup = new Soup({ apiKey: 'sk_...' });
// Record usage event
await soup.billing.usage({
customerId: 'user_123',
event: 'api_call',
quantity: 1,
properties: {
endpoint: '/api/v1/users'
}
});
// Get customer usage
const usage = await soup.billing.getUsage('user_123', {
startDate: '2024-01-01',
endDate: '2024-01-31'
});
// Generate invoice
const invoice = await soup.billing.createInvoice('user_123');
$0.001 per API call
0-1,000 calls: Free
1,001-10,000: $0.0005/call
10,001+: $0.0001/call
0-1,000 calls: $0.001/call (total: $1)
1,001-10,000: $0.0005/call (total: $5.50)
10,001+: $0.0001/call (all calls at this rate)
TierLimits
Free1 product, 100 customers
StandardUnlimited ($1/user/month)
Self-hostedUnlimited (free)

Sign up for early access to be notified when Billing is available.