Metered Billing Estimated Reading Time: 2 Minutes Metered billing allows you to charge customers based on actual usage, such as bandwidth, API calls, storage, or compute hours. Usage data can be pushed into Ubersmith in real time and automatically billed according to your pricing configuration. This guide walks through the full setup process. Overview Setting up metered billing involves four main steps: Create a meter Configure a metered plan Send usage events through the API Ubersmith calculates charges automatically Step 1: Create a Meter A meter defines what type of usage you want to track. To create a meter Navigate to Metered Billing under Settings. Click Get Started. Select Create Meter. Meter fields Field Description Meter name Internal name for the meter (not shown to customers). Event name Identifier used when sending usage events via the API. Aggregation method How usage is combined during the billing period (Sum, Count, Last Entry, Average, Max). Unit label Unit displayed to customers (e.g., GB, requests, hours). Example Field Value Meter name Bandwidth Event name bandwidth Aggregation Sum Unit label GB In this example, all usage events for bandwidth are summed for the billing period. Click Save to create the meter. Step 2: Create a Metered Plan A metered plan defines how customers are charged for the meter. To create a metered plan Go to a Service Plan Click Add metered plan under Usage plan - Metered Billing. Enter the Metered Billing plan details. Plan fields Field Description Metered Plan Name Name of the metered plan. Meter The meter this metered plan uses. Update Existing Services Optionally apply to existing services. Status Active or inactive. Configure tiered pricing You can define pricing tiers based on usage levels. From Up to Price per unit 1 10 $0.05 11 Unlimited $0.02 In this example: Units 1-10 are billed at $0.05 per unit Units 11+ are billed at $0.02 per unit Click Save to create the metered plan and attach it to the service plan. Step 3: Send Usage Events via the API Usage is recorded by sending events to the Ubersmith API. Example API parameters Parameter Value Description method uber.meter_add_event API method. brand_id 1 Brand ID. event_name bandwidth The meter event name. service_id 283 Service receiving the usage. value 1 Usage amount. Each API call records a usage event for the specified service. Example request method=uber.meter_add_event brand_id=1 event_name=bandwidth service_id=283 value=1 You can send these events: In real time On a schedule As batch uploads Step 4: Billing and Usage Calculation Once usage events are recorded: Ubersmith aggregates usage according to the meter's aggregation method. The system applies the configured pricing tiers. Charges appear automatically on the service's billing period. Example If a service records: 1.5 GB of bandwidth Pricing: $0.05 for first 10 units Then: Usage charge = $0.08 The usage subtotal is included in the service's total for the billing period. Best Practices Use clear, consistent event names. Keep unit labels simple and customer-friendly. Test usage events on a non-production service first. Use tiered pricing to encourage higher usage.