Skip to main content

Rate Limiting

Semaswift implements rate limiting to ensure fair usage and platform stability.

Rate Limits

PlanRequests/MinuteRequests/Day
Free601,000
Starter30010,000
Professional1,000100,000
EnterpriseCustomCustom

Rate Limit Headers

Every response includes rate limit information:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 995
X-RateLimit-Reset: 1704067200
HeaderDescription
X-RateLimit-LimitMaximum requests per window
X-RateLimit-RemainingRemaining requests in window
X-RateLimit-ResetUnix timestamp when limit resets

Rate Limit Response

When you exceed the rate limit:

HTTP/1.1 429 Too Many Requests
Content-Type: application/json
Retry-After: 60

{
"code": 429,
"message": "Rate limit exceeded",
"retry_after": 60
}

Handling Rate Limits

Exponential Backoff

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

if (response.status !== 429) {
return response;
}

const retryAfter = response.headers.get('Retry-After') || 60;
const delay = Math.min(retryAfter * 1000, Math.pow(2, attempt) * 1000);

console.log(`Rate limited. Retrying in ${delay}ms...`);
await new Promise(resolve => setTimeout(resolve, delay));
}

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

Request Queuing

import time
from collections import deque

class RateLimiter:
def __init__(self, max_requests=60, window_seconds=60):
self.max_requests = max_requests
self.window_seconds = window_seconds
self.requests = deque()

def wait_if_needed(self):
now = time.time()

# Remove old requests
while self.requests and self.requests[0] < now - self.window_seconds:
self.requests.popleft()

# Wait if at limit
if len(self.requests) >= self.max_requests:
sleep_time = self.requests[0] + self.window_seconds - now
time.sleep(sleep_time)

self.requests.append(now)

Rate Limit Scopes

Rate limits are applied at different scopes:

ScopeDescription
Per UserLimits per authenticated user
Per OrganizationLimits for entire organization
Per EndpointSome endpoints have specific limits
Per IPFor unauthenticated requests

Endpoint-Specific Limits

Some endpoints have stricter limits:

EndpointLimitReason
POST /auth/login10/minBrute force protection
POST /uploads100/hourResource intensive
GET /reports/*10/minHeavy queries

Best Practices

  1. Cache responses - Reduce unnecessary API calls
  2. Use webhooks - Instead of polling for changes
  3. Batch operations - Use bulk endpoints when available
  4. Monitor usage - Track your rate limit consumption
  5. Implement backoff - Handle 429 responses gracefully

Increasing Limits

Need higher limits? Contact us:

  • Upgrade your plan
  • Request temporary increase for migrations
  • Enterprise custom limits