Skip to content
Go to Micro
Using the API

Rate Limits

API rate limits and how to handle them

The Micro API enforces rate limits per API key to ensure availability for all users.

LimitValue
Requests per second10
Requests per month1,000

:::note These limits apply during the beta period and may change. Contact support if you need higher limits for a specific use case. :::

When you exceed the limit, the API returns 429 Too Many Requests. The Retry-After header tells you how many seconds to wait.

async function queryWithRetry(teamId: string, body: object, retries = 3) {
const res = await fetch(`https://api.micro.so/v2/prism/query/${teamId}/contact`, {
method: 'POST',
headers: { 'x-api-key': apiKey, 'Content-Type': 'application/json' },
body: JSON.stringify(body),
});
if (res.status === 429 && retries > 0) {
const retryAfter = parseInt(res.headers.get('Retry-After') ?? '5', 10);
await new Promise(r => setTimeout(r, retryAfter * 1000));
return queryWithRetry(teamId, body, retries - 1);
}
return res;
}