Understanding API usage limits and subscription plans
Plan | Rate Limit | Monthly Quota | Features |
---|---|---|---|
Free | 5 req/sec | 100 requests |
|
Developer | 10 req/sec | 2,000 requests |
|
Business | 50 req/sec | 20,000 requests |
|
Enterprise | 200 req/sec | 100,000 requests |
|
In addition to API key limits, we also enforce IP-based rate limits:
Every API response includes headers to help you track both IP and API key rate limits:
X-RateLimit-Limit: 50
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1640995200
X-RateLimit-Monthly-Limit: 25000
X-RateLimit-Monthly-Remaining: 24500
X-RateLimit-Monthly-Reset: 1641024000
async function verifyFaces(reference, selfie) {
const backoff = async (retries) => {
const delay = Math.min(1000 * Math.pow(2, retries), 10000);
await new Promise(resolve => setTimeout(resolve, delay));
};
let retries = 0;
while (true) {
try {
const formData = new FormData();
formData.append('reference', reference);
formData.append('selfie', selfie);
const response = await fetch('https://api.example.com/api/v2/verify', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
},
body: formData
});
// Check rate limit headers
const remaining = response.headers.get('X-RateLimit-Remaining');
const monthlyRemaining = response.headers.get('X-RateLimit-Monthly-Remaining');
console.log(`Remaining requests: ${remaining} (${monthlyRemaining} this month)`);
if (response.status === 429) {
if (retries >= 3) throw new Error('Max retries exceeded');
await backoff(retries++);
continue;
}
const result = await response.json();
if (result.is_spoof) {
console.error('Spoof detected in selfie');
return;
}
return result;
} catch (error) {
console.error('API request failed:', error);
throw error;
}
}
}
To upgrade your subscription plan:
Plan changes take effect immediately. For custom enterprise plans, please contact our sales team.