# Billing

> The VMs of a tenant use its prepaid credit. Awake, a VM pays for its memory and its disk. Asleep, it pays for its disk only.

## Endpoints

| Method | Path | Returns |
|---|---|---|
| `GET` | [`/v1/tenants/{tenant}/usage`](https://shako.dev/api/billing/usage.md) | 200 with the usage object. |
| `GET` | [`/v1/tenants/{tenant}/credit`](https://shako.dev/api/billing/credit.md) | 200 with the credit object. |
| `POST` | [`/v1/tenants/{tenant}/credit/top-up`](https://shako.dev/api/billing/top-up.md) | 201 with the top-up object. |
| `GET` | [`/v1/tenants/{tenant}/invoices/{month}`](https://shako.dev/api/billing/invoice.md) | 200 with the invoice object. |

## Objects

- [The usage object](https://shako.dev/api/objects/usage.md): The usage of the VMs of the tenant, and the totals. A cost is in US dollars.
- [The credit object](https://shako.dev/api/objects/credit.md): The prepaid credit of the tenant. Each amount is a string of US dollars to the cent.
- [The top-up object](https://shako.dev/api/objects/credit-top-up.md): A Stripe payment page.
- [The invoice object](https://shako.dev/api/objects/invoice-file.md): A PDF invoice.
