# Rate limits and concurrency

## Two independent limits

Accounts have separate per-minute request buckets and a concurrent generation limit.

| Limit | What it caps | Default | Header on rejection |
| --- | --- | --- | --- |
| Submission | `createTask`, queued cancellation, upload tickets, and explicit asset completion | 100 / minute | `Retry-After` |
| Task polling | `recordInfo` | 120 / minute or 20 × the concurrency limit, whichever is higher | `Retry-After` |
| Account reads | Media quotes, submission receipts, temporary upload confirmation, and account balance | 120 / minute | `Retry-After` |
| Concurrent tasks | How many generation tasks run at the same time | 10 | `Retry-After` |

Exceeding either returns HTTP `429`. The request is not charged and no task is created.

## Response headers

When you are rate limited, the response includes `Retry-After` in seconds. Wait at least that long before the next attempt.

```http
HTTP/1.1 429 Too Many Requests
Retry-After: 12
Content-Type: application/json

{"code":"rate_limit","message":"Request rate limit reached"}
```

For media generation, the concurrency response includes the cap (`limit`) and the number of in-flight tasks counted against it (`current`). Wait for an existing task to finish and honor `Retry-After` before trying again. Rate-limit responses use `rate_limit` and do not include these counts.

```json
{"code":"concurrency_limit","message":"Concurrent task limit reached","limit":10,"current":10}
```

## Polling counts toward the limit

`recordInfo` uses the separate polling bucket. Polling one task every second uses 60 requests per minute. Polling ten tasks every second uses 600.

Recommended pattern:

- Follow `lifecycle.pollAfterSeconds` when it is present. Otherwise, poll at most once every 3 seconds per task.
- Batch your checks: keep a list of pending task IDs and poll them in one pass rather than on independent timers.
- Prefer [webhooks](/docs/webhooks) for production traffic; polling is a fallback, not the primary completion signal.

## Backoff strategy

Use exponential backoff with jitter, capped at a maximum interval:

1. Start at 2–5 seconds.
2. Multiply by 1.5–2 on each attempt.
3. Cap at 30–60 seconds.
4. Add random jitter of up to 20% so retries from multiple workers do not align.
5. Stop after a bounded number of attempts and surface the task ID to your user.

Retrying `recordInfo` is always safe. Retrying `createTask` is only safe with the same `Idempotency-Key` and identical body — see [errors and retries](/docs/errors).

## Raising your limits

Concurrency is set per customer. Contact support if your workload needs a higher tier; sustained `429` responses on legitimate traffic are the usual trigger.