---
title: "Tokens, quotas, LMC and PAYG"
url: https://lumean.app/de/developers/docs/guide/billing
locale: de
description: "How an order is paid for — subscription quota, balance top-ups and 402 responses."
updated: 2026-10-18
source_locale: en
sources: [post-orders, post-orders-order-retry, get-subscriptions, get-usage, get-usage-service, get-wallets]
errors: ["402", payg-topup-required, quote-mismatch, insufficient-balance, insufficient-allowance]
spec_version: 1.0.0
---

# Tokens, quotas, LMC and PAYG

Orders are paid for in tokens. Tokens come out of your subscription quota first. If the quota is not
enough, the remainder is charged to your LMC balance.

| Quantity | What it is | Where to see it |
| --- | --- | --- |
| Token | a unit of a service's work volume, not money | `total_tokens` and `tokens_spent` in the order, `summary.total_price_units` in the preview |
| Subscription quota | the plan's token allowance for the billing period | `GET /subscriptions` → `items[].tokens_remaining` |
| LMC | the internal currency of your balance | `price_formatted` in the order, [`GET /wallets`](/developers/docs/api/get-wallets) |

## Cost before you order

```bash
curl -s -X POST "$BASE/orders/chunks/preview" -H "X-API-KEY: $KEY" \
  -H "Content-Type: application/json" \
  -d '{ "template_id": "<UUID>", "input_text": "…" }'
```

`summary.total_price_units` is the number of tokens `POST /orders` will charge for the same text.
`summary.cost_lmc` is the same cost in LMC; when it cannot be calculated, the field is absent.
The preview is free and does not create an order.

`GET /subscriptions` shows the remaining quota:

### GET /subscriptions

Get subscriptions of API key owner

Справочник: https://lumean.app/de/developers/docs/api/get-subscriptions

The response contains active subscriptions only. The remainder is in `items[].token_allowance`,
`tokens_used` and `tokens_remaining`.

### GET /usage

Get Usage Limits

Справочник: https://lumean.app/de/developers/docs/api/get-usage

`GET /usage` lists your subscription limits: `limit_type`, `limit_value`, `used`, `remaining`,
`period_end`, `resets_in`. For a single service, use [`GET /usage/{service}`](/developers/docs/api/get-usage-service),
where `{service}` is the numeric `service_id` from the `GET /usage` response.

[`GET /wallets`](/developers/docs/api/get-wallets) returns your LMC balance and needs the same `billing.read` scope; money movements are in [`GET /ledger-transactions`](/developers/docs/api/get-ledger-transactions).

## When the quota runs out

```json
{
  "data": {
    "tokens_from_quota": 1200,
    "tokens_from_payg": 300,
    "tokens_spent": 1500
  }
}
```

The remainder is charged to your balance automatically, and the order is created right away.
`tokens_from_quota` and `tokens_from_payg` show how much the quota covered and how much came from
the balance.

Each service has its own setting for paying beyond the quota. If it is closed for a service, you get
`402` `insufficient_allowance` instead of a charge.

When an order cannot be paid for, it is not created and nothing is charged:

| Response | What happened | What to do |
| --- | --- | --- |
| `402` `insufficient_balance` | the balance does not have enough LMC for the top-up | top up the balance in your account or shorten the order |
| `402` `insufficient_allowance` | the quota is used up and paying beyond the quota is not available for this service | wait for the next quota, change the plan or shorten the order |
| `403` `no_subscription` | the service works with a subscription only | subscribe to a plan |
| `403` `entitlement_missing` | your plan does not include this service | change the plan |

`POST /orders/{order}/retry` and chunk regeneration are paid for the same way. A `429` with
`reason: limit_exceeded` is a subscription limit, not a payment issue: see
[Limits and the 429 code](/developers/docs/guide/limits).

### 402 — 402 — payment required

