Usage Based Billing
Frame provides a comprehensive billing and metering platform designed to handle complex pricing models, usage tracking, and invoice generation for SaaS and subscription and quota based businesses. The system is event-driven: merchants send Billing Metric Events to Frame, Frame aggregates usage, and invoices or credit consumption is computed based on subscription or plan configuration.
Key concepts
Frame's billing system is built around several core concepts that work together to provide flexible billing solutions:
- Billing Metric: Definition of a billable action, such as when a customer submits a reasoning task to an AI model.
- Billing Metric Event: A discrete event representing a single occurrence of a billing metric.
- Aggregation: The process of grouping and summing billing metric events over time periods.
- Aggregation Types
sum: Total of all valuescount: Number of eventscount_unique: Number of unique valuesaverage: Average value across events
- Aggregation Types
- Billing Report: A summary of usage and billing activity for a given period.
- Billing Invoice: A document that itemizes charges for services or products delivered.
- Billing Credits: Credits that are pre-purchased and deducted as usage occurs.
- Billing Product: An extension of the current Product that represents a subscription or plan.
- Billing Product Detail: A model that holds the details of a billing Product (e.g., its type, perks, cycles, etc.)
Billing models
Frame supports several billing models to accommodate different business needs:
- Prepaid Billing: Payment is collected before customer usage occurs.
- Postpaid Billing: Payment is collected after customer usage is measured.
- Trueup Billing: Customers commit to a particular usage amount and are billed for overages.
- Rollover Billing: Unused prepaid quota is carried over to the next billing period.
- Overage Billing: Customers are charged for usage that exceeds their prepaid quota.
Billing Lifecycle
The billing lifecycle encompasses the following stages:
- Create Billing Metrics
- Send Billing Metric Events
- Frame aggregates usage
- Credits and subscription rules apply
- Invoice generated
- Webhooks fire