Rate limits

Rate limits are restrictions that our API imposes on the number of times a user or client can access our services within a specified period of time.

Why Do We Have Rate Limits?

Rate limits are common practice for APIs, and they're put in place for several reasons:

  1. Prevent Abuse: They protect against malicious activities like flooding the API with requests to overload or disrupt services.
  2. Fair Access: By limiting the number of requests per user, we ensure that all users can access the API without experiencing slowdowns.
  3. Manage Load: Rate limits help you control the overall load on our infrastructure, maintaining consistent performance even during high demand.

Rate limits are measured in various ways:

  • RPM (requests per minute)
  • RPD (requests per day)
  • TPM (tokens per minute)
  • TPD (tokens per day)
  • IPM (images per minute)

Our API uses rate limiting to ensure fair usage across different subscription plans. Depending on your subscription plan, you will have different limits on the number of API requests you can make.

Subscription Plans and Rate Limits

TierPriceRPM(Requests per minute)
HobbyPay as you go30
Pro$49 + Usage100
Startup$299 + Usage300
EnterpriseCustomCustom

Possible Solutions to Common Issues

  1. Handling Rate Limit Exceeded Errors: If you encounter errors indicating that the rate limit has been exceeded, consider implementing a retry mechanism with exponential backoff. This involves waiting for a progressively longer time before retrying the request.
  2. Optimizing Request Frequency: Ensure that your application makes requests efficiently and only when necessary. Combining multiple smaller requests into a single request can help in reducing the frequency of requests.
  3. Monitoring and Logging: Regularly monitor your API usage and log the rate limit status. This can help in identifying usage patterns and optimizing your request strategy to avoid hitting the rate limits

By following these guidelines and using the provided code examples, you can effectively manage rate limits in your application, ensuring smooth and efficient interaction with ModelBox's API.