Skip to main content
← Back to API Documentation

Rate Limits & Quotas

Understand rate limiting and optimize for high-volume usage

Sliding Window
Per-Key Limits
Burst Allowance

Rate Limit Tiers

Free

60 req/min
API Requests60 req/min
Burst Allowance120 requests
WebSocket Connections50 connections
Concurrent Streams10 streams
Bandwidth100 GB/month
Storage10 GB
Webhook Endpoints5 endpoints

Pro

300 req/min
API Requests300 req/min
Burst Allowance600 requests
WebSocket Connections500 connections
Concurrent Streams50 streams
Bandwidth1 TB/month
Storage100 GB
Webhook Endpoints25 endpoints

Enterprise

1000 req/min
API Requests1000 req/min
Burst Allowance2000 requests
WebSocket ConnectionsUnlimited
Concurrent StreamsUnlimited
BandwidthUnlimited
StorageUnlimited
Webhook EndpointsUnlimited

Rate Limit Headers

Understand rate limit information in response headers

Every API response includes rate limit information in the headers:

HTTP/1.1 200 OK
X-RateLimit-Limit: 300           # Total requests allowed per window
X-RateLimit-Remaining: 245       # Requests remaining in current window
X-RateLimit-Reset: 1731585600    # Unix timestamp when limit resets
X-RateLimit-Window: 60           # Window size in seconds
Retry-After: 35                  # Seconds to wait (only on 429 responses)

Sliding Window Algorithm

WAVE uses a sliding window algorithm, not a fixed window. This means your rate limit is calculated based on a rolling 60-second period, providing smoother rate limiting without sudden resets.

Burst Allowance

Each tier includes burst allowance (2x the per-minute limit) for handling short-term traffic spikes. Sustained high traffic will still be rate limited.

Handling Rate Limit Errors (429)

Proper retry strategies for rate-limited requests

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

      // Check rate limit headers
      const remaining = parseInt(response.headers.get('X-RateLimit-Remaining') || '0');
      const limit = parseInt(response.headers.get('X-RateLimit-Limit') || '1');

      // Log warning if approaching limit
      if (remaining < limit * 0.1) {
        console.warn(`Rate limit warning: ${remaining}/${limit} requests remaining`);
      }

      // Handle rate limit
      if (response.status === 429) {
        const retryAfter = parseInt(response.headers.get('Retry-After') || '60');

        if (attempt < maxRetries) {
          console.log(`Rate limited. Retrying after ${retryAfter}s...`);
          await sleep(retryAfter * 1000);
          continue;
        } else {
          throw new Error('Max retries exceeded');
        }
      }

      // Success
      if (response.ok) {
        return await response.json();
      }

      throw new Error(`HTTP ${response.status}: ${response.statusText}`);

    } catch (error) {
      if (attempt === maxRetries) throw error;

      // Exponential backoff for other errors
      const delay = Math.min(1000 * Math.pow(2, attempt), 30000);
      await sleep(delay);
    }
  }
}

function sleep(ms) {
  return new Promise(resolve => setTimeout(resolve, ms));
}

// Usage
const data = await makeRequestWithRetry('https://api.wave.inc/v1/streams', {
  headers: {
    'Authorization': `Bearer ${API_KEY}`
  }
});

Best Practices for High-Volume Usage

Rate Limit Optimization

  • Monitor headers: Track X-RateLimit-Remaining and throttle proactively
  • Implement backoff: Use exponential backoff with jitter
  • Batch requests: Use batch endpoints when available
  • Cache responses: Cache GET requests to reduce API calls

Alternative Approaches

  • Use WebSockets: Real-time data doesn't count toward rate limit
  • Use webhooks: Event-driven architecture reduces polling
  • Request upgrade: Contact sales for higher limits
  • Distribute load: Use multiple API keys if appropriate

Resource Quotas

Monthly quotas and overage handling

Quota Tracking

Track your current usage against quotas using the billing API:

GET https://api.wave.inc/v1/billing/usage

{
  "period_start": "2025-11-01T00:00:00Z",
  "period_end": "2025-11-30T23:59:59Z",
  "usage": {
    "streaming_minutes": 45320,
    "storage_gb": 87.5,
    "bandwidth_gb": 450.2,
    "api_requests": 1245000
  },
  "quotas": {
    "streaming_minutes": 100000,
    "storage_gb": 100,
    "bandwidth_gb": 1000,
    "api_requests": null  // null = unlimited
  },
  "usage_percentage": {
    "streaming_minutes": 45.32,
    "storage_gb": 87.5,
    "bandwidth_gb": 45.02
  },
  "overage_charges": 12.50
}
Rate Limits & Quotas - WAVE API Documentation | WAVE