Rate Limits

AgentSync API Rate Limits

  • Token Endpoints: 200 token requests per minute
  • ProducerSync API Endpoints: 300 requests per minute

⚠️ AgentSync rate limits are subject to change to ensure fair and high quality usage for all customers

What is Rate Limiting and Why We Use It?

A rate limit is the maximum number of requests allowed in a given time window (e.g., 100 requests per minute).

Rate limiting is used to prevent abuse, ensure service stability and protect resources. It is essential for maintaining a stable and fair API ecosystem for all AgentSync customers.

How Rate Limiting Works

  1. Client Identification: Each request from a client is identified by an API key or token.
  2. Tracking Usage: The server tracks the number of requests made by each client over time.
  3. Enforcement: If a client exceeds their rate limit, the server returns an error response (HTTP 429 - Too Many Requests).
  4. Resetting Limits: The usage count resets after the time window ends.

Best Practices for Handling Rate Limiting

  • Monitor Your Usage: Keep an eye on the ratelimit-remaining header to gauge how many requests you can still make within the time frame ** By using these headers, we can configure the HTTP client to retry once the time window has elapsed.
  • Implement Exponential Backoff: If you receive a 429 error, wait and retry your request after a delay that increases with each subsequent failure. We recommend building some randomness into the backoff schedule to avoid a "thundering herd"
  • Reusing Tokens: for the token endpoint specifically you can avoid being rate limited by re-using your tokens. Tokens are good for 60 minutes (3600 seconds).

Rate Limit Responses

Headers

When you make an API request, you will receive additional headers included in the response to help you monitor your rate limit status:

  • ratelimit-limit: Maximum number of requests allowed in the current window
  • ratelimit-remaining: Number of requests remaining in the current window
  • ratelimit-reset: Time when the rate limit will reset
  • retry-after: only present on 429 errors to indicate how long the service is expected to be unavailable to the client. This means the client must wait a certain number of seconds before making another request.

Successful Response Header Example

ratelimit-limit: 300
ratelimit-remaining: 299
ratelimit-reset: 17

Exceeding Rate Limit Response Example

HTTP/1.1 429 Too Many Requests
{ "message": "API rate limit exceeded"}