Rate Limits

Rate limits protect the API and ensure fair usage. Limits are applied per API key.

Plan Limits

PlanMonthly CallsRate LimitOverage
Free50010 req/min
Starter ($19/mo)10,00060 req/min$0.003/call
Pro ($49/mo)100,000300 req/min$0.003/call
EnterpriseUnlimited1,000 req/minCustom

Rate Limit Headers

Every response includes rate limit information:

HeaderDescription
x-ratelimit-remainingRequests remaining in the current window
x-ratelimit-resetUnix timestamp when the rate limit resets
Retry-AfterSeconds to wait (only on 429 responses)

Retry Strategy

When you receive a 429 response:

  1. Read the Retry-After header for the wait time
  2. Wait the specified number of seconds
  3. Retry the request
  4. 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.