Pular para o conteúdo principal

Limites de taxa

Tipo de endpointLimiteÂmbito
Autenticação10 req/minpor IP
Configuração runtime1.000 req/minpor token de integração
Submissão de consentimento300 req/minpor token de integração
Revogação de consentimento60 req/minpor token de integração
Criação de análise10 req/minpor tenant
Upload de média20 req/minpor tenant
Gestão (geral)120 req/minpor chave 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 é atingido, recebe uma resposta 429:

{
"error": {
"code": "rate_limited",
"message": "Too many requests. Try again in 30 seconds."
}
}

Tratamento de limites de taxa

Implemente recuo 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');
}