RefineAI Logo
0
%

API Rate Limits

Learn about RefineAI's API rate limits, how they're calculated, and best practices for managing your API usage.

Rate Limit Overview

RefineAI implements rate limiting to ensure fair usage of our API and maintain service stability for all users. Rate limits are applied based on your subscription plan and are calculated per API key.

Rate Limit Structure

PlanRequests per MinuteRequests per HourRequests per Day
Free101001,000
Basic305005,000
Professional601,00010,000
Enterprise1202,50025,000

Note: Enterprise customers can request custom rate limits based on their specific needs.

Rate Limit Headers

RefineAI includes rate limit information in the response headers of all API requests. You can use these headers to monitor your usage and implement appropriate backoff strategies.

Response Headers

X-RateLimit-Limit

The maximum number of requests allowed in the current time window.

X-RateLimit-Remaining

The number of requests remaining in the current time window.

X-RateLimit-Reset

The time at which the current rate limit window resets, in Unix epoch seconds.

Example Response Headers

HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1620000000

Rate Limit Exceeded

When you exceed the rate limit, the API will return a 429 Too Many Requests response with information about when you can retry.

Example Rate Limit Exceeded Response

HTTP/1.1 429 Too Many Requests
Content-Type: application/json
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1620000060
Retry-After: 60

{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded. Please retry after 60 seconds.",
    "retry_after": 60
  }
}

Best Practices

Follow these best practices to avoid hitting rate limits and ensure smooth API usage:

Implement Exponential Backoff

When you receive a 429 response, implement an exponential backoff strategy. Start with the suggested retry time and increase it exponentially for subsequent failures.

Cache Responses

Cache API responses when possible to reduce the number of requests. Many RefineAI API responses include cache control headers to indicate how long the data can be cached.

Use Bulk Operations

When possible, use bulk operations instead of making multiple individual requests. For example, analyze multiple files in a single request rather than making separate requests for each file.

Rate Limit Considerations

Keep these considerations in mind when working with RefineAI API rate limits:

  • Rate limits are applied per API key, not per user or organization. If you have multiple applications using the same API key, they will share the rate limit.
  • Some API endpoints may have different rate limits than others. For example, analysis endpoints may have lower limits than status check endpoints.
  • If you consistently hit rate limits, consider upgrading your subscription plan or contacting our support team to discuss your needs.