Skip to main content

Rate Limiting

To ensure the stability and reliability of the Partner API, SASHA enforces rate limits on the number of requests a partner account can send per minute to any of the Partner API endpoints.

Rate limiting is a measure to prevent system overload and ensure equitable resource distribution among all partners.

Rate Limit Behavior

  • When an account exceeds the rate limit, the API responds with an error indicating that the allowed request quota has been reached.

    • REST API responds with 429 - Too many requests status code
    • gRPC API responds with RESOURCE_EXHAUSTED error
  • Access is then temporarily restricted for a brief period (typically 1 minute), after which the request counter is reset, and API calls are once again accepted.

Best Practices

To avoid hitting rate limits:

  • Implement exponential backoff: If you receive a rate limit error, wait before retrying
  • Monitor your usage: Keep track of your API call frequency
  • Batch requests when possible: Combine multiple operations into fewer requests
  • Cache results: Store frequently accessed data to reduce API calls

Rate Limit Headers

The API may include rate limit information in response headers:

  • X-RateLimit-Limit: Maximum requests allowed per time window
  • X-RateLimit-Remaining: Number of requests remaining in current window
  • X-RateLimit-Reset: Time when the rate limit resets