---
title: "Meters and rate cards"
description: "Count the usage events your app sends with a meter, match them to customers with usage keys, and bill each model and token type from a rate card."
canonical_url: "https://twominutebilling.com/help/guides/usage-and-ai-billing/meters-and-rate-cards"
---
# Meters and rate cards

> Count the usage events your app sends with a meter, match them to customers with usage keys, and bill each model and token type from a rate card.

Your app sends a **usage event** each time something billable happens: a request served, a file
stored, tokens used. A **meter** says which events to count and how to count them. A **usage
price** on the meter bills what it counts, with a **rate card** that can set a different rate for
each combination of values, such as each model and token type.

Your developers send the events. Everything on this page, from the meter to the invoice, you set
up in the dashboard.

## Create a meter

<steps>

### Open the meters

In the business, open **Product Catalog → Meters** and select **Create meter**.

### Name it, or use the AI tokens setup

Enter a **Name**. The **Meter ID** is made from the name, and you cannot change it later.

To bill AI usage, select **Use the AI tokens setup**. It fills in the event name `ai_tokens`, the
**Sum** of the `tokens` property, and a group by `model` and `token_type`.

### Say what it counts

Under **What it counts**, enter the **Event name** that your app sends, then select the
**Aggregation**. Most aggregations also need a **Value property**: the event property that holds
the number, with up to 12 decimal places.

### Add filters and groups

Under **Filters and groups**, select **+ Add filter** to count only some events, for example only
the regions `eu` and `us`. An event counts only when each filter property has one of its values.
With no filters, every event with the event name counts.

Select **+ Add property** under **Group by** to keep a separate total for each value of a
property, up to 5 properties. A price on the meter can then set a rate for each combination.

### Create the meter

Select **Create meter**. The summary at the top tells you what the meter bills, for example "We
bill sum of tokens from "ai_tokens" events, for each model and token_type."

</steps>

<table>
<thead>
  <tr>
    <th>
      Aggregation
    </th>
    
    <th>
      The period bills
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Sum
      </strong>
    </td>
    
    <td>
      The total of the values
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Count of events
      </strong>
    </td>
    
    <td>
      The number of events. Events need no value
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Minimum
      </strong>
      
       / <strong>
        Maximum
      </strong>
    </td>
    
    <td>
      The lowest or highest value
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Average
      </strong>
    </td>
    
    <td>
      The total of the values divided by the number of events
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Last value
      </strong>
    </td>
    
    <td>
      The value of the last event
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Unique values
      </strong>
    </td>
    
    <td>
      The number of different values of one property, for example <code>
        user_id
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Time-weighted sum
      </strong>
    </td>
    
    <td>
      Each event sets a level. The level × the hours or days it stayed (<strong>
        Time unit
      </strong>
      
      )
    </td>
  </tr>
</tbody>
</table>

For **Sum**, **Last value**, **Maximum** and **Unique values**, you can turn on **Carry the level
to the next period**. Use it for seats or storage: the level stays until a new event changes it,
instead of starting again each period.

More than one meter can read the same events, and a new meter also counts the events that we
already keep. So you can add a meter after your app has started to send events.

<note title="A meter with usage keeps what it counts">

After the first event or the first price uses a meter, only its **Name** and its **Cost** section
can change. To count events in a different way, create a new meter.

</note>

## Match events to customers with usage keys

An event names its customer with a **usage key**: an id that your app already has, such as a
workspace, user or API key id. The customer id (`cus_…`) always works too.

Open the customer, find the **Usage keys** card and select **Add usage key**. A key can belong to
one customer only.

An event whose key no customer has is **not lost**. The meter page counts it under **Unmatched
events**. When you add the key to a customer, we match those events to the customer and bill them.
If their period has already been invoiced, they go on the next invoice as late usage (see below).

If you remove a usage key, new events with that key become unmatched. Events that we already
matched stay with the customer.

## Send a test event

On the meter page, select **Send test event**. Enter a usage key or customer id, and a value for
each property the meter reads. The dialog fills in a value that passes each filter.

<warning title="A test event is a real event">

It counts and bills like any other. If a subscription bills this meter for that customer, the
event goes on the next invoice. Send test events in test mode.

</warning>

The meter page shows:

- **Events in last 24 hours**, with a note when some events have no subscription that bills them
- **Unmatched events**: events whose usage key no customer has
- **Recent events**, with the event time, customer, value, properties, status and key. An event
in a different currency from the price says so.

## Bill the meter with a usage price

<steps>

### Add a price to a plan or add-on

Open the plan or add-on in **Product Catalog** and select **Add price**. Set **Billed** to
**Recurring**, then set **Pricing model** to **Usage**.

### Select the meter

In **Bill from a meter**, select the meter. Without a meter, a usage price bills the usage records
that you send for each subscription item instead.

### Select where the amount comes from

<table>
<thead>
  <tr>
    <th>
      <strong>
        Amount
      </strong>
    </th>
    
    <th>
      What we bill
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Rate from the rate card
      </strong>
    </td>
    
    <td>
      Quantity × rate, for each combination of group values
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Amount on each event
      </strong>
    </td>
    
    <td>
      The total of the <code>
        amount
      </code>
      
       property on the events, as sent
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Cost on each event, plus a markup
      </strong>
    </td>
    
    <td>
      The total of the <code>
        cost
      </code>
      
       property on the events, plus your <strong>
        Markup
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Bill from the model price list
      </strong>
    </td>
    
    <td>
      Each model at its list price or your cost, plus a markup. See <a href="https://twominutebilling.com/help/guides/usage-and-ai-billing/model-price-list">
        Bill from the AI model price list
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Reported cost, else the model price list
      </strong>
    </td>
    
    <td>
      The <code>
        cost
      </code>
      
       of each event that has one, plus a markup. Events without a cost bill from the model price list. See <a href="https://twominutebilling.com/help/guides/usage-and-ai-billing/model-price-list#bill-the-reported-cost-first">
        Bill the reported cost first
      </a>
    </td>
  </tr>
