Rate Limits
Rate limits protect source retrieval, hosted chat generation, and your integration budget.
What This Does
Madeenan enforces per-key limits. Any model provider you call from your own backend may enforce its own limits too.
Fields Explained
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| API key limit | per minute | Yes | — | Configured when the key is issued. Defaults are controlled by your app setup. |
| Chat requests | metered | Yes | — | Counts retrieval and the downstream provider call. |
| Search requests | metered | Yes | — | Counts source retrieval without model generation. |
| External model limits | external | No | — | If your backend calls its own model provider after Madeenan search, that provider can separately rate limit, bill, or reject requests. |
Retry Example
async function madeenanFetch(url, options, attempt = 0) {
const response = await fetch(url, options);
if (response.status !== 429 || attempt >= 3) {
return response;
}
const delay = Math.min(1000 * 2 ** attempt, 8000);
await new Promise((resolve) => setTimeout(resolve, delay));
return madeenanFetch(url, options, attempt + 1);
}
Common Mistakes
- Retrying immediately after a 429.
- Ignoring model-provider limits in your own backend workflow.
- Using one key for every environment and customer.
Security note
Use separate keys for development, staging, and production. It makes rate limit debugging much easier.