Limites de Taxa
| Tipo de endpoint | Limite | Âmbito |
|---|---|---|
| Autenticação | 10 req/min | por IP |
| Configuração de runtime | 1.000 req/min | por token de incorporação |
| Submissão de consentimento | 300 req/min | por token de incorporação |
| Revogação de consentimento | 60 req/min | por token de incorporação |
| Criação de análise | 10 req/min | por tenant |
| Carregamento de média | 20 req/min | por tenant |
| Gestão (geral) | 120 req/min | por chave de API |
Cabeçalhos de limite de taxa
Cada resposta inclui:
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1741521600
Quando o limite de taxa é excedido, recebe uma resposta 429:
{
"error": {
"code": "rate_limited",
"message": "Too many requests. Try again in 30 seconds."
}
}
Gerir limites de taxa
Implemente backoff exponencial quando receber um 429:
async function fetchWithRetry(url, options, maxRetries = 3) {
for (let attempt = 0; attempt < maxRetries; attempt++) {
const res = await fetch(url, options);
if (res.status !== 429) return res;
const retryAfter = parseInt(res.headers.get('X-RateLimit-Reset')) - Date.now() / 1000;
await new Promise(r => setTimeout(r, (retryAfter + 1) * 1000));
}
throw new Error('Rate limit retries exhausted');
}