IN ENGLISH · API DOCS

API rate limits

Each API key may send 1,000 requests a minute by default and may send all 1,000 at once. Every response carries three X-RateLimit-* headers that say how much is left. Over the limit the answer is 429 with code rate_limit_exceeded and a Retry-After header, and that request is not billed. A higher limit is set for the account by support.

Last updated:

[01]RATE LIMITS

The default limit

The rate limit
WhatValue
Limit per keyValue:1,000 requests a minute
BurstValue:1,000 requests
CountedValue:Separately per key: each key of an account has its own bucket
RoutesValue:/v1/* (the account API included), /anthropic/* and /gemini/*
Concurrent requestsValue:No separate limit

The limit is a token bucket: up to the limit may be sent at once, and the bucket refills evenly over the minute. A request refused by this limit is not sent to a model vendor and is not billed. The limit shapes speed only, never spend.

[02]RATE LIMITS

Response headers

Every answer on those routes, served or refused, carries these headers. They describe your key on 1xAi.

Rate-limit headers
HeaderMeaning
X-RateLimit-LimitMeaning:The requests a minute this key is held to
X-RateLimit-RemainingMeaning:Whole requests left in the bucket after this one
X-RateLimit-ResetMeaning:Seconds until the bucket is full again; zero when it is full
Retry-AfterMeaning:On a 429 only: seconds until one more request is possible
Headers of a served responsehttp
HTTP/1.1 200 OK
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1
X-Request-Id: gw_01JD3Z5T8Q0V6W4M2K9R7N1PXA

A vendor's own rate-limit headers (x-ratelimit-*, anthropic-ratelimit-*) are not forwarded, because they describe our account with the vendor, not your key.

[03]RATE LIMITS

Over the limit: the 429 response

The answer of the key's own limithttp
HTTP/1.1 429 Too Many Requests
Retry-After: 1
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 60
Content-Type: application/json; charset=utf-8

{
  "error": {
    "message": "…",
    "type": "rate_limit_exceeded",
    "code": "rate_limit_exceeded"
  }
}

Wait for Retry-After seconds and send again. The official OpenAI and Anthropic SDKs recognise this answer and retry by that header on their own. If you send requests yourself:

Pythonpython
import time, httpx

def call(payload, key):
    while True:
        r = httpx.post(
            "https://1xai.ir/v1/chat/completions",
            headers={"Authorization": f"Bearer {key}"},
            json=payload,
            timeout=600,
        )
        if r.status_code != 429:
            return r
        # Retry-After is in seconds, on both kinds of 429.
        time.sleep(int(r.headers.get("Retry-After", "1")))
[04]RATE LIMITS

Two kinds of 429: your limit, or the vendor being busy

Not every 429 is your key's limit. Sometimes the model's vendor refuses the request because it is busy. The response itself tells which one it is:

The two kinds of 429
SignYour key's limitThe vendor is busy
Error codeYour key's limit:rate_limit_exceededThe vendor is busy:upstream_capacity on the OpenAI-shaped routes; on /anthropic and /gemini the vendor's own error body (rate_limit_error, RESOURCE_EXHAUSTED)
X-RateLimit-RemainingYour key's limit:ZeroThe vendor is busy:Usually above zero
Retry-AfterYour key's limit:Ours: until one more requestThe vendor is busy:The vendor's, relayed as sent
BilledYour key's limit:NoThe vendor is busy:No
Does a higher limit help?Your key's limit:YesThe vendor is busy:No. Send again shortly, or choose another model
[05]RATE LIMITS

Other limits on a request

Other limits
WhatValueWhen exceeded
Request body sizeValue:25 MiBWhen exceeded:413
Body size on /v1/audio/speechValue:1 MiBWhen exceeded:413
Time allowed for the vendor's answerValue:10 minutesWhen exceeded:504 with code upstream_error; not billed when nothing was delivered

On /anthropic and /gemini, when the vendor answers 429, 503 or 529 and nothing has been sent to you yet, the gateway tries up to 3 times before returning the answer.

[06]RATE LIMITS

A higher limit

If 1,000 requests a minute is not enough, open the API keys page of the dashboard (it is in Persian), choose "request a higher limit" («درخواست سقف بالاتر») and state the limit you need and what you are building. That opens a support ticket. Support sets the limit for the account, and it applies to every key of the account at once, with no change to the keys. There is no self-service raise.

Every error code is listed in the error reference.

1xAi is an independent gateway. It is not affiliated with, endorsed by, or a reseller for OpenAI, Anthropic, Google, DeepSeek, xAI, Moonshot AI, Z.ai, Alibaba Qwen, MiniMax or Tencent Hunyuan. Requests are relayed upstream rather than answered by models of our own, so each provider's own usage policies apply to what their models will and will not do, and their model availability is theirs to change. Current reachability is published on the status page.