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

# Rate Limits

> Request limits per hour and per day by subscription plan

## Rate Limits by Plan

| Plan    | Per Hour | Per Day | Notes                    |
| ------- | -------- | ------- | ------------------------ |
| Starter | 5        | 20      | Starter-tier models only |
| Basic   | 30       | 200     | All models               |
| Pro     | 60       | 500     | All models               |
| VIP     | 100      | 1,000   | All models + API access  |
| Elite   | ∞        | ∞       | No limits                |

Limits are applied per **user account**, not per API key. If you generate in both the Telegram bot and via API, both count toward the same limits.

## Rate Limit Headers

Every API response includes headers showing your current status:

```http theme={null}
X-RateLimit-Limit-Hour: 100
X-RateLimit-Remaining-Hour: 87
X-RateLimit-Limit-Day: 1000
X-RateLimit-Remaining-Day: 934
X-RateLimit-Reset-Hour: 1709903600
```

## Handling Rate Limit Errors

When you exceed the rate limit, the API returns `429 Too Many Requests`:

```json theme={null}
{
  "error": "rate_limit_exceeded",
  "message": "Hourly limit reached: 100 requests/hour on VIP plan",
  "retry_after": 847,
  "plan": "vip",
  "limit_hour": 100,
  "limit_day": 1000
}
```

The `retry_after` field tells you how many seconds until the limit resets.

## Best Practices

<AccordionGroup>
  <Accordion title="Implement exponential backoff">
    Don't hammer the API after a 429. Wait, then retry with increasing delays:

    ```python theme={null}
    import time
    import requests

    def request_with_backoff(url, headers, payload, max_retries=3):
        for attempt in range(max_retries):
            response = requests.post(url, headers=headers, json=payload)
            if response.status_code == 429:
                retry_after = int(response.headers.get("Retry-After", 60))
                time.sleep(retry_after)
                continue
            return response
        raise Exception("Max retries exceeded")
    ```
  </Accordion>

  <Accordion title="Monitor remaining limits proactively">
    Check `X-RateLimit-Remaining-Hour` in each response and slow down when you're close to the limit, rather than waiting for a 429.
  </Accordion>

  <Accordion title="Batch where possible">
    For bulk tasks (e.g. generating 100 product images), spread requests over time. A VIP user can do 100/hour — you can saturate this with a simple queue.
  </Accordion>

  <Accordion title="Consider Elite for automation">
    If you're building a production service with unpredictable load, the Elite plan's unlimited rate is designed for that use case.
  </Accordion>
</AccordionGroup>

## Auth Endpoint Limits

Authentication endpoints have stricter rate limits to prevent abuse:

| Endpoint                     | Limit                  |
| ---------------------------- | ---------------------- |
| `POST /auth/login`           | 10 requests/min per IP |
| `POST /auth/register`        | 10 requests/min per IP |
| `POST /auth/forgot-password` | 3 requests/hour per IP |
