Usage based billing using ingested events
name
, which is a string that can be used to identify the type event. For example, ai_usage
, video_streamed
or file_uploaded
.customer_id
or external_customer_id
, which is the Polar’s customer ID or your user’s ID. This is used to identify the customer that triggered the event.metadata
object, 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.ai_usage
and sums the total_tokens
field.video_streamed
and sums the duration
field.file_uploaded
and sums the size
field.Enable Usage Based Billing
Create a Meter
Add metered price to a Product
Ingest Events
Customer Usage