Skip to content

Rate limits

The /v1 API enforces two independent, fixed-window rate limits:

ScopeDefaultEnv var
Per API key60 requests/minOCTO_API_RATE_LIMIT_PER_MIN
Per workspace600 requests/minOCTO_API_WS_RATE_LIMIT_PER_MIN

Exceeding either limit returns:

HTTPtype / codeWhenSDK exception
429rate_limit_errorPer-key or per-workspace rate limit exceededRateLimitError

Every response — success and 429 alike — carries the current budget so an agent can pace itself proactively instead of only reacting to a 429:

HeaderMeaning
X-RateLimit-LimitRequests allowed in the window
X-RateLimit-RemainingRequests left in the current window (0 once exceeded)
X-RateLimit-ResetUnix time (seconds) when the window resets
Retry-AfterSeconds to wait before retrying (on 429 only)

The headers report whichever of the two limits (per-key or per-workspace) you are closest to hitting. Slow down as X-RateLimit-Remaining approaches 0.

import time
from openai import RateLimitError
try:
resp = client.responses.create(model="claude-sonnet-4-6", input="...")
except RateLimitError as e:
retry_after = int(e.response.headers.get("retry-after", "1"))
time.sleep(retry_after)
# retry

If you’re consistently hitting the per-key limit, spread load across multiple keys minted for different automated clients (see Get an API key) rather than retrying in a tight loop — the per-workspace limit still applies across all of a workspace’s keys combined.

See Errors for the full error table.