# Rate limits Source: https://docs.getworg.com/rate-limits Every key has limits on speed and on spend. A request that would pass one is refused before it reaches a lane, and is not billed. ## Limits of a key - **Requests per minute**: 60 · Refilled evenly through the minute. Retry-After says how many seconds until the next request fits. - **Tokens per minute**: 200,000 · Input and output tokens used in the last 60 seconds. One request can go over once; the next one waits. - **Requests at once**: 32 · Requests still running, streams included. - **Monthly budget**: US$50 · Spend in the calendar month, Western Indonesia Time (UTC+7). - These are the values a new key gets. Whoever creates the key can set lower speed limits and a different monthly budget. - The same speed limits apply to the organization as a whole, across all its keys. A second key spreads the work but does not add capacity. - A workspace can have its own requests and tokens per minute and its own budget. They apply on top of the key's. - To go above these values, write to [team@getworg.com](mailto:team@getworg.com). ## When a speed limit is reached - `429 rpm_exceeded` with `Retry-After` in seconds. With 2 requests per minute, the third request in a row waited 30 seconds. - `429 tpm_exceeded` with `Retry-After: 60`. Tokens are counted after each request ends, so one large request can go over the limit once; the next request waits. - `429 concurrency_exceeded` with `Retry-After: 1` while too many requests are still running. The OpenAI SDKs wait for `Retry-After` and retry on their own. See [Retries](https://docs.getworg.com/errors#retries). ## Budgets - A key stops at its monthly budget with `402 key_budget_exceeded`. A top-up does not help; an admin raises the budget or you use another key. - A workspace or the organization can have a monthly budget too: `402 workspace_budget_exceeded` and `402 org_budget_exceeded`. - A month is the calendar month in Western Indonesia Time (UTC+7). - When the balance runs out, requests get `402 insufficient_balance` until you top up. ## The cost hold Before a request is sent, Worg sets aside the most it can cost: every byte of the request body counted as one input token, each image counted at the most one image can cost on that lane, plus `max_tokens` as output. Without `max_tokens`, the output side is the model's output limit or, when that is not known, its whole context window. With `n` above 1, the output side counts once per choice. Through a combo, the hold is for the most expensive lane in it. If the hold does not fit in the balance, or in what is left of a budget, next to the requests still running, the request gets a `402` whose message says the amounts: 402 response: ```json { "error": { "message": "This request can cost up to $0.157311 and $0.010000 is available. Set a lower max_tokens or top up.", "type": "insufficient_balance", "code": "insufficient_balance" } } ``` The hold is released when the request ends, and only what the request used is charged. The same request with `"max_tokens": 100` went through. Set `max_tokens` to keep holds small, most of all on a lane whose output limit is not published, where the hold covers the whole context window. ## The spend spike guard If a key spends far more in one hour than it usually does, Worg suspends it to protect your balance. Requests with it then get `403 key_suspended`, and the organization's alert email is told. - The line is at least US$5 in an hour, and more than 10 times the key's usual hourly spend over the past week. - For a key younger than 7 days, the usual spend is the highest of: the key's own average so far, the average of the organization's other keys, and its monthly budget spread over the month (counted up to US$5 an hour). - An organization owner or admin reviews the key in API keys. If the spend was expected, resume it. If not, rotate it: a new key with the same limits replaces it. - A key that spikes again within 24 hours of a resume can only be rotated. > Expecting a large spend from day one? > > Write to [team@getworg.com](mailto:team@getworg.com) before you start. Worg can set the line for that key. Next: [Errors and retries](https://docs.getworg.com/errors) · [Responses and usage](https://docs.getworg.com/responses)