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

# Billing System

> Understanding products, rate plans, charges, and billing cycles

## Billing System

You create a `product` to represent what you're selling. Each `product` is connected to an `agent type`, which defines what kind of AI service it represents.

### Products and Rate Plans

Each `product` is associated with `rate plans`. A `rate plan` defines how customers are charged for that product. You might have a Basic plan, a Pro plan, and an Enterprise plan for the same product. Each `rate plan` has its own `currency`, so you can charge different customers in different currencies.

### Charges and Charge Models

Each `rate plan` can have multiple `charges`. A `charge` is a specific line item that customers are billed for. Each `charge` is associated with a `charge model`, which is the pricing model that determines how the charge is calculated.

For example, you might have a charge for `@outcome` using a `per-unit pricing` model that charges \$50 per outcome. Or you might have a charge for `@action` using a `tiered pricing` model with different rates at different volume levels.

### Billing Cycles

`Billing cycles` define when customers are charged. You can set up monthly, quarterly, or annual billing cycles. Usage is aggregated over the billing cycle period, and invoices are generated at the end of each cycle.

### Proration

When customers change their subscription mid-cycle, charges are prorated automatically. If they upgrade from a \$100 plan to a \$200 plan halfway through the month, they pay \$50 for the first half and \$100 for the second half.

### Simulate Charge

When adding charges to a `rate plan`, you can simulate how the charge will work before saving it. The simulation shows you what revenue and costs would look like over a date range based on the charge model you're configuring.

You provide a date range and the charge details you want to test. The system calculates what the charges would be for that period and shows you the revenue and cost breakdown day by day. This helps you understand if your pricing is set up correctly before you commit to it.

For example, if you're adding a new charge for `@outcome` with `per-unit pricing` at \$50 per outcome, you can simulate it to see how much revenue you'd generate if customers achieved 100 outcomes in a month versus 500 outcomes.

### Discounts

You can also configure discounts on charges. These are applied automatically when invoices are generated.
