Overview
Metering lets you track how your customers use your application. You ingest events from your application, and Meters aggregate those events into usage per customer. You can then use that usage to:- Charge customers for it with metered prices
- Grant usage credits that are consumed as usage comes in
- Show customers their usage and estimated charges in the Customer Portal
Concepts
Events
Events are the core of Usage Based Billing. They represent some usage done by a customer in your application. Typical examples of events are:- A customer consumed AI LLM tokens
- A customer streamed minutes of video
- A customer uploaded a file to your application
- A
name, which is a string that can be used to identify the type of event. For example,ai_usage,video_streamedorfile_uploaded. - A
customer_idorexternal_customer_id, which is Polar’s customer ID or your user’s ID. This is used to identify the customer that triggered the event. - A
metadataobject, which is a JSON object that can contain any additional information about the event. This is useful for storing information that can be used to filter the events or compute the actual usage. For example, you can store the duration of the video streamed or the size of the file uploaded.
Meters
Meters are there to filter and aggregate the events that are ingested. Said another way, this is how you define what usage you want to charge for, based on the events you send to Polar. For example:- AI usage meter, which filters the events with the name
ai_usageand sums thetotal_tokensfield. - Video streaming meter, which filters the events with the name
video_streamedand sums thedurationfield. - File upload meter, which filters the events with the name
file_uploadedand sums thesizefield.
Metered Price
To charge customers for their usage, add a metered price based on a meter to a Product. See Usage-Based Pricing.Meter Credits benefit
You can give credits to your customers on a specific meter. This is done by creating a Meter Credits Benefit, which is a special type of benefit that allows you to give credits to your customers on a specific meter. On a recurring product, the customer will be credited the amount of units specified in the benefit at the beginning of every subscription cycle period — monthly or yearly.Quickstart
Get up and running in 5 minutes1
Create a Meter
Meters consist of filters and an aggregation function.
The filter is used to filter the events that should be included in the meter and the aggregation function is used to compute the usage.



2
Add metered price to a Product
Only needed if you want to charge for usage. Add a metered price to the Product to bill customers based on the meter. Metered prices are only applicable to Subscription Products.



3
Ingest Events
Now you’re ready to ingest events from your application. Sending events which match the meter’s filter will increment the meter’s usage for the customer.



4
Customer Usage
Customers can view their estimated charges for each meter in the Customer Portal.




