Skip to main content
This walkthrough takes you from an empty workspace to a subscribed customer whose usage is being metered. You need an Orvlin workspace and a user who can create API keys.
1

Create an API key

In the dashboard, create an API key. Choose the 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.
Every request below sends the key as Authorization: Bearer $ORVLIN_API_KEY.
2

Create a metric

A metric counts or sums matching events over a billing period. This one counts every api_call event.
Note the 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

If you omit 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

Subscriptions take the plan’s planId, not its name.
7

Send a usage event

The response lists the accepted event IDs. Re-sending the same idempotencyKey does not count the call twice.

Check what you’ve done

Ask Orvlin what the customer is entitled to:
The usage you sent shows up in the customer’s consumption. In production, call the SDK instead of raw HTTP. It caches answers so your request path never waits on the network. See Node SDK.

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.