| Что произошло | Что делать |
| --- | --- |
| The order was not created and no money was charged. `POST /orders` and `POST /orders/{order}/retry` return this code: both are paid for the same way. Chunk retry and regeneration also return `402` when an extra charge cannot be paid: `insufficient_balance`, `insufficient_allowance`, and for retry also `insufficient_funds` (the order's reserved remainder is not enough). The `reason` field names the cause. | Branch on `reason`, not on `message`: the message text can change without notice. For `insufficient_balance`, top up the balance. For `insufficient_allowance`, wait for the next quota or change the plan. Until then, the same request keeps returning the same 402. |

`Retry-After`: нет. Разбор: https://lumean.app/de/developers/docs/errors/402

## Explicit top-up confirmation mode

The platform can temporarily switch on a mode where paying beyond the quota needs consent. In that
mode an order beyond the quota is not created right away, and the server answers `402` with the
price:

```json
{
  "success": false,
  "message": "…",
  "reason": "payg_topup_required",
  "shortfall_tokens": 300,
  "shortfall_lmc": 3.6,
  "shortfall_lmc_minor": 360000000,
  "quote_token": "q_9f8b2c1a4d3e",
  "expires_at": "2026-10-18T12:01:00+00:00"
}
```

To agree, repeat the same request with `confirm_payg_topup: true` and the `quote_token` from the
response:

```bash
curl -s -X POST "$BASE/orders" -H "X-API-KEY: $KEY" \
  -H "Content-Type: application/json" \
  -d '{ "template_id": "<UUID>", "input_text": "…",
        "confirm_payg_topup": true, "quote_token": "q_9f8b2c1a4d3e" }'
```

A quote is valid for 60 seconds. Repeating the request without confirmation returns a new `402` with
a new price. If the top-up got more expensive by the time of the charge, you get `409`
`quote_mismatch` with a fresh `quote_token` and `expires_at`: repeat the request with them. Outside
this mode, `confirm_payg_topup` and `quote_token` are ignored.

### 402 · `payg_topup_required` — payg_topup_required — top-up confirmation required

| Что произошло | Что делать |
| --- | --- |
| The order was not created and no money was charged. Instead, the server sent the top-up price. Body: `reason: "payg_topup_required"`, `shortfall_tokens`, `shortfall_lmc`, `shortfall_lmc_minor`, `quote_token`, `expires_at`. This response comes only in explicit top-up confirmation mode. By default, the amount beyond the quota is charged automatically. | Show the user `shortfall_lmc` and get explicit consent. An automatic retry here means charging money without the user knowing. The quote is short-lived: 60 seconds by default (`expires_at`). If it has expired, a request without confirmation returns a new 402 with a new `quote_token`. |

`Retry-After`: нет. Разбор: https://lumean.app/de/developers/docs/errors/payg-topup-required

### 409 · `quote_mismatch` — quote_mismatch — top-up price changed

| Что произошло | Что делать |
| --- | --- |
| The confirmed top-up did not go through: the order was not created and nothing was charged. Body: `reason: "quote_mismatch"`, `actual_lmc_minor` (the current price), `quoted_lmc_minor` (the price in the quote), and a fresh `quote_token` and `expires_at`. This code comes only in explicit top-up confirmation mode. | Show the user the new price and get consent again. The new price is `actual_lmc_minor`, in LMC minor units. The fresh `quote_token` in this response is already issued for the new amount. The old token will not work: while the price is above the quote, a request with it returns 409 again. |

`Retry-After`: нет. Разбор: https://lumean.app/de/developers/docs/errors/quote-mismatch

**Правильно**

Show the user `shortfall_lmc`, wait for their consent, and repeat the request with the `quote_token`
from the same response.

**Неправильно**

Retry a `402` with `confirm_payg_topup: true` automatically: that charges money without the user
knowing.

## Minor units

Money fields with the `_minor` suffix, as well as `price_units`, are integers in minor units. The
real value is `minor / 10^precision`. Take `precision` from the data: `currency_asset.precision` on
the order, `lumc_precision` on the service. For example, `shortfall_lmc_minor: 360000000` with
`precision: 8` is 3.6 LMC.

To show amounts to users, use the ready-made `shortfall_lmc` and `price_formatted`.

## Payment details in the order

| Field | Meaning |
| --- | --- |
| `total_tokens` | the full cost in tokens, including retries and regenerations |
| `tokens_from_quota` | how much the subscription quota covered |
| `tokens_from_payg` | how much was paid from the balance |
| `tokens_spent` | the sum of the two fields above |
| `price_units` | the amount reserved for the order, in LMC minor units |
| `price_formatted` | the same amount, ready to display |

A zero share comes as `null`, not `0`. For an order fully covered by the quota, `tokens_from_payg`
is `null`.

You cannot top up the balance or buy a plan with an API key. Do it in your account:
[wallet](/wallet), [plans](/shop), [account limits](/limits).

---

- Diese Seite im Browser: https://lumean.app/de/developers/docs/guide/billing
- Vollständige maschinenlesbare Referenz: https://api.lumean.app/docs/llm.md
