Rate limits
Rate limit details are included in every API response header.
When you exceed the rate limit, you’ll receive a
429 Too Many Requests response.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Wearo API rate limits and how to handle them.
| 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 |
429 Too Many Requests response.
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');
}