Templated

Rate Limits

Understand API rate limiting and how to handle 429 responses.

Rate Limits

The Templated API enforces rate limits to ensure fair usage and platform stability.

Current limits

Endpoint categoryLimitWindow
General API100 requestsPer minute
AI generation10 requestsPer minute
File uploads (images, fonts)30 requestsPer minute

Rate limits are applied per account. All members of an account share the same rate limit pool.

Rate limit headers

Every API response includes rate limit headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1707500000
HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the window
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix timestamp when the window resets

Handling rate limits

When you exceed the rate limit, the API returns a 429 Too Many Requests response:

{
  "error": "Rate limit exceeded. Try again in 45 seconds."
}

Best practices

  1. Check headers — Monitor X-RateLimit-Remaining before making requests
  2. Implement backoff — When you receive a 429, wait until X-RateLimit-Reset before retrying
  3. Batch operations — Where possible, batch multiple operations into fewer API calls
  4. Cache responses — Cache GET responses to reduce unnecessary calls

Retry strategy

async function fetchWithRetry(url, options, maxRetries = 3) {
  for (let attempt = 0; attempt < maxRetries; attempt++) {
    const response = await fetch(url, options);

    if (response.status === 429) {
      const resetTime = response.headers.get("X-RateLimit-Reset");
      const waitMs = resetTime
        ? (parseInt(resetTime) * 1000) - Date.now()
        : 1000 * Math.pow(2, attempt);

      await new Promise((resolve) => setTimeout(resolve, waitMs));
      continue;
    }

    return response;
  }

  throw new Error("Max retries exceeded");
}

Need higher limits?

Contact us at support@templated.email to discuss increased rate limits for your use case.

On this page