Rate Limits
Rate limits protect the API and ensure fair usage. Limits are applied per API key.
Plan Limits
| Plan | Monthly Calls | Rate Limit | Overage |
|---|---|---|---|
| Free | 500 | 10 req/min | — |
| Starter ($19/mo) | 10,000 | 60 req/min | $0.003/call |
| Pro ($49/mo) | 100,000 | 300 req/min | $0.003/call |
| Enterprise | Unlimited | 1,000 req/min | Custom |
Rate Limit Headers
Every response includes rate limit information:
| Header | Description |
|---|---|
x-ratelimit-remaining | Requests remaining in the current window |
x-ratelimit-reset | Unix timestamp when the rate limit resets |
Retry-After | Seconds to wait (only on 429 responses) |
Retry Strategy
When you receive a 429 response:
- Read the
Retry-Afterheader for the wait time - Wait the specified number of seconds
- Retry the request
- Use exponential backoff if retries continue to fail
async function captureWithRetry(url, apiKey, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
const res = await fetch("https://api.rendex.dev/v1/screenshot", {
method: "POST",
headers: {
"Authorization": `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ url }),
});
if (res.status !== 429) return res;
const retryAfter = parseInt(res.headers.get("Retry-After") || "1");
await new Promise(r => setTimeout(r, retryAfter * 1000));
}
throw new Error("Rate limit exceeded after retries");
}Best Practices
- Cache screenshots: Store results to avoid redundant API calls for the same URL.
- Batch wisely: Space out bulk screenshot jobs rather than sending all requests simultaneously.
- Monitor usage: Check your usage dashboard regularly to stay within plan limits.
- Upgrade proactively: If you consistently hit limits, upgrade your plan for higher quotas.