1. Overview
The Billing Metric module allows you to define and track billable business metrics such as API requests, storage usage, or AI token consumption.The redesigned interface introduces template-based configuration, real-time previews, and clear contextual guidance to make metric setup faster and more intuitive.
π― Key Benefits
- Lower learning curve β friendly field names and contextual explanations
- Faster onboarding β quick-start templates for common billing use cases
- Instant validation β live event and aggregation previews
- Standardized model β consistent flow: Event β Metric β Aggregation β Billing

2. Navigation
Access this module from the sidebar:Product β Billable MetricThe main list view displays all existing metrics, including:
- Metric Name & Code
- Aggregation Type (Count / Sum / Max / Unique)
- Charge Type (Charge Metered / Charge Recurring)
- Last Updated
- Actions (βοΈ Edit / π Delete)


3. Create a New Metric
Click β+ New Metricβ to open the metric creation page.3.1 Quick Templates
Predefined templates are provided for common billing scenarios.Selecting a template will auto-fill key fields, but you can freely modify them.
| Template | Purpose | Aggregation | Unit |
|---|---|---|---|
| API Requests | Track API calls | Count | requests |
| LLM Tokens | Track token usage | Sum | tokens |
| Worker Duration | Track task duration | Sum | ms |
| Storage GB | Track storage usage | Max | GB |
| Emails Sent | Track sent emails | Count | emails |
| Unique Users | Track active users | Unique | users |
| Custom | Fully blank configuration | any | custom |

3.2 Basic Information
| Field | Description | Required |
|---|---|---|
| Name | Human-readable name (e.g. API Requests) | β |
| Code / Slug | Unique identifier generated from the name (editable) | β |
| Description | Optional explanation of the metric purpose | |
| Metric Type | Limit / Charge Metered / Charge Recurring | β |
| Unit | Unit of measure (e.g. requests, tokens, GB, ms) | β |
π‘ The Slug auto-generates from the Name and must be unique.
3.3 Event & Aggregation
| Field | Description |
|---|---|
| Aggregation | Defines how data is summarized: Count / Sum / Max / Min / Unique Count |
| Value Property | Numeric field path, required for Sum/Max/Min types |
| Distinct By | Used for Unique Count (e.g. user_id) |
| Labels to Group By | Split usage by dimensions (e.g. region, plan, customer_id) |
Right-Side Preview Panel
- Event Example: Live JSON event structure based on your form inputs
- Aggregation Preview: Displays example calculations (e.g.
1 + 2 + 3 = 6ormax(10, 20, 30) = 30) - Quick Snippet: Auto-generated cURL / SDK example for developer use
- Test It: Simulate an event and preview real-time calculation results
Highlight the right-side panels in color (Event Example β green, Aggregation Preview β blue, Quick Snippet β yellow).



