Rate Limiting

Understand Cencori's rate limiting system, how to handle limits, and best practices for high-volume applications.

What is Rate Limiting?

Rate limiting controls how many requests you can make in a given time period. This protects the platform from abuse and ensures fair usage for all users.

Cencori enforces rate limits at multiple levels: per project, per user, and per organization.

Default Rate Limits

TierRequests/MinuteRequests/DayBurst Limit
Free101,00020
Starter6010,000100
Pro30050,000500
EnterpriseCustomCustomCustom

Note: Burst limits allow short spikes above the per-minute limit, useful for handling traffic bursts.

Rate Limit Headers

Every response includes headers showing your current rate limit status:

HeaderDescriptionExample
X-RateLimit-LimitMax requests per window60
X-RateLimit-RemainingRequests left in window45
X-RateLimit-ResetUnix timestamp when limit resets1701234567
Retry-AfterSeconds to wait (when limited)45

Handling Rate Limit Errors

When you exceed the rate limit, you'll receive a 429 Too Many Requests error:

rate-limit-error.json

Exponential Backoff Implementation

exponential-backoff.ts

Checking Rate Limits Before Requests

check-limits.ts

Best Practices

1. Implement Exponential Backoff

Always retry rate-limited requests with exponential backoff rather than aggressive retries.

2. Monitor Headers

Track X-RateLimit-Remaining to know when you're approaching limits.

3. Use Request Queues

Queue requests and process them at a controlled rate to stay under limits.

4. Cache Responses

Cache identical requests to reduce API calls and stay under limits.

5. Distribute Load

If hitting limits, consider using multiple projects or upgrading tier.

Request Queue Implementation

request-queue.ts

Upgrading Rate Limits

If you consistently hit rate limits:

  • Upgrade your subscription tier in the dashboard
  • Contact sales for custom enterprise limits
  • Optimize your usage patterns
  • Implement caching and batching