> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apiosk.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Limits

> What bounds a key: money, rate and lifetime.

## Spending

| Limit           | Set where                   | Checked                                                    |
| --------------- | --------------------------- | ---------------------------------------------------------- |
| **Per request** | On the key, in the app      | Against the maximum cost of a whole call or plan           |
| **Monthly**     | On the key, in the app      | Against everything the key spent this calendar month (UTC) |
| **`max_spend`** | Per request, by you         | Against the plan's maximum cost, before anything is paid   |
| **Balance**     | Organisation's main balance | Before each source call is made                            |

Limits are checked twice: when a plan is approved, and again under a lock when
each call reserves its money. Parallel requests cannot overspend a limit
between them — twenty calls at once queue on the same ledger lock.

Reservations count against the monthly limit while they are held. A refunded
call counts for nothing.

The month resets on the first of the calendar month, UTC. `GET /v2/balance`
returns `month_spent`, `month_remaining` and `month_start`.

## Rate

* **60 requests per minute per organisation.** All keys of one organisation share it.
* **A bounded number of requests execute at once.** Over that, Apiosk answers
  `429 rate_limit_exceeded`; wait and retry with the same `Idempotency-Key`.

## Keys

* **25 active keys per organisation.** Revoke one to create another.
* **Expiry options in the app: 30, 90, 180, 365 or 730 days**, chosen at creation. An expired key answers
  `401 api_key_expired`; nothing else changes.

## Waiting

For a direct call, an automatic Ask and a plan run, <code>wait\_seconds</code>
defaults to 25 and is capped at 55. A run still executing answers HTTP 202
with its id. A status read at <code>GET /v2/runs/{id}</code> returns
immediately by default; pass <code>wait\_seconds</code> if you want it to
wait. Status reads are free.

## Sizes

* Request bodies up to 64 KB.
* `limit` on results: 1 to 50 documents.
* `Idempotency-Key`: 1 to 255 visible ASCII characters.
