Limits
How many calls a key can make, and how large a call can be.
Rate limits
Every call counts against two limits at once. Each operation costs units, most of them 1; the reference gives each one's cost.
| Limit | Units | Counts |
|---|---|---|
| Per key | 120 a minute | The calls of one key |
| Per organisation | 600 a minute | The calls of every key in the organisation, together |
| Keys that do not work | 30 a minute | Calls with a mistyped, revoked or expired key, per address |
Assistants connected over MCP count apart, so your scripts never slow your team's assistants down.
When a call goes over
It answers 429, starts nothing and costs no credits. The Retry-After header says how many seconds to wait, and
the body says which limit the call went over:
HTTP/1.1 429 Too Many Requests
Retry-After: 60
Content-Type: application/problem+json
{
"type": "about:blank",
"title": "Too Many Requests",
"status": 429,
"code": "rate_limited",
"detail": "This key went over its limit of 120 units a minute; each operation costs 1 to 4 units. Try again in 60 seconds.",
"retry_after_seconds": 60,
"limit": { "scope": "key", "units": 120, "window_seconds": 60 }
}Limits count in windows of 60 seconds, so waiting retry_after_seconds always clears the limit. Send the same call
again then, with the same Idempotency-Key for create_with_awen.
const send = (operation: string, body: object, headers: Record<string, string> = {}) =>
fetch(`https://app.awen.ai/api/v1/${operation}`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AWEN_API_KEY}`,
"Content-Type": "application/json",
...headers,
},
body: JSON.stringify(body),
});
/** Sends a call, and once more after the wait Awen asks for when it is over a limit or busy. */
const sendWithRetry = async (operation: string, body: object, headers: Record<string, string> = {}) => {
const response = await send(operation, body, headers);
if (response.status !== 429 && response.status !== 503) return response;
const { retry_after_seconds = 5 } = await response.json();
await new Promise((resolve) => setTimeout(resolve, retry_after_seconds * 1000));
return send(operation, body, headers);
};When Awen is busy
A call can also answer 503 with busy: Awen had no room to start it, and nothing started. Retry-After and
retry_after_seconds say to wait a few seconds.
Sizes
| Bound | Value |
|---|---|
| Request body | 64 KiB; 256 KiB for create_with_awen; 4 MiB for import_file |
| A list page | 50 items, then a cursor for the next page |
| Ids | 128 characters |
create_with_awen | A prompt of 32,000 characters and 20 files |
trash_entries, restore_entries | 25 entries a call |
download | 25 files and folders a call, 50 files in its ZIP |
get_turns | 10 turns a call |
Time
A call has 10 seconds, 45 seconds for create_with_awen, enhance, get_turn and get_turns, and 55 seconds
for import_file. A call that runs
out answers 504 with timeout. A change that timed out may still have been saved: read the project before you
send it again, or send it with the same Idempotency-Key.