Overview

API requests are rate limited to ensure stability and fair usage for all users.

Rate Limit

API Rate Limit

100 requests per minuteAll API keys are subject to this rate limit to ensure fair usage and stability.

Rate Limit Headers

Every API response includes headers with rate limit information:
HeaderDescription
X-RateLimit-LimitThe maximum number of requests allowed
X-RateLimit-RemainingThe number of requests remaining
X-RateLimit-ResetThe time when the rate limit resets (Unix timestamp)

Handling Rate Limits

When you exceed the rate limit, you’ll receive a 429 Too Many Requests response:
{
  "success": false,
  "error": {
    "message": "Rate limit exceeded",
    "type": "rate_limit_error",
    "code": "rate_limit_exceeded",
    "retry_after": 45,
    "status": 429
  }
}
The retry_after field indicates how many seconds to wait before retrying.

Best Practices

When rate limited, implement exponential backoff:
async function makeRequestWithBackoff(url, options, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    const response = await fetch(url, options);
    
    if (response.status !== 429) {
      return response;
    }
    
    const retryAfter = response.headers.get('Retry-After') || Math.pow(2, i);
    await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
  }
  
  throw new Error('Max retries exceeded');
}
Cache frequently accessed data to reduce API calls:
  • Client lists that don’t change often
  • Product catalogs
  • Static configuration data
Where possible, use batch operations:
  • Create multiple invoices in a single request
  • Fetch data with appropriate pagination limits
Track your API usage:
  • Log rate limit headers
  • Set up alerts for high usage
  • Plan for traffic spikes

Increasing Rate Limits

If you need higher rate limits for your application:
  1. Contact support at contact@contazen.ro
  2. Provide details about your use case
  3. Include your current usage patterns
  4. Explain expected growth
We’ll work with you to ensure your application has the resources it needs.