Rate Limits
Find your account limits, check remaining capacity, and request higher limits.
Koah keeps inference free through ads shown in your app. Request limits help keep token generation sustainable as your app grows.
Rate limits set how many requests and tokens your account can use per minute.
| Limit | Counts |
|---|---|
| Requests per minute (RPM) | Each request. |
| Tokens per minute (TPM) | Input and output tokens. Cached and uncached input tokens count equally. |
Default limits by account tier
| Account tier | RPM | TPM |
|---|---|---|
| Basic | 120 | 500,000 |
| Pro | 120 | 1,000,000 |
These are account defaults. A model, service tier, or organization-specific configuration can set different limits. A request can reach either the request limit or the token limit, even when capacity remains for the other.
These defaults and the response headers below are planned for private preview and may change.
Check your limits
Check these headers on successful responses and 429 Too Many Requests
responses to see the limits that apply to your request.
| Header | What it tells you |
|---|---|
x-ratelimit-limit-requests | The maximum requests allowed per minute. |
x-ratelimit-limit-tokens | The maximum tokens allowed per minute. |
x-ratelimit-remaining-requests | The requests remaining in the current window. |
x-ratelimit-remaining-tokens | The tokens remaining in the current window. |
x-ratelimit-reset-requests | The time until the request limit resets. |
x-ratelimit-reset-tokens | The time until the token limit resets. |
retry-after | How long to wait before retrying a rate-limited request, when provided. |
Handle a rate limit
If you receive 429 Too Many Requests, follow retry-after when it is present.
Otherwise, retry with backoff: wait longer between each attempt and stop after
a small number of retries. Do not immediately repeat every failed request.
Spread requests over time and reduce concurrent requests to stay within your limits. If your app regularly needs more capacity, request higher limits.
Response codes
These are the expected HTTP responses during private preview. Response details may change. Use the reason returned with an error to decide what to do next.
| Code | What it means | What to do |
|---|---|---|
200 | The request succeeded or the stream started. | Show the content. Render an ad only if Koah returns an ad ID, after the stream finishes successfully. |
400 / 422 | The request contains invalid or unsupported input. | Check the request fields and model. |
401 | The API key is missing or invalid. | Check your key and authentication settings. |
403 | Your app does not have access to the requested operation. | Contact Koah to check your access. |
404 | The endpoint or model was not found. | Check the base URL, endpoint, and model ID. |
429 β request volume | Your app is sending too many requests. | Slow down, follow retry guidance, or request higher limits. |
429 β ad rendering | Your rate limit was reduced because requested ads repeatedly did not render. | Fix the ad integration and contact Koah for a review. Repeated retries will not fix the cause. |
5xx | Koah or a model provider has a temporary service error. | Retry with backoff and keep the user's work. |
429 can have different causes. Check the returned reason before retrying.
Responses without an ad ID do not require ad display and do not count as missed ads.
See the error reference for more detail.
Request higher limits
Need more token capacity? Request higher limits with your app name or publisher ID, expected request and token volume, and an example of your ad placement. Do not include API keys or private user queries.
We will work with you to improve the ad placement and user experience so that the value of the ads can support more token generation. Better visibility, relevance, and placement design can help your app support higher demand.
Higher limits are reviewed with your integration; they are not automatic.