---
title: Meter Rates (Cost Calculation)
slug: meter-rates-cost-calculation
docTags: 
createdAt: 2026-04-20T16:51:58.490Z
---

Meter rates define how usage is converted into **cost**.

This page explains how to configure cost rates on a meter so that all incoming usage can be translated into accurate spend.

This assumes you have already created one or more meters.

## How Meter Rates Work

When usage is ingested into a meter, Amberflo:

1. Matches the usage to a **meter**
2. Applies a **rate** defined on that meter
3. Calculates the resulting **cost**

The rate is the rule that determines how each unit of usage is valued.

Rates can change over time. When they do, you create a new rate configuration and apply it going forward.

## Navigate to Meter Rates

1. Go to **Cost → Configure → Meters**
2. Select the meter you want to configure
3. On the meter details page, click the **Rate** tab (middle tab)
4. Click **Create Meter Rate** (top right)

## Create a Meter Rate

### Basic Fields

- **Label**
  A name for the rate configurationSince rates may change over time, use a label that reflects the version or context.
  Examples:
  - OpenAI Pricing - Jan 2026
  - v1 Cost Rates
  - GPT Model Pricing Q1
- **Description (optional)**
  Add context about what this rate represents

## Choose a Rate Model

Amberflo supports two primary models for cost calculation.

### 1. Per Unit

Each unit of usage has the same cost.

**Example:**

- Every API call costs $0.005
- Every job execution costs $0.10

This model is appropriate when cost does not vary based on context.

### 2. Per Unit with Dimensions (Recommended)

Cost varies based on attributes of the usage.

This is the standard approach for most real-world systems.

**Why Use Dimensions**

In many systems, cost is not uniform. It depends on factors such as:

- Type of operation
- Resource used
- Configuration of the request

For example, with token-based usage:

- **Input tokens** and **output tokens** have different costs
- Different **models** have different pricing

These differences are captured using dimensions.

## Build the Rate Table

When using **Per Unit with Dimensions**, you define a table of rates.

- Each **column** represents a dimension
- Each **row** represents a unique combination of dimension values
- Each row has a **per-unit cost**

### Example Structure

If your meter includes:

- model
- token\_type

Your table might include rows like:

- model = A, token\_type = input → cost X
- model = A, token\_type = output → cost Y
- model = B, token\_type = input → cost Z

Each combination can have a different cost.

## Configuring the Table

- Remove any dimensions that are not relevant to cost calculation
  (for example, workload is typically used for attribution, not pricing)
- Use **Add Row** to define new combinations
- Use **Add Column** if you need to include additional dimensions

For each row:

1. Set the dimension values
2. Enter the corresponding **cost per unit**

## Automation Options

You do not need to configure rates manually in the UI.

Amberflo supports:

- **API-based configuration**
- **CSV import**

This allows you to:

- Sync rates from external pricing sources
- Update rates programmatically
- Manage large pricing tables efficiently

## Saving and Applying Rates

Once your rate configuration is complete:

- Click **Save**

From that point forward:

- All new usage events for that meter will use this rate configuration
- Cost will be calculated automatically based on the defined rules

## Updating Rates Over Time

Rates change. When they do:

1. Create a **new meter rate**
2. Use a clear label to indicate the new version
3. Apply it going forward

Do not overwrite previous configurations if you need historical accuracy.

## Summary

Meter rates are the foundation of cost calculation in Amberflo.

They:

- Define how usage translates into cost
- Support both simple and complex pricing logic
- Allow variation based on dimensions
- Can be managed manually or programmatically

Accurate rates ensure that your cost data reflects the real behavior of your systems.
