Create meters
Learn how to create a meter to record customer usage data.
Meters specify how to aggregate meter events over a billing period. Meter events represent all actions that customers take in your system (for example, API requests). Meters attach to prices and form the basis of what’s billed.
For the Alpaca AI example, meter events are the number of tokens a customer uses in a query. The meter is the sum of tokens over a month.
You can use the Stripe Dashboard or API to configure a meter. To use the API with the Stripe CLI to create a meter, get started with the Stripe CLI.
- On the Meters page, click Create meter.
- On the Create meter page, do the following:
- For Meter name, enter the name of the meter to display and for organization purposes. For the Alpaca AI example, enter “Alpaca AI tokens.”
- For Event name, enter the name to display in meter events when reporting usage to Stripe. For the Alpaca AI example, enter “alpaca_ai_tokens.”
- Set the approproriate Aggregation method in the dropdown:
- For the Alpaca AI example, select Sum. This will sum the values reported (in this example, number of tokens a customer uses) to determine the usage to bill for.
- Choose Count to bill based on the number of events reported.
- Choose Last to bill based on the last value reported.
- Use the preview pane to set example usage events and verify the aggregation method.
- Click Create meter.