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

# Rate Limits

> API rate limiting and throttling

## Limits

Rate limits are applied per user using a sliding window algorithm:

| Auth Method | Limit              |
| ----------- | ------------------ |
| API Key     | 10 requests/minute |
| Session     | 20 requests/minute |

## Response headers

Every API response includes rate limit information in the headers:

| Header                  | Description                                    |
| ----------------------- | ---------------------------------------------- |
| `X-RateLimit-Limit`     | Maximum requests allowed per minute            |
| `X-RateLimit-Remaining` | Requests remaining in the current window       |
| `X-RateLimit-Reset`     | Unix timestamp (seconds) when the limit resets |

Example headers:

```
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 7
X-RateLimit-Reset: 1708100000
```

## Exceeding the limit

When you exceed the rate limit, the API returns a `429` response:

```json theme={null}
{
  "type": "https://api.rawugc.com/errors/rate_limit_exceeded",
  "title": "Rate Limit Exceeded",
  "status": 429,
  "detail": "Too many requests. Please retry after the rate limit window resets."
}
```

## Best practices

* **Check headers** before making additional requests to avoid hitting limits
* **Implement backoff** when receiving `429` responses -- wait until `X-RateLimit-Reset`
* **Batch operations** where possible instead of making many individual requests
* **Cache responses** for data that doesn't change frequently (e.g., video status after completion)