</tbody>
</table>

With **Amount on each event** or **Cost on each event**, an event whose amount or cost is in a
different currency from the price is not billed. With **Reported cost, else the model price list**,
such an event bills from the model price list.

### Fill in the rate card

Set **Rates are** to **Per unit**, **Per 1K units**, **Per 1M units** or a custom number of units.
AI models are usually priced per 1M tokens.

Enter the **Default rate**, then select **+ Add rate** for each combination that needs a different
rate. Leave a value as **Any** to match every value of that property.

### Create the price

Select **Create price**, and add it to subscriptions like any other price.

</steps>

### Which rate applies

Each combination of values takes the row that names the most values. When two rows name the same
number of values, the older row applies. A combination that no row names takes the **Default
rate**, so a new model still bills.

With the default rate at $3.00 per 1M tokens:

<table>
<thead>
  <tr>
    <th>
      Combination
    </th>
    
    <th>
      Row that bills it
    </th>
    
    <th>
      Rate per 1M
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      any model, <code>
        input
      </code>
    </td>
    
    <td>
      the default rate
    </td>
    
    <td>
      $3.00
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        small-v1
      </code>
      
      , <code>
        output
      </code>
    </td>
    
    <td>
      <code>
        token_type
      </code>
      
       is <code>
        output
      </code>
    </td>
    
    <td>
      $15.00
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        large-v2
      </code>
      
      , <code>
        output
      </code>
    </td>
    
    <td>
      <code>
        model
      </code>
      
       is <code>
        large-v2
      </code>
      
       and <code>
        token_type
      </code>
      
       is <code>
        output
      </code>
      
       (names more values)
    </td>
    
    <td>
      $24.00
    </td>
  </tr>
  
  <tr>
    <td>
      any model, <code>
        cached_input
      </code>
    </td>
    
    <td>
      <code>
        token_type
      </code>
      
       is <code>
        cached_input
      </code>
    </td>
    
    <td>
      $0.30
    </td>
  </tr>
</tbody>
</table>

Rates take up to 12 decimal places. You can change the rates later, and the change applies to new
subscriptions. The meter, **Rates are** and **Amount** are fixed when you create the price.

A customer can have one live subscription that bills a given meter. To bill it differently,
change that subscription.

<note>

The Usage pricing model bills quantity × rate. Tiered, volume and package pricing on a meter are
available through the API: see [Meter usage events](https://twominutebilling.com/help/developers/recipes/meter-usage-events).

</note>

## When usage closes

A meter line bills the exact period of the subscription. We close a period's usage about 6
minutes after the period ends, and the renewal invoice bills it then.

If your app holds events for some minutes before it sends them, add a wait under **Settings →
Billing rules → Usage close**. **Extra wait before usage closes** takes 0 to 24 minutes, and the
total wait is never more than 30 minutes. The change applies to periods that end from then on.

### Late usage

An event that arrives after its period closed is not lost. It goes on the next invoice as its own
line, "Usage from 1–31 Oct 2026: …", dated to its own period and priced as that period was. The
line shows only the units that arrived late.

## On the invoice

Each combination is one invoice line: the price name and the group values, for example "AI usage
monthly · small-v1 · input". The **Quantity** and **Unit price** columns show the exact figures,
decimals included, and the amount is rounded half-up to the minor unit once per line:

<table>
<thead>
  <tr>
    <th>
      Line
    </th>
    
    <th>
      Quantity
    </th>
    
    <th>
      Rate
    </th>
    
    <th>
      Amount
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      AI usage monthly · small-v1 · input
    </td>
    
    <td>
      1,234,567
    </td>
    
    <td>
      $3.00 per 1M
    </td>
    
    <td>
      370.3701¢ → <strong>
        $3.70
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      AI usage monthly · small-v1 · output
    </td>
    
    <td>
      456,789
    </td>
    
    <td>
      $15.00 per 1M
    </td>
    
    <td>
      685.1835¢ → <strong>
        $6.85
      </strong>
    </td>
  </tr>
</tbody>
</table>

Total: **$10.55**. Under each meter line, select **Price source** to see the rate that billed it
and where the rate came from: the rate card, a fixed rate or the default rate.

## Correct an event

The dashboard shows events but does not change them. Your developers can void an event through the
API until an invoice that bills its period is finalized, then send a replacement with a new key.
After the invoice is finalized, issue a credit note instead. See
[Invoices and credit notes](https://twominutebilling.com/help/guides/invoices-and-credit-notes).

## Archive a meter

On the meter page, open **More** and select **Archive meter**. You cannot archive a meter while a
subscription or an active price bills from it: remove or archive that price first. After you
archive it, you cannot add a price on it, and it continues to count events for periods that are
open now.

## Related

- [Usage pricing](https://twominutebilling.com/help/guides/usage-and-ai-billing/usage-pricing)
- [Bill from the AI model price list](https://twominutebilling.com/help/guides/usage-and-ai-billing/model-price-list)
- [Prepaid credits](https://twominutebilling.com/help/guides/usage-and-ai-billing/prepaid-credits)
- [Meter usage events with the API](https://twominutebilling.com/help/developers/recipes/meter-usage-events)
- [Bill AI tokens with the API](https://twominutebilling.com/help/developers/recipes/bill-ai-tokens)


## Sitemap

See the full [sitemap](https://twominutebilling.com/sitemap.md) for all pages.
