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

# Price usage

> Price transform events from a price list, a fixed unit price, or a cost on the event

Every event a transform accepts needs a cost. You choose where it comes from on
the transform's **Cost** tab. Until you do, the transform shows **Set a cost for
these events.** with an **Open Cost** button, and you can't save.

## Choose a cost source

**1. Open the Cost tab**

On the transform, click **Cost**, or click **Open Cost** in the banner.

**2. Pick the source**

In **Cost source**, select **From the price list**, **Fixed price**, or **From
the event**. Refer to [Cost sources](#cost-sources).

**3. Fill in the fields**

Enter the fields for that source. The preview prices your sample event and
the banner says **Ready to save** when the cost resolves.

**4. Save**

Click **Save transform**.

## Cost sources

| Source | Use it when | Cost of each row |
| - | - | - |
| **From the price list** | The usage is tokens, compute, disk, or database time that CostGraph has prices for. | `PricingQuantity` times the matching price. |
| **Fixed price** | You charge or pay one rate per unit. | `PricingQuantity` times **Price per unit**. |
| **From the event** | Your gateway or provider already reports what the event cost. | The value of the **Cost** expression, such as `event.data.cost`. |

Price list and fixed prices are in US dollars. If you map `BillingCurrency` to
another currency, use **From the event** instead.

## Price list

The price list covers AI models, compute, disks, and databases. CostGraph uses
your organization's prices first, then the public price list, at the rate on the
day the usage happened.

* **Price list** selects the kind of usage.
* **Rate** selects which price to apply, such as the price per million tokens.
  Send `PricingQuantity` in the unit the hint names.
* The fields that identify the price, such as the provider and model for AI
  models, take an expression over the event or a quoted constant like `'openai'`.
  **Optional fields** lists fields that have a default.
* **Price if nothing matches** prices usage that no price matches. Leave it empty
  to reject that usage instead. Rejected events appear on
  [Recent events](https://docs.costgraph.ai/costgraph/integrations/transforms/recent-events.md).

When the fields match more than one price, the event is rejected with an error
that names the field to set.

## Next steps

> [card] [Send usage](https://docs.costgraph.ai/costgraph/integrations/transforms/send.md)
>
> Point your service, Collector, or Prometheus at the transform.


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