Usage Billing
The Billing module replaces tools like Lago, Lotus, and parts of Stripe Billing for usage-based pricing.
Planned Features
Section titled “Planned Features”- 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
Quick Start (Preview)
Section titled “Quick Start (Preview)”# Create a productsoup billing product create "API Calls" \ --description "Pay per API call"
# Create a tiered pricesoup 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 customersoup billing customer create \ --external-id user_123 \ --email user@example.com
# Record usagesoup billing usage record \ --customer user_123 \ --event api_call \ --quantity 1SDK Usage (Preview)
Section titled “SDK Usage (Preview)”import { Soup } from '@soup-dev/sdk';
const soup = new Soup({ apiKey: 'sk_...' });
// Record usage eventawait soup.billing.usage({ customerId: 'user_123', event: 'api_call', quantity: 1, properties: { endpoint: '/api/v1/users' }});
// Get customer usageconst usage = await soup.billing.getUsage('user_123', { startDate: '2024-01-01', endDate: '2024-01-31'});
// Generate invoiceconst invoice = await soup.billing.createInvoice('user_123');Pricing Models (Preview)
Section titled “Pricing Models (Preview)”Per-Unit
Section titled “Per-Unit”$0.001 per API callTiered
Section titled “Tiered”0-1,000 calls: Free1,001-10,000: $0.0005/call10,001+: $0.0001/callVolume
Section titled “Volume”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)Pricing (Planned)
Section titled “Pricing (Planned)”| Tier | Limits |
|---|---|
| Free | 1 product, 100 customers |
| Standard | Unlimited ($1/user/month) |
| Self-hosted | Unlimited (free) |
Interested?
Section titled “Interested?”Sign up for early access to be notified when Billing is available.