> ## Documentation Index
> Fetch the complete documentation index at: https://getlago.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Metered products

> Bill usage measured by a billable metric and priced through a Rate Card.

A metered product bills a quantity measured from events: a [billable metric](https://getlago.com/docs/v2/guide/billable-metrics/create-billable-metrics.md) aggregates the events sent to a contract, and the product's rate turns that quantity into an amount. Use it for anything you charge by consumption, such as API calls, compute hours or transferred GiB.

## How it fits together

* The **billable metric** turns events into a quantity. It does not set a price.
* The **product** (`product_type: "metered"`) names what you sell and references the metric with `billable_metric_code`. Neither can change after creation.
* The **rate card** and its **rate** price the quantity.
* Optional **[product filters](https://getlago.com/docs/v2/guide/product-catalog/product-filters.md)** split the usage into subsets with their own rate cards.

The metric's aggregation type limits which rate models you can use. For example, `dynamic` requires a SUM metric. See the [availability matrix](https://getlago.com/docs/v2/guide/rate-cards/pricing-models/overview.md#metered-products).

## Example

`api_calls_product` uses the `api_calls` COUNT metric: one matching event is one call.

| Product | Rate | Quantity | Period | Amount before tax |
| - | - | - | - | - |
| API calls | `standard`, `amount: "0.01"`, 1 month | 2,000 calls | Full month | \$20.00 |

$0.01 × 2,000 = $20. When reconciling, check the measured units and the applied rate, not only the amount.

## Set up a metered product

Create the billable metric first. Then:

> [tab] Dashboard
>
> 1. Create a product with **Type** metered, **Code** `api_calls_product`, **Billable metric** `api_calls` and **Product category** `api_services`.
>
> 2. Create a rate card `api_calls_usd` for this product: USD, arrears, proration off.
>
> 3. Add a standard rate `calls_standard` with an amount of 0.01 and a billing interval of 1 month.
>
> 4. Apply the rate card to the plan `api_monthly`.
>
> > [!NOTE]
> >
> > The fields match the API. Screen-by-screen Dashboard steps are not documented yet.

> [tab] API
>
> ```bash 1. Create the metered product theme={"dark"}
> LAGO_URL="https://api.getlago.com"
> API_KEY="__YOUR_API_KEY__"
>
> curl --location --request POST "$LAGO_URL/api/v2/products" \
>   --header "Authorization: Bearer $API_KEY" \
>   --header 'Content-Type: application/json' \
>   --data-raw '{
>     "product": {
>       "name": "API calls",
>       "code": "api_calls_product",
>       "product_type": "metered",
>       "billable_metric_code": "api_calls",
>       "product_category_code": "api_services"
>     }
>   }'
> ```
>
> ```bash 2. Create the rate card and rate theme={"dark"}
> curl --location --request POST "$LAGO_URL/api/v2/rate_cards" \
>   --header "Authorization: Bearer $API_KEY" \
>   --header 'Content-Type: application/json' \
>   --data-raw '{
>     "rate_card": {
>       "name": "API calls USD",
>       "code": "api_calls_usd",
>       "product_code": "api_calls_product",
>       "currency": "USD",
>       "billing_timing": "arrears",
>       "proration": false,
>       "rates": [
>         {
>           "code": "calls_standard",
>           "effective_from": "2027-01-01T00:00:00Z",
>           "rate_model": "standard",
>           "rate_properties": { "amount": "0.01" },
>           "billing_interval_count": 1,
>           "billing_interval_unit": "month"
>         }
>       ]
>     }
>   }'
> ```
>
> ```bash 3. Apply it to the plan theme={"dark"}
> curl --location --request POST "$LAGO_URL/api/v2/plans/api_monthly/applied_rate_cards" \
>   --header "Authorization: Bearer $API_KEY" \
>   --header 'Content-Type: application/json' \
>   --data-raw '{
>     "applied_rate_card": {
>       "rate_card_code": "api_calls_usd"
>     }
>   }'
> ```

Once a contract uses the plan, send events with `external_contract_id` (see [usage ingestion](https://getlago.com/docs/v2/guide/events/ingesting-usage.md)) and follow the running total with [current usage](https://getlago.com/docs/v2/guide/events/retrieve-usage.md#retrieve-current-usage).

## Add filters

The running example has no filters. To price usage by region, declare a `region` dimension on the billable metric, create filters on the product, and give each filter its own rate card. Keep a filtered variation separate from the unfiltered 2,000-call baseline so the quantities do not mix. See [product filters](https://getlago.com/docs/v2/guide/product-catalog/product-filters.md).

> [card] [Product filters](https://getlago.com/docs/v2/guide/product-catalog/product-filters.md)
>
> Price subsets of metered usage.

> [card] [Pricing models](https://getlago.com/docs/v2/guide/rate-cards/pricing-models/overview.md)
>
> Which rate models fit which metric.

> [card] [Create a product](https://getlago.com/docs/v2/api-reference/products/create.md)
>
> `POST /products`

> [card] [Create a rate card](https://getlago.com/docs/v2/api-reference/rate-cards/create.md)
>
> `POST /rate_cards`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.