Rate Limits

API usage limits and quotas

The VicSee API enforces rate limits to ensure fair usage and platform stability.

Limits by Plan

PlanRequests/DayAPI Access
Free0No API access
Starter100Yes
Pro500Yes
EnterpriseUnlimitedYes

Rate limits are per user, not per API key. All keys under your account share the same limit.

Rate Limit Headers

Every API response includes rate limit information:

HeaderDescriptionExample
X-RateLimit-LimitMax requests per day500
X-RateLimit-RemainingRequests left today423
X-RateLimit-ResetWhen limit resets2024-12-28T00:00:00.000Z

Example Response Headers

HTTP/1.1 200 OK
X-RateLimit-Limit: 500
X-RateLimit-Remaining: 423
X-RateLimit-Reset: 2024-12-28T00:00:00.000Z

When You Hit the Limit

When you exceed your rate limit, you'll receive a 429 Too Many Requests response:

{
  "success": false,
  "error": {
    "code": "RATE_LIMITED",
    "message": "Rate limit exceeded. Limit: 500/day. Resets at: 2024-12-28T00:00:00.000Z"
  }
}

Best Practices

1. Check Headers Proactively

Monitor X-RateLimit-Remaining before making requests:

async function makeRequest() {
  const response = await fetch('https://vicsee.com/api/v1/generate', {
    // ... request options
  });

  const remaining = response.headers.get('X-RateLimit-Remaining');
  if (remaining && parseInt(remaining) < 10) {
    console.warn('Running low on API quota');
  }

  return response.json();
}

2. Implement Exponential Backoff

When rate limited, wait before retrying:

async function requestWithRetry(fn, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    try {
      return await fn();
    } catch (error) {
      if (error.code === 'RATE_LIMITED' && i < maxRetries - 1) {
        const delay = Math.pow(2, i) * 1000; // 1s, 2s, 4s
        await new Promise(r => setTimeout(r, delay));
        continue;
      }
      throw error;
    }
  }
}

3. Queue Requests

For batch operations, implement a request queue:

class RateLimitedQueue {
  constructor(requestsPerSecond = 1) {
    this.queue = [];
    this.interval = 1000 / requestsPerSecond;
    this.processing = false;
  }

  async add(requestFn) {
    return new Promise((resolve, reject) => {
      this.queue.push({ fn: requestFn, resolve, reject });
      this.process();
    });
  }

  async process() {
    if (this.processing || this.queue.length === 0) return;
    this.processing = true;

    while (this.queue.length > 0) {
      const { fn, resolve, reject } = this.queue.shift();
      try {
        resolve(await fn());
      } catch (e) {
        reject(e);
      }
      await new Promise(r => setTimeout(r, this.interval));
    }

    this.processing = false;
  }
}

Need Higher Limits?

If you need more than 500 requests/day:

  1. Upgrade to Enterprise - Contact us for custom limits
  2. Contact Support - [email protected]

Enterprise plans include:

  • Unlimited API requests
  • Priority queue processing
  • Dedicated support
  • Custom SLAs