Rate Limiting

The Gateway enforces rate limits at two levels: organization-wide and per-API-key. Limits use a sliding window algorithm.

Organization-Level Rate Limiting

Shared across all keys

The rate limit applies to your entire organization. All API keys you create count toward the same limit.

Basic plan: 60 req/min total
Sliding window

Limits use a sliding 60-second window — not a fixed reset at the top of the minute. Capacity restores gradually.

No sudden resets — smooth traffic flow

The rate limit applies per organization across all your API keys combined. If your plan allows 60 req/min and you have two keys making requests simultaneously, both count toward that shared limit.

Sliding Window Algorithm

Rate limits use a sliding window — not a fixed reset at the top of each minute. This prevents burst spikes right after a reset.

At any point in time, the window covers the past 60 seconds.
Requests are counted in the current window continuously.
As old requests age out of the window, capacity is restored automatically.
There is no sudden reset — smooths out traffic naturally.
Burst limit (per-second) is enforced in addition to the per-minute limit.

Limits by Plan

PlanRate limit (org-wide)
Free10 req/min
Basic60 req/min
Pro300 req/min
Enterprise9,999 req/min

429 Response

429Too Many Requests
JSON
HTTP 429 Too Many Requests

{
  "error": "Rate limit exceeded. Slow down and try again.",
  "code": "RATE_LIMIT_EXCEEDED"
}

Implementing Retry Logic

When you receive a 429, wait before retrying. Use exponential backoff to avoid hammering the API repeatedly.

#!/bin/bash
MAX_RETRIES=3
DELAY=5
URL="https://dev-api.onlyfans-api.ai/api/models/MODEL_UUID/users/me"

for attempt in $(seq 1 $MAX_RETRIES); do
  http_code=$(curl -s -o /tmp/of_resp.json -w "%{http_code}" "$URL" \
    -H "X-API-Key: sk_live_your_key_here")

  [ "$http_code" != "429" ] && { cat /tmp/of_resp.json; exit 0; }

  echo "Rate limited. Retrying in ${DELAY}s... (attempt $attempt)"
  sleep $DELAY
done
echo "Max retries exceeded"; exit 1

Don't retry on 402

Only retry on 429. A 402 (Insufficient Credits) won't resolve itself by waiting — you need to top up credits first.