# Billing and limits

> What VAPI costs, how to price a video before you start, and the limits that keep spending in check: organization budgets, spending limits on keys, read-only keys and free test keys.

## Prices

Reframing is charged per second of output video, which is as long as the input. Every organization gets free minutes first; after them, the price per minute is in the [Redge Media Cloud price list](https://console.cloud.redge.media/v1/services) (JSON, no key needed). `probe` is free. A job that fails or is canceled costs nothing.

The organization pays from its prepaid wallet, or with pay as you go (a card charged monthly). Owners and admins manage both in the [console](https://console.cloud.redge.media/billing).

## Estimates

Price a video before you start it:

```bash
curl -s -X POST https://vapi.cloud.redge.media/v1/estimates \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"operation": "reframe", "duration_s": 95}'
```

```json
{
  "operation": "reframe",
  "duration_s": 95.0,
  "billable_seconds": 95.0,
  "free_seconds": 95.0,
  "amount_eur": "0.00",
  "amount_micros": 0,
  "currency": "EUR",
  "price_per_minute_eur": "0.15",
  "available_micros": 25000000,
  "sufficient": true,
  "reason": null,
  "key_limit_remaining_micros": null,
  "test": false
}
```

Instead of `duration_s`, give `"input": {"upload_id": "upl_..."}` of a video VAPI already knows the length of (after any job on it, a free `probe` included). `sufficient` says whether the organization can pay for it now; when it cannot, `reason` is `insufficient_funds` or `key_limit_reached`. An estimate holds nothing: the price is fixed when the job's worker starts the work.

## When the money runs out

A job is refused at once with `402 insufficient_funds` when the organization has neither free minutes nor money left. The error carries `available_micros`, `free_remaining` and `top_up_url`. When the worker finds out the video is longer than what is left, the job fails with the same code and nothing is charged. A person with the owner or admin role tops up or turns on pay as you go; retry afterwards.

Amounts in `_micros` are millionths of a euro: 1 500 000 is EUR 1.50.

## Limits on API keys

Owners and admins set them when they create a key in the [console](https://console.cloud.redge.media/api-keys):

- **Monthly spending limit.** Work that would take the key's spending this month (in euro, after free minutes) over the limit fails with `402 key_limit_reached`. Keys for AI agents always have one.
- **Services.** A key can be limited to some services; elsewhere it gets `403 key_not_allowed`.
- **Read-only.** The key can list and read jobs, but not start or cancel them: `403 key_read_only`.
- **Expiry.** After its date the key gets `401 key_expired`.

The organization can also set a monthly budget, which e-mails its owners and admins when reached.

## Test keys

A test key (`rmk_test_...`) costs nothing. Its jobs process only the first 10 seconds of the video, at most 640 pixels high, and are marked `"test": true`. An organization runs up to 3 test jobs at a time, on inputs up to 200 MB. Use one while you build an integration or let an agent learn the API; switch to a real key when the results look right. `GET /v1/jobs?test=false` leaves test jobs out.

## Your account over the API

With the same key, Redge Media Cloud's account API answers:

- `GET https://console.cloud.redge.media/v1/key`: this key, its limits and what it spent this month;
- `GET https://console.cloud.redge.media/v1/wallet`: the balance, free minutes left and pay as you go;
- `GET https://console.cloud.redge.media/v1/usage`: this month's usage by service;
- `GET https://console.cloud.redge.media/v1/services`: services and prices (no key needed).
