# How usage is metered

What the platform records about your usage, when, and how the records become budgets, reports and invoices.

Billing runs nothing on your machines. The platform records usage from what it runs for you, and
every view of your costs is summed from those records.

## The usage record

Each record names the resource, the priced item (SKU), the quantity and unit, the unit price and the
amount in EUR, the billing period, and when the usage started and ended. A machine with a monthly
cap also keeps what the hour would have cost without the cap. A record of a meter that is not
charged yet carries what it would have cost, and an amount of €0.

There is no API that writes usage: prices are always taken from the price list for the moment the
usage happened, never from a request.

## When usage is recorded

| What                    | When                                                                                                                                                    |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Machines                | Every full hour, one hour for each machine that exists then: running instances, and the nodes of a managed database, also while the database is stopped |
| Stored data and traffic | Once a day                                                                                                                                              |
| Pay-per-use meters      | As the service counts them                                                                                                                              |

An hour of a machine appears in your costs shortly after it ends; the **Cost** card of a resource
says when its first hour will be billed.

## What reads the records

| Reader                    | When                                       | Sees                                       |
| ------------------------- | ------------------------------------------ | ------------------------------------------ |
| Budgets                   | Every hour, at five minutes past           | The current period's records in each scope |
| Cost explorer             | When you open it                           | The records of the window, in UTC days     |
| **Usage**, **Cost** cards | When you open them                         | The current billing period, in German time |
| Invoice                   | On the 1st of the month, 06:00 German time | The month before, in German time           |
| Monthly cost report       | On the 2nd of the month, 08:00 German time | The month before                           |

Because they all sum the same records, a budget says the same in its e-mail as on the **Budgets**
page, and the net of a month in the cost explorer's **Credits and discounts** is computed the same
way as the invoice's credit lines.

## Related

- [How you are charged](how-you-are-charged.md)
- [Budgets](budgets.md)
