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

# Rate limits

> Wearo API rate limits and how to handle them.

# Rate limits

Rate limit details are included in every API response header.

| Header                  | Description                           |
| ----------------------- | ------------------------------------- |
| `X-RateLimit-Limit`     | Maximum requests per window           |
| `X-RateLimit-Remaining` | Requests left in the current window   |
| `X-RateLimit-Reset`     | Unix timestamp when the window resets |

When you exceed the rate limit, you'll receive a `429 Too Many Requests` response.

## Handling 429

Implement exponential backoff:

```javascript theme={"dark"}
async function tryOnWithRetry(payload, retries = 3) {
  for (let i = 0; i < retries; i++) {
    const res = await fetch('https://api.wearo.io/functions/v1/tryon-api', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json', 'X-API-Key': 'wearo_xxx' },
      body: JSON.stringify(payload)
    });

    if (res.status !== 429) return res.json();

    const retryAfter = res.headers.get('Retry-After') || (2 ** i);
    await new Promise(r => setTimeout(r, retryAfter * 1000));
  }
  throw new Error('Rate limit exceeded after retries');
}
```

## Need higher limits?

Contact us at [support@wearo.io](mailto:support@wearo.io) with your use case.
