
Photo by Luke Chesser on Unsplash
How to Add Usage-Based Billing to Your SaaS MVP (Metered Billing Explained)
How to Add Usage-Based Billing to Your SaaS MVP (Metered Billing Explained)
Usage-based billing charges customers based on what they consume rather than a flat monthly fee. It's the pricing model behind AWS, Twilio, OpenAI, and Vercel. If your product's value scales with usage, this model can dramatically improve conversion and revenue.
Usage-Based Pricing Models
| Model | How It Works | Example |
|---|---|---|
| Pure usage | Pay only for what you use | AWS Lambda (per invocation) |
| Base + overage | Flat fee includes quota, overage charged extra | Vercel (free tier + per-GB) |
| Tiered usage | Price per unit decreases at higher volumes | Twilio (volume discounts) |
| Credit-based | Buy credits upfront, deduct per usage | OpenAI (token credits) |
| Seat + usage | Per-user fee plus metered features | Slack + API calls |
Which Model for Your MVP?
Base + overage is the best starting point. It gives customers a predictable minimum cost (the base fee) while letting you capture additional revenue from heavy users.
When Usage-Based Billing Makes Sense
Good fit:
- API products (per API call)
- AI/LLM tools (per token, per generation)
- Storage products (per GB)
- Email/SMS services (per message)
- Analytics tools (per event)
Poor fit:
- Simple project management tools
- Basic CRM products
- Content management systems
- Products where usage is hard to measure
Implementing with Stripe Metered Billing
Step 1: Create a Metered Price
In Stripe, create a price with recurring.usage_type: 'metered'. This tells Stripe to bill based on reported usage rather than a fixed amount.
Step 2: Report Usage
Throughout the billing period, report usage to Stripe using the Usage Records API:
- Call
stripe.subscriptionItems.createUsageRecord()with the quantity consumed - Report usage incrementally (as it happens) or in batches (hourly/daily)
- Stripe aggregates all records and charges at the end of the billing cycle
Step 3: Set Aggregation Method
| Method | How It Works | Best For |
|---|---|---|
sum | Total of all reported quantities | API calls, messages sent |
last_during_period | Most recent value reported | Storage, active users |
last_ever | Latest value, persists across periods | Seat count |
max | Highest value during period | Peak concurrent users |
Step 4: Handle the Invoice
At the end of each billing period, Stripe automatically:
- Calculates total usage
- Creates an invoice
- Charges the customer's payment method
- Sends receipt
Credit-Based Billing (Alternative)
For AI products, a credit system is often simpler than metered billing:
How It Works
- User purchases a credit pack ($10 for 1,000 credits)
- Each action costs X credits (e.g., 1 AI generation = 10 credits)
- Track credits in your database
- When credits run out, prompt user to buy more or upgrade
Advantages Over Metered
- Users know their cost upfront
- No surprise bills at end of month
- Simpler implementation (track credits in your DB, not Stripe)
- Better UX for consumers
Usage Tracking Implementation
What to Track
| Data Point | Purpose |
|---|---|
| User ID | Who consumed the usage |
| Action type | What they did (API call, generation, upload) |
| Quantity | How much (1 call, 500 tokens, 2.5 MB) |
| Timestamp | When it happened |
| Billing period | Which invoice to attach to |
Architecture Pattern
User action → Your API → Log usage to database → Batch report to Stripe
↓
End of billing period
↓
Stripe invoices customer
Important: Never report usage to Stripe synchronously in the request path. Log to your database first, then batch report to Stripe via a background job (every hour or daily).
Usage Limits and Guardrails
Protect your business and your customers:
- Set hard limits — Maximum usage per billing period
- Send usage alerts — Email at 50%, 80%, 100% of quota
- Soft vs hard limits — Decide whether to block usage or charge overage
- Dashboard visibility — Show current usage and remaining quota in the app
- Rate limiting — Prevent abuse independently of billing
Final Thoughts
Usage-based billing aligns your revenue with the value customers receive. Start with a simple base + overage model, track usage in your database, and report to Stripe. The credit-based approach is simpler for AI products. Don't over-engineer — you can always add complexity later.
Setting up Stripe billing? Read How to Build SaaS Billing With Stripe.
Need a template? Browse SaaS boilerplates on MVPHub.







