> ## 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.

# Package rate model

> Apply a fixed price to each package of units.

Package pricing applies a fixed price to a group of units, such as 100 API calls. Use it when you sell usage in packages.

## How it works

A package has a size (`package_size`) and a price (`amount`). Lago subtracts `free_units` from the measured quantity, then rounds the remaining quantity up to whole packages. The fee is the number of packages × `amount`. If the quantity does not exceed the free units, the fee is zero.

## Availability

* Fixed Products: not available.
* Metered Products: available for Count, Count unique, Latest, Max, Sum and Weighted sum, except when metrics use `recurring: true` with proration. Advance billing is available only for Count, non-prorated Count unique and non-prorated Sum.

See the [availability matrix](https://getlago.com/docs/v2/guide/rate-cards/pricing-models/overview.md#model-availability).

## Configure the rate

Set `rate_model` to `package`. `rate_properties` takes:

| Field | Required | Description |
| - | - | - |
| `amount` | Yes | Price of one package, as a decimal string. |
| `package_size` | Yes | Units in one package, as an integer. |
| `free_units` | No | Free units per billing period, as an integer. |

```bash Create a package rate theme={"dark"}
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"

curl --location --request POST "$LAGO_URL/api/v2/rate_cards/api_calls_usd/rates" \
  --header "Authorization: Bearer $API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "rate": {
      "code": "calls_package",
      "effective_from": "2027-07-01T00:00:00Z",
      "rate_model": "package",
      "rate_properties": {
        "amount": "1",
        "package_size": 100,
        "free_units": 0
      },
      "billing_interval_count": 1,
      "billing_interval_unit": "month"
    }
  }'
```

## Example

This example prices 2,000 calls over one full monthly billing period in USD. Each package contains 100 calls and costs 1 USD. It uses no free units, proration or spending minimum:

| Quantity | Packages | Calculation | Amount before tax |
| - | - | - | - |
| 2,000 calls | 20 | 20 × 1.00 USD | 20.00 USD |

The 2,000 calls fill exactly 20 packages, giving a calculated fee of 20 USD before tax. This example uses complete packages and no free units.

For example, with 50 free calls, packages of 100 calls and a package price of 1 USD, 200 calls leave 150 billable calls. Lago rounds these up to two packages, for a fee of 2 USD before tax.

## Check the result

For the complete-package example above, divide the quantity by the package size and multiply the package count by its price. Use [Contract current usage](https://getlago.com/docs/v2/guide/events/retrieve-usage.md#retrieve-current-usage) to inspect provisional values. See [Rates](https://getlago.com/docs/v2/guide/rate-cards/rates.md#check-which-rate-was-used) to check which Rate applies.

> [card] [Standard](https://getlago.com/docs/v2/guide/rate-cards/pricing-models/standard.md)
>
> One unit price.

> [card] [Pricing models](https://getlago.com/docs/v2/guide/rate-cards/pricing-models/overview.md)
>
> Compare every rate model.

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

> [card] [The rate object](https://getlago.com/docs/v2/api-reference/rates/object.md)
>
> `rate_properties` fields.


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