
The usage endpoint is strictly rate limited by default. Get in touch with our team to access higher rate limits.
Quick start
1. Create a few usage events for a customer:- Head to the Usage > Events section in the dashboard and click “New usage event”
- Select a a customer to assign this event to, and pick the event timestamp to be sometime in the past, e.g. last month
- Pick an event type, (e.g. “api_call”) and optionally add some event properties as key-value pairs
- Repeat the last step a few times to generate a few test events. You will see them appear on the events table
- From Usage > Metrics, click “New usage metric”
- Give the metric a name (e.g. “API calls”) and optionally a description
- Select the event type you defined in step 1 from the drop-down, and select “Count of usage values” as the aggregation type
- After adding the usage metric, select it from the Metrics table to enter the preview window
- Select the customer the customer that you generated events for in step 1, and pick a time window to calculate the metric over
- Click “Calculate”. The preview will show the number of usage events found for the given customer in the selected time window
- From the Schedules tab, click “New schedule”
- Select your customer, and add a new product to the schedule by clicking “Add product > Create new”
- Select “Linear” as your pricing model
- Give this product a name (e.g. “API usage”) and select the metric you created in step 2 as the “Usage metric”
- Pick a price per unit, which is the amount to be charged for each usage event
- Select a start date in the past for the billing schedule, covering the period you generated events for. Click “Start schedule”
- Navigate to the Invoices tab to see the backdated invoices for the billing schedule you just created
- Click on one of the invoices to see a usage chart and the associated charges
- 🎉