Implementing API Monetization
1. Configuring Usage-Based Billing
| Model | Detail |
|---|---|
| Per request | $/1000 calls |
| Per resource | $/GB processed |
| Per outcome | $/successful prediction |
| Tiered (volume) | Cheaper after N calls |
| Hybrid | Base fee + usage overage |
2. Setting Up Pricing Tiers
| Tier | Includes |
|---|---|
| Free | 1K calls/mo, community support |
| Starter ($29/mo) | 50K calls, email support |
| Pro ($199/mo) | 500K calls, SLA, Slack |
| Business ($999/mo) | 5M calls, SSO, audit logs |
| Enterprise (custom) | Custom limits, dedicated CSM |
3. Implementing Metering and Quotas
Example: Metering record
{
"subscription_id": "sub_123",
"metric": "api_calls",
"quantity": 1,
"timestamp": "2025-05-20T12:34:56Z",
"dimensions": {
"route": "/v1/predict",
"tier": "pro",
"region": "us-east-1"
}
}
| Step | Detail |
|---|---|
| Counter | Real-time atomic increment |
| Aggregator | Hourly/daily roll-up |
| Quota check | Pre-request 429 if exceeded |
| Reconciliation | Nightly truth from logs |
4. Using Subscription Management
| State | Behavior |
|---|---|
| trialing | Full access, billed at end |
| active | Normal operation |
| past_due | Grace period, retry payment |
| unpaid | API restricted (read-only) |
| canceled | Access ends at period end |
5. Configuring Payment Gateway Integration
| Provider | Strength |
|---|---|
| Stripe Billing | API-first, dev-friendly |
| Paddle | Merchant of record (tax) |
| Chargebee | Subscription mgmt |
| Lago / OpenMeter | OSS metering |
| RevenueCat (mobile) | App store subs |
6. Implementing Free Trial Periods
| Setting | Recommendation |
|---|---|
| Duration | 14-30 days |
| Credit card required | Reduces churn but lowers signup |
| Feature parity | Match Pro tier |
| Trial extension | One-time, on request |
| Expiration warning | D-7, D-3, D-1 emails |
7. Setting Up Billing Analytics
| Metric | Definition |
|---|---|
| MRR / ARR | Monthly/annual recurring revenue |
| ARPU | Avg revenue per user |
| Churn rate | % subs lost / month |
| NRR | Net revenue retention (expansion - churn) |
| LTV / CAC | Lifetime value vs acquisition cost |
8. Configuring Overage Charges
| Policy | Detail |
|---|---|
| Hard cap | Block at limit (429) |
| Soft cap | Allow, charge overage |
| Overage rate | Usually 2-3x tier rate |
| Notification | 50%, 80%, 100% emails |
| Auto-upgrade | Bump tier vs overage |
9. Using Credit-Based Systems
| Aspect | Detail |
|---|---|
| Credit unit | Abstract (1 cr = 1 API call OR 0.1 GB) |
| Purchase | Pack-based ($10 = 10K credits) |
| Expiration | 12 months from purchase |
| Auto-refill | Below threshold trigger |
| FIFO consumption | Oldest credits first |
10. Setting Up Invoice Generation
| Field | Detail |
|---|---|
| Invoice number | Sequential, immutable |
| Line items | Subscription + usage |
| Tax | VAT/GST per jurisdiction |
| PDF + e-invoice | UBL/Peppol where required |
| Payment terms | Net 30 (enterprise) |
| Dunning workflow | D+3, D+7, D+14 reminders |