
In short: each key has a limit of requests per minute. When you go over it, the API answers 429 with the code rate_limited and the Retry-After header, which says how many seconds to wait. Your program only has to wait that long and try again.
The limits that count
| Who is asking | Limit |
| Each key | A number of requests per minute, given in the X-RateLimit-Limit header. |
| The whole account, adding up its keys | 300 requests per minute (1,000 for reseller accounts, which also have 300 per key). |
These are the current values and they can change. In your program, read the headers instead of hard-coding the numbers.
Seeing the limit and what is left
Every response has three headers:
| Header | What it is |
| X-RateLimit-Limit | Requests allowed per minute. |
| X-RateLimit-Remaining | Requests left in this minute. |
| X-RateLimit-Reset | When the minute ends, in Unix seconds. |
To see them, add -i to curl. Listing the models spends no credits:
curl -i "https://api.interweb.ao/v1/models?type=text" \
-H "Authorization: Bearer $INTERWEB_API_KEY"
GET /v1/limits shows the same as JSON, with the limit and the requests left in the minute:
curl "https://api.interweb.ao/v1/limits" -H "Authorization: Bearer $INTERWEB_API_KEY"
When you reach the limit
{
"error": {
"code": "rate_limited",
"message": "Too many requests. Please try again shortly.",
"correlation_id": "0f8fad5b-d9cb-469f-a165-70867728950e",
"details": {"retry_after": 42}
}
}
|
|
|
An example in Python, which waits the time asked for and doubles the wait if the error comes back:
import os, time, requests
URL = "https://api.interweb.ao/v1/chat/completions"
HEADERS = {"Authorization": "Bearer " + os.environ["INTERWEB_API_KEY"]}
def send(body, attempts=5):
wait = 1
for _ in range(attempts):
r = requests.post(URL, headers=HEADERS, json=body, timeout=60)
if r.status_code != 429 or r.json()["error"]["code"] != "rate_limited":
return r
wait = max(int(r.headers.get("Retry-After", wait)), wait)
time.sleep(wait)
wait *= 2
return r
The code checks for rate_limited because there is another 429: plan_limit_reached, when the Coding Plan points run out. That one does not pass in seconds: see plans and credits.
What uses up requests without you noticing
Each status check of a generation counts as a request: check every 5 seconds or more. The MCP server tools, the aio commands and the requests of coding agents, which make many in a row, also count. The OpenAI SDKs retry a 429 on their own, twice by default. If you have several programs, give each its own key: the limit is per key, but the account limit adds them all up.
| The limits of other API operations, such as domains and SMS, are in API request limits. |
|
Want to know what each key has spent? See the History in All in One AI. See All in One AI |
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from 5.940,00 Kz/mo (3-year plan, with coupon) See plans |











