Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.maxcare.ai/llms.txt

Use this file to discover all available pages before exploring further.

Limits

Rate limits are enforced per app using a sliding window counter. Every response includes rate limit headers so you can track your usage in real time.
EnvironmentRequests per minute
All environments1,000

Rate Limit Headers

Rate-limited API responses include these headers:
HeaderDescription
X-RateLimit-LimitMaximum requests allowed per window
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix timestamp when the window resets
Retry-AfterSeconds until the window resets (only on 429 responses)

Handling Rate Limits

When you exceed the limit, the API returns 429 Too Many Requests:
{
  "code": "rate_limit_exceeded",
  "message": "Rate limit exceeded. Maximum 1000 requests per 60 seconds.",
  "trace_id": "d4e5f6a7-b8c9-0123-defg-234567890123"
}
Use the X-RateLimit-Reset header to wait until the window resets before retrying. Fall back to exponential backoff with jitter if the header is missing:
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 resetAt = response.headers.get("X-RateLimit-Reset");
      const waitMs = resetAt
        ? parseInt(resetAt) * 1000 - Date.now()
        : Math.pow(2, attempt) * 1000 + Math.random() * 1000;

      await new Promise((resolve) => setTimeout(resolve, Math.max(waitMs, 1000)));
      continue;
    }

    return response;
  }

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

Best Practices

  • Batch requests where possible instead of making many individual calls
  • Cache responses for data that doesn’t change frequently (providers, facilities)
  • Use pagination with larger page sizes to reduce the number of requests
  • Monitor headers — check X-RateLimit-Remaining to throttle proactively before hitting the limit