# Billing and charges

The API is free to call. The work it causes is charged to your prepaid balance.

Calling the API costs nothing. A few actions do work that Valeron charges for, exactly as they do in the app. Your organization has one prepaid balance, and charges come out of it.

## What costs money

| Action | Charge |
|---|---|
| `POST /v1/analyses` | **$0.014 per started minute** of the call, charged as `call_analysis` when the analysis is stored. |
| `POST /v1/recordings/{recording_id}/reanalyze` | Charged to your balance again, as a new analysis version. |
| `POST /v1/threads/{thread_id}/messages` | A text you send is charged as it is in the app. |

Everything else, including reading data, writing contacts, companies, tasks, notes and payments, and managing webhooks, is free.

## How minutes are counted

A started minute is billed in full, so a call of 61 seconds is 2 minutes. For `POST /v1/analyses` the minutes come from `duration_seconds`, or, if you leave it out, from the `end_seconds` of the last transcript segment. With neither, the request fails with `422 duration_required`.

A 21 minute call (1,260 seconds) costs 21 × $0.014 = **$0.294**.

## When the balance is too low

Valeron checks the balance before it accepts a call. `POST /v1/analyses` returns `402 insufficient_balance` when the balance is under the price of the whole call, so nothing is accepted that would then be skipped. `POST /v1/recordings/{recording_id}/reanalyze` also returns `402` when the balance is under one minute's price.

```json
{
  "error": {
    "code": "insufficient_balance",
    "message": "Your balance is too low. Add money to your balance.",
    "field": null,
    "request_id": "req_01JEX4R7Q2K8M3"
  }
}
```

Add money in the Valeron app, then send the request again. A `402` charges nothing.

## You are never charged twice for one call

Send your own `external_id` with every call. Sending the same `external_id` again returns the first recording with `200` and charges nothing more.
