1
Create an API key
In the dashboard, create an API key. Choose the Every request below sends the key as
developer role if the key will send usage, or viewer if it only checks entitlements. See API keys for every role.The secret is shown once. Store it in your secret manager.Authorization: Bearer $ORVLIN_API_KEY.2
Create a metric
A metric counts or sums matching events over a billing period. This one counts every Note the
api_call event.id in the response. You need it for the price.3
Create a price
A price charges for a metric. This one is a unit price of $0.001 per call, billed monthly in arrears.See Pricing models for the other ways to charge.
4
Create a plan
A plan bundles prices that customers subscribe to.Note the plan
id.5
Create a customer
id, Orvlin generates one (cust_…). Supplying your own ID lets you use the same identifier in your application.6
Subscribe the customer to the plan
planId, not its name.7
Send a usage event
idempotencyKey does not count the call twice.Check what you’ve done
Ask Orvlin what the customer is entitled to:Next steps
Usage metering
Batch events, choose properties, and design event names.
Entitlements
Gate features in your application.
Webhooks
Get notified when invoices are paid or subscriptions change.
Define pricing as code
Keep your metrics, prices, and plans in a
pricing.yaml file.