Usage-based pricing
Charge customers for what they use — API calls, seats, gigabytes — by reporting meter events that roll up into each billing period.
Create a meter
curl https://api.ledgerline.dev/v2/billing/meters \
-u "sk_test_51Kx…:" \
-d display_name="API requests" \
-d event_name=api_requests \
-d "default_aggregation[formula]"=sumReport usage
ledgerline.billing.MeterEvent.create(
event_name="api_requests",
payload={"customer_id": "cus_Qm8xT2vLp0aZ", "value": "25"},
)Pricing models
Model | Example |
|---|---|
Per unit | $0.002 per request |
Package | $5 per 10,000 requests |
Graduated tiers | First 1,000 free, then $0.001 |
Volume tiers | All units at the tier the total lands in |
Was this page helpful?