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

# Rate limits

> Understand request, active job, and result limits.

AI Gen Studio applies rate limits by API key, user account, and IP address.
It also applies capacity admission before reserving credits.

## Create limits

```txt theme={"theme":{"light":"github-light","dark":"github-light"}}
5 create requests per hour per API key
20 results maximum per job
1 active job maximum per API key
2 active jobs maximum per account
```

A result is one requested output. For example, 5 source images with `number_of_images: 2` creates 10 results.

## Polling limits

```txt theme={"theme":{"light":"github-light","dark":"github-light"}}
120 GET /jobs or GET /jobs/{jobId} requests per hour per API key
```

Do not poll each result individually. Poll the job status endpoint and read all result statuses from the response.

## Capacity backpressure

Background removal and Afri-backed tools have independent capacity groups.
Each group limits queued results, active results, and the share one account may
hold. A batch counts every requested result, so larger batches cannot bypass the
per-account pending limit.

When capacity is temporarily unavailable, the API returns one of:

```txt theme={"theme":{"light":"github-light","dark":"github-light"}}
429 too_many_active_jobs
429 too_many_pending_results
503 capacity_unavailable
```

These responses include `Retry-After`. No job is created and no credits are
reserved. Retry the same request with the same `Idempotency-Key` after the
indicated delay.

## Too many requests

Rate limited responses use HTTP `429`:

```json theme={"theme":{"light":"github-light","dark":"github-light"}}
{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "You have reached the allowed request limit. Please wait before trying again."
  },
  "request_id": "req_abc123"
}
```
