Once you have defined your Product, the next step is to determine what you will measure and charge for. This is done using Billable Metrics.

What is a Billable Metric?

A Billable Metric represents a quantifiable unit of usage or outcome related to your Product that you intend to bill your Customers for. Every billable metric belongs to a specific product and defines the unit of consumption. Examples include:
  • API requests made
  • Gigabytes transferred
  • CPU hours consumed
  • Tokens processed (input/output)
  • Reports generated
  • Seats occupied
  • Successful transactions
Essentially, if you want to charge for something based on how much of it a Customer uses or achieves, you need to define it as a Billable Metric.

Metric vs. Price

It’s crucial to understand that a Billable Metric itself does not define a price. It only defines what is being measured. A billable metric defines what you measure (e.g., API requests), while a price defines how much you charge per unit of that metric (e.g., $0.001 per API request). The actual cost is defined later when you create Prices and group them into Plans. A single Billable Metric can have different Prices in different Plans.

Details

When creating a billable metric, you need to specify the product ID it belongs to, a short descriptive name (e.g., API Requests, Input Tokens) that might be shown to customers, and a brief description of what the metric represents. You’ll also define the unit of measurement (e.g., requests, tokens, GB, hours) for display purposes on invoices and dashboards, and the aggregation method for the billing period. Currently, only SUM aggregation is supported, which means Paygentic will sum up all reported quantities for this metric within the billing period to calculate total usage.

Example: LLM Token Billing

Imagine you’re monetizing an LLM service. You want to charge differently for input tokens and output tokens.
  1. Product: You have a Product named “My LLM Service”.
  2. Billable Metrics: You would create two separate Billable Metrics associated with this Product:
    • Metric 1:
      • name: Input Tokens
      • unit: tokens
      • aggregation: SUM
    • Metric 2:
      • name: Output Tokens
      • unit: tokens
      • aggregation: SUM
Later, when creating a Plan, you would define separate Prices for each of these Billable Metrics (e.g., $0.000001 per Input Token and $0.000002 per Output Token). With your Billable Metrics defined, the next step is to set their cost using Plans and Prices.