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

# Rate Limits

> Available model tiers, request and token allowances, headers and retries.

Understand model rate-limit tiers. Text and image requests have separate account allowances, shared across your API keys.

## Available limits

Find the current tier for each model on the [models page](https://nomask.ai/models) or in its `rate_limit` from `GET /models`. Available tiers and model assignments can change; use the live catalog and response headers for the limits that apply to your requests.

### Text API

**RPM** is requests per minute. **TPM** is input and output tokens per minute.

Check `rate_limit.name`, `rate_limit.requests_per_minute` and `rate_limit.tokens_per_minute` on the selected text model.

### Image API

**RPM** is requests per minute. **RPD** is requests per day. Image generation and editing do not use a token allowance.

Check `rate_limit.name`, `rate_limit.requests_per_minute` and `rate_limit.requests_per_day` on the selected image model.

The JSON fields are `requests_per_minute`, plus `tokens_per_minute` for text or `requests_per_day` for images.

## How limits work

* All your keys share one text usage total and one image usage total. Creating more keys or switching models does not reset either total.
* The selected model's tier sets the limits applied to that total.
* Authenticated requests count toward request limits, including requests rejected for invalid input. Requests blocked by an exhausted request limit do not add more requests to the counters.
* Minute limits reset each minute; image daily limits reset at midnight in Africa/Lagos.

Model-list, account and usage requests use the default text request limit. Read the current default profile from `GET /me` under `rate_limits`. Only image generation and editing use the image allowance.

> [accordion] Text token reservations and switching models
>
> Before a text response starts, estimated input tokens and the maximum output are reserved. Unused tokens are released when the request finishes. Lower `max_tokens` or `max_completion_tokens` if the reservation is too large.
>
> After using 600,000 text tokens, a model with a 5,000,000 TPM limit has 4,400,000 tokens left that minute. Switching to a model with a lower limit may be blocked until the minute resets.

## Rate limit headers

> [accordion] View response headers
>
> Response headers show the selected model's limits and remaining allowance. The numbers below are illustrative examples, not guaranteed current limits. Text responses include request and token counters:
>
> ```http theme={"system"}
> X-RateLimit-Limit-Requests: 60
> X-RateLimit-Remaining-Requests: 57
> X-RateLimit-Limit-Tokens: 100000
> X-RateLimit-Remaining-Tokens: 98544
> X-RateLimit-Reset: 34
> ```
>
> Image responses include minute and daily request counters, without token-limit headers:
>
> ```http theme={"system"}
> X-RateLimit-Limit-Requests: 60
> X-RateLimit-Remaining-Requests: 57
> X-RateLimit-Limit-Requests-Day: 1000
> X-RateLimit-Remaining-Requests-Day: 997
> X-RateLimit-Reset: 34
> X-RateLimit-Reset-Day: 14534
> ```
>
> `X-RateLimit-Reset` is the seconds until the minute resets. `X-RateLimit-Reset-Day` is the seconds until the image daily limit resets. On a daily-limit rejection, `X-RateLimit-Reset` also reports the daily wait.

## Handling 429s

A `429` response with `rate_limit_exceeded` means a request or token allowance was reached. Wait at least the seconds in `Retry-After` before retrying. The same rule applies to text and image requests.

> [accordion] Python retry example
>
> ```python theme={"system"}
> import time
> from openai import RateLimitError
>
> for attempt in range(5):
>     try:
>         response = client.chat.completions.create(...)
>         break
>     except RateLimitError as e:
>         wait = int(e.response.headers.get("Retry-After", 2 ** attempt))
>         time.sleep(wait)
> ```

> [!NOTE]
>
> A `429` with `monthly_limit_exceeded` means the key reached its monthly USD cap. Raise the cap on the [keys page](https://nomask.ai/api/keys) or wait until the next month.


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