Protected by MagenTrust
    MAGEN
    MAGEN Docs

    Rate Limits

    All endpoints are rate-limited per API key (authenticated) or per IP (public endpoints).

    Endpoint Limits

    EndpointMethodLimitWindowAuth Required
    /magen-verify-startPOST100/min60sNo
    /magen-verify-checkPOST200/min60sNo
    /magen-verify-session/:idGET300/min60sYes
    /magen-session-delete/:idDELETE50/min60sYes
    /magen-session-tokenPOST100/min60sYes
    /record-honeypot-sessionPOST500/min60sNo

    Rate Limit Headers

    Every response includes these headers to help you monitor your usage:

    X-RateLimit-LimitMaximum requests allowed in window
    X-RateLimit-RemainingRequests remaining in current window
    X-RateLimit-ResetSeconds until window resets

    429 Too Many Requests

    When you exceed the rate limit, the API returns a 429 status with details about when you can retry:

    {
      "success": false,
      "error": "RATE_LIMIT_EXCEEDED",
      "message": "Rate limit exceeded",
      "retry_after": 23,
      "request_id": "req_abc123"
    }

    Exponential Backoff Example

    Implement exponential backoff to gracefully handle rate limits:

    1async function fetchWithBackoff(url: string, options: RequestInit, maxRetries = 3) {
    2  let retries = 0;
    3  
    4  while (retries < maxRetries) {
    5    const response = await fetch(url, options);
    6    
    7    if (response.status === 429) {
    8      const retryAfter = parseInt(response.headers.get('Retry-After') || '1');
    9      const backoffTime = Math.min(retryAfter * 1000, Math.pow(2, retries) * 1000);
    10      
    11      console.log(`Rate limited. Retrying in ${backoffTime}ms...`);
    12      await new Promise(resolve => setTimeout(resolve, backoffTime));
    13      retries++;
    14      continue;
    15    }
    16    
    17    return response;
    18  }
    19  
    20  throw new Error('Max retries exceeded');
    21}

    Best Practices

    1

    Cache session tokens

    Reuse tokens within their TTL instead of generating new ones for each request.

    2

    Implement backoff

    Use exponential backoff on 429 responses to avoid hammering the API.

    3

    Batch signals

    Collect entropy signals client-side and send once per verification instead of streaming.

    4

    Monitor usage

    Track X-RateLimit-Remaining header to proactively avoid hitting limits.