Rate Limits

Rate limits protect the service and help you control usage costs.

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

FieldTypeRequiredDefaultNotes
API key limitper minuteYesFixed when the key is issued. Your plan sets the default.
Chat requestsmeteredYesCounts retrieval and the downstream provider call.
Search requestsmeteredYesCounts source retrieval without model generation.
External model limitsexternalNoYour own model provider applies its own limits, billing, and rejection rules.

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. This isolates rate-limit problems.

Published by Madeenan Engineering · Updated