# Rate limits and concurrency

Request limits, task limits and how to handle 429.

Source: https://scifig.ai/docs/api/rate-limits

## Limits

| Limit | Value | Applies to |
| --- | --- | --- |
| Create requests | 20 per minute | Each API key, or each OAuth client and account, across all `POST` endpoints |
| Create requests | 40 per minute | Each account, across all its credentials |
| Read requests | 120 per minute | Each API key, or each OAuth client and account |
| Running tasks | By plan (see `GET /credits`) | Each account, shared with the website |
| Tasks per hour | 200 per rolling hour | Each account, shared with the website |
| Raster conversions | 200 per day | Each account |
| Text detections | 20 per 15 minutes | Each account, shared with the website |
| Bounded waiting | 30 seconds | Each request |

## Handling 429

- Responses to requests that pass authentication and the scope check carry `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` for the tightest request window. A `401` and a `403 SCOPE_DENIED` have none. A `429` carries `Retry-After` in seconds.
- `429 CONCURRENCY_LIMITED` means too many tasks are already running for the account; finished tasks no longer count. `429 RATE_LIMITED` has the causes listed below.
- Wait at least `Retry-After`, back off exponentially with jitter, and retry with the same `Idempotency-Key`.
- Task limits belong to the account: more keys do not add capacity.

## Causes of 429

- Too many requests: 20 create requests per minute per credential, 40 per account, 120 reads per minute per credential. `Retry-After` is the time until the window resets; there is no `details.reason`.
- Too many tasks started in the last hour: up to 200 per account, shared with the website. `Retry-After: 30`.
- Too many tasks running: `429 CONCURRENCY_LIMITED`, by plan and shared with the website (see `GET /credits`). `Retry-After: 30`.
- The daily allowance of 200 free PNG, PDF, TIFF and PPTX conversions is used up: `details.reason = DAILY_CONVERSION_LIMIT`, `Retry-After` until the day window resets.
- Uploads too fast: `details.reason = UPLOAD_RATE_LIMITED` (images and masks on `POST /files`, flowchart attachments, chart data), the website’s per-minute upload limit.
- Too many uploads in a day: `details.reason = UPLOAD_DAILY_LIMIT_REACHED` (flowchart attachments and chart data), the website’s daily upload limit.
- Text detections: 20 per 15 minutes per account, shared with the website.
