Errors & Limits

Errors & Limits

Rate limits & quotas

Every request is admitted against your plan's limits. Responses carry x-ratelimit-* headers so you can back off proactively.

PlanConcurrent streamsRequests / minMonthly characters
Free23010,000
Starter360250,000
Pro103002,000,000
Scale1560010,000,000

Error semantics

StatusCodeMeaning
401invalid_api_keyMissing or invalid key.
429too_many_requestsRequests-per-minute exceeded. Retry after retry-after.
429too_many_concurrent_requestsConcurrent-stream cap reached.
429insufficient_quotaMonthly character quota exhausted.
5xxinternal_errorTransient server error — retry with backoff.

Handling 429

import time, httpx
 
def synth(payload, key):
    while True:
        r = httpx.post(URL, json=payload, headers={"Authorization": f"Bearer {key}"})
        if r.status_code == 429:
            time.sleep(int(r.headers.get("retry-after", "1")))
            continue
        r.raise_for_status()
        return r.content