# Balance and pricing

> Prepaid balance, how a request is priced and when nothing is charged.

You pay from a prepaid balance in US dollars, as you go. There are no
subscriptions or mandatory monthly payments.

## Top-up

Top up in your account, under “Balance”. If something
goes wrong, message us on Telegram: [@llmbox_support_bot](https://t.me/llmbox_support_bot).

## How a request is priced

| Model type | What is billed |
| --- | --- |
| Text | Tokens at per-million rates: input, output, cache read, cache write (5 minutes and 1 hour) |
| Images | Each delivered image, but never more than the requested `n` |
| Video | Seconds of video length; for some models — per video and/or per second, depending on resolution, audio and length. Once — when the job completes |
| Audio | Characters of text (speech) or seconds of audio (transcription, voice changing, effects, music) — see [Audio](https://llmbox.cc/en/docs/audio) |

- Tokens come from the usage the model's provider returned. Reasoning tokens
  count as output.
- If the provider sent no usage (for example, the stream broke off), the cost
  is estimated from the size of the request and of the received response.
- Implausible figures from the provider are replaced with an estimate: for
  example, zero tokens next to a received text, or output above your
  `max_tokens` plus 4,096 tokens of reasoning headroom that does not match the
  received response. In the latter case the charge never exceeds the request's
  reserve.
- If the model ignored `max_tokens` but you received the whole response, the
  charge follows the provider's usage and may exceed the reserve.
- Video length comes from the provider's response; if it did not report it, the
  requested seconds are charged. The price of a video depends on its
  conditions — the per-video part plus seconds × the per-second part, by the
  actual length, but never more than the job's reserve — the price of its
  conditions for the ordered length. In the catalog a video model shows “≈ $X / video” — the price
  of a typical video (the model's default resolution, length and audio); the
  full table of conditions and prices is on the model page, details in
  [Video](https://llmbox.cc/en/docs/videos).
- For some text models the price depends on the effort level (reasoning
  depth). The catalog shows the default-level price as “from $X”; the table
  of prices per level is on the model page. The level is set with a request
  parameter, see [Request parameters](https://llmbox.cc/en/docs/params#effort-level).
- Rates differ per model — they are listed in the
  [model and pricing catalog](https://llmbox.cc/en/models). Your account may have personal
  prices; you can see them in your account under “Models”.

## When nothing is charged

- The gateway rejected the request (4xx errors), or the provider did before the
  response started.
- The model is temporarily unavailable (`502 upstream_unavailable`).
- The provider did not answer a request without streaming within 10 minutes
  (`504 upstream_timeout`).
- The provider broke off the stream, went silent or sent an error before the
  first meaningful piece of the response (service events at the start of the
  stream do not count).
- The provider answered with no result and no token usage (an empty response).
- You aborted the request before the provider accepted it: before it was
  sent or after the provider refused it with an HTTP status.
- A video job ended with status `failed`.

A provider failure after the first meaningful piece of the response charges the
input and the received part. Canceling after the provider accepted the
request (started answering or did not answer in time) is charged: the input and
the received part of the response — even if the model had not started answering
yet (for example, it was still reasoning). Canceling after a provider refusal
with an HTTP status is free. Image generation has no received part: canceling
after the provider accepted the request charges the price times `n`.

## Request statuses

In the “Logs” section of your account, each request has one of five statuses:

| Status | What it means | Charge |
| --- | --- | --- |
| In progress | The request is still running. | Calculated once it finishes |
| Success | The response arrived in full. | At the model's rates |
| Interrupted | The provider stopped the response after generation began. Retry the request. | Input and the received part |
| Canceled | You canceled the request. | Input and the received part (for images — the price times `n`) if the provider had already accepted the request; otherwise nothing |
| Error | No response received. | Nothing charged |

## Reserve and limits

- While a request runs, its estimated reserve is held on your balance: for
  text — the input estimate plus the output ceiling times `n` (`max_tokens`
  plus a 4 096-token reasoning reserve; 4 096 tokens without `max_tokens`), for
  images — the price times `n`, for audio — the cost of the characters to
  narrate, the estimated file duration (speech to text, voice changer) or the
  duration ceiling (music, sound effects), see [Audio](https://llmbox.cc/en/docs/audio), for
  video — the price of the video for the requested length until the job
  finishes, see [Video](https://llmbox.cc/en/docs/videos). A request is
  admitted only if the free remainder covers the whole reserve; otherwise it
  gets `402 insufficient_quota` with the amount missing (see
  [Limits](https://llmbox.cc/en/docs/limits)).
- Without `max_tokens`, a response longer than 4 096 tokens may cost more than
  the reserve — the charge may then exceed the free remainder. The same can
  happen if the model ignored `max_tokens`.
- Each key can have a spend limit set in the cabinet: once reached, requests on
  that key get `403 spend_limit_exceeded` while other keys keep working.

## Check your balance

In the cabinet — on the dashboard and in the Balance section. From code —
`GET /v1/balance` with your key; the amount is a decimal string, so no
precision is lost:

```bash
curl https://llmbox.cc/v1/balance \
  -H "Authorization: Bearer $LLMBOX_API_KEY"
```

```json
{"balance": "12.5", "currency": "usd"}
```

Spending by day and model is in the cabinet's Usage section.
