# Units & pricing

> How Wayline counts billable units per endpoint, which responses are billed, how free units are consumed and how monthly billing through Paddle works.

Source: https://www.wayline.cloud/docs/concepts/units-and-pricing

Wayline bills in **units**. Each endpoint has a unit price in USD, shown on the [pricing page](/pricing) both per request and per 1,000.

## Units per endpoint

| Endpoint | Units charged |
|---|---|
| `GET/POST /v1/distance` | 1 per request |
| `GET/POST /v1/route` | 1 per request (any number of waypoints) |
| `POST /v1/distance/batch` | 1 per consecutive pair (points − 1) |
| `POST /v1/matrix` | origins × destinations |
| `GET /v1/nearest` | 1 per request |
| `GET /maps/api/distancematrix/json` | origins × destinations |
| `GET /v1/geocode`, `GET /v1/reverse-geocode` | 1 per request |
| `POST /v1/reverse-geocode/batch` | 1 per point inside coverage |
| `POST /v1/optimize` | 1 per stop |
| `GET/POST /v1/staticmap` | 1 per image (`static_map`), cached or fresh |
| `GET /v1/tiles/{z}/{x}/{y}.png` | 1 per tile (`map_tile`) |

Every response includes the `X-Units-Charged` header and a `units_charged` field.

## What is billed

- **Only HTTP 2xx responses.** 4xx and 5xx errors are never billed.
- **Cache hits are billed like fresh results** (you still get a correct answer).
- **Matrix cells with `NO_ROUTE`** are part of the requested matrix and count toward its size.
- **Test keys are never billed.**

## Current prices

## Free units

New accounts receive free units. Free units are consumed before paid usage, across all endpoints, earliest-expiring first.

## Billing cycle

Usage is billed monthly in arrears for each calendar month in UTC, through Paddle (merchant of record), which also calculates sales tax/VAT and issues invoices. Account states:

| State | Meaning |
|---|---|
| `free_only` | Using free units, no payment method yet. |
| `billable` | Payment method on file; usage beyond free units is billed. |
| `past_due` | A payment failed; requests still work during a grace period. |
| `suspended` | Unpaid balance; requests return `402 PAYMENT_REQUIRED`. |

You can set a monthly spend limit. When it is reached, requests return `402 SPEND_LIMIT_REACHED`.
