Default Limits

The Provider API enforces per-key rate limits to ensure fair usage and protect upstream providers.
TierLimitWindow
Default100 requests1 minute
Rate limits are applied per API key, not per IP address. All endpoints (except public health and provider endpoints) count toward your limit.
Need higher limits? Contact us at support@perps.studio for enterprise rate limit tiers.

Rate Limit Headers

Every response includes headers to help you track your usage:
HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the window
X-RateLimit-ResetUnix timestamp (seconds) when the window resets
HTTP/1.1 200 OK
X-RateLimit-Limit: 100
X-RateLimit-Reset: 1712000460

Exceeding the Limit

When you exceed the rate limit, the API returns a 429 Too Many Requests response:
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Rate limit exceeded. Try again in 45 seconds."
  }
}
The Retry-After header indicates how many seconds to wait before retrying.

Best Practices

Instead of polling REST endpoints for orderbook or price updates, subscribe to WebSocket channels. WebSocket subscriptions do not count against REST rate limits.
Use bulk endpoints like GET /v1/perps/:provider/prices to fetch all prices in a single request instead of querying individual markets.
When you receive a 429, wait the number of seconds in the Retry-After header, then retry with exponential backoff:
async function fetchWithRetry(url: string, options: RequestInit, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    const response = await fetch(url, options);

    if (response.status === 429) {
      const retryAfter = parseInt(response.headers.get("Retry-After") ?? "5");
      const backoff = retryAfter * Math.pow(2, i);
      await new Promise((resolve) => setTimeout(resolve, backoff * 1000));
      continue;
    }

    return response;
  }
  throw new Error("Max retries exceeded");
}
Market metadata, provider info, and other slowly-changing data should be cached locally. Markets data typically changes less than once per day.

Upstream Provider Limits

The Provider API also respects each upstream provider’s rate limits. If an upstream provider rejects a request due to their own limits, you will receive a 503 Service Unavailable with the PROVIDER_UNAVAILABLE error code.
ProviderUpstream Limit
Hyperliquid1,200 requests/min
Aster DEX2,400 requests/min
Polymarket600 requests/min
The Provider API includes built-in request queuing and backpressure handling to minimize upstream rate limit errors. In most cases, you only need to worry about the Provider API limits.