Rate limits & errors

    Rate limits are enforced per API key on three windows: per minute, per day, and per month. The first limit reached applies: a burst that exceeds the per-minute ceiling is throttled even when daily headroom remains.

    Your key's limits and usage are shown in the Console. Higher limits are an account change, not a code change: contact us.

    When you hit a limit

    The API returns 429 Too Many Requests. Back off and retry:

    python
    import time, requests def search_with_backoff(payload, headers, tries=5): for attempt in range(tries): r = requests.post("https://api.desearch.ai/desearch/ai/search", json=payload, headers=headers, timeout=60) if r.status_code != 429: r.raise_for_status() return r.json() time.sleep(2 ** attempt) raise RuntimeError("rate limited after retries")

    Spread traffic instead of bursting where you can, and reuse results. Repeated identical prompts spend budget without adding information.

    Error codes

    StatusMeaningWhat to do
    400Malformed request.Check JSON syntax and required fields.
    401Missing or invalid API key.See Authentication.
    402Out of credits.Top up in the Console.
    422Valid auth, invalid parameters.Compare against the API Reference; remove unknown fields.
    429Rate limit exceeded.Retry with exponential backoff, as above.
    5xxServer-side failure.Retry once after a short delay; check status.desearch.ai.

    Every successful response carries X-Desearch-Cost-Usd. Log it and you always know spend per request without waiting for the bill.