aisplice

API reference

Rate limits & retries

#How limits work

Per-key RPM and RPD caps. On 429 the gateway sends Retry-After; upstream limits are protected by circuit breakers so a bad channel does not spike the fleet.

Limits are per key, so splitting projects across keys isolates their throttles. Key-level caps are edited in Console → Keys.

#Retrying correctly

Honor Retry-After when present, otherwise back off exponentially with jitter. Cap total attempts — a hard-down model is better surfaced to your caller than retried forever.

backoff.py
import time, requests

def call_with_backoff(url, headers, body, tries=5):
    for i in range(tries):
        r = requests.post(url, headers=headers, json=body)
        if r.status_code != 429:
            return r
        # Respect Retry-After (seconds); fall back to 2**i backoff.
        wait = int(r.headers.get("Retry-After", 2 ** i))
        time.sleep(wait)
    r.raise_for_status()

Still stuck?

Send us the request ID or the error message and we will look into it.