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

# Rate limits and capacity

> Request limits, queue limits and how model capacity is shared.

Two different limits apply: how many **requests** you can send, and how many **generations** can wait at once.

## Request rate limits

| Bucket | Limit, per workspace |
| - | - |
| `write`: every `POST`, `PATCH` and `DELETE` | 60 per minute |
| `read`: every `GET` | 600 per minute |
| `session`: starting an [agent session](https://docs.argil.ai/v2/agent/sessions.md) or sending it a message | 20 per minute |

A workspace also runs at most 5 agent sessions at once, counting those its members run in the app (`429 too_many_running_sessions`). The count is read when each request arrives, so parallel requests can briefly go past it.

Every authenticated response carries the [IETF RateLimit headers](https://datatracker.ietf.org/doc/draft-ietf-httpapi-ratelimit-headers/):

```http theme={null}
RateLimit-Policy: "write";q=60;w=60, "read";q=600;w=60, "session";q=20;w=60
RateLimit: "write";r=57;t=41
```

`r` is what remains in the current window of the request’s bucket, `t` the seconds until it resets. Over the limit you get `429 rate_limited` with `Retry-After`. Rejected requests count too: retrying early does not help.

A `Prefer: wait` request counts once, however long it waits. A workspace holds at most 20 such requests open at once; past that, the answer comes at once, without `Preference-Applied`, and you poll as usual.

## Request size

A JSON body is at most 1 MB, and a file sent in the request at most 100 MB, with a `Content-Length` (`411 length_required` without one); past that, `413 payload_too_large`. Larger files go through a [signed upload](https://docs.argil.ai/v2/library/assets.md).

## Generations in flight

Model capacity is shared across Argil, and some models run few jobs at a time:

* **Queueing.** A generation that cannot start yet is `queued` with `status_detail: "waiting_for_capacity"` and a `queue.position`; its credits are reserved. Generations start by plan priority, then in creation order.
* **Queue cap.** Once 200 generations are waiting in your workspace, creation returns `429 too_many_queued_generations`. The count is read when each request arrives, so a burst of parallel requests can briefly go past it. Submit batches progressively, for example as webhooks come back.
* **URL imports.** `POST /v2/assets` with a `url` returns `429 too_many_asset_imports` while 5 assets of your workspace are still processing. URLs given as generation inputs are not limited this way.
* **Webhook endpoints.** A workspace has at most 16; past that, `409 too_many_webhook_endpoints`.

## Good practice

* Respect `Retry-After` on `429` and on polling `GET`s.
* Prefer webhooks or `Prefer: wait` to tight polling loops.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.