Skip to main content

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 a common practice for APIs, and they're put in place for a few different reasons:

  • They help protect against abuse or misuse of the API. For example, a malicious actor could flood the API with requests in an attempt to overload it or cause disruptions in service. By setting rate limits, Vega can prevent this kind of activity.
  • Rate limits help ensure that everyone has fair access to the API. If one person or organization makes an excessive number of requests, it could bog down the API for everyone else. By throttling the number of requests that a single user can make, Vega ensures that the most number of people have an opportunity to use the API without experiencing slowdowns.

Rate Limit Details

  1. Rate limit of 1000 requests per hour: This means you are allowed to make up to 1000 requests to our APIs within an hour. If you exceed this limit, you'll likely be temporarily blocked from making more requests until the next hour begins.

  2. 4 concurrent requests: This means you are allowed to make up to 4 requests at the same time. So, instead of sending one request and waiting for it to finish before sending the next one, you can send up to 4 requests all at once. This can speed up the process if you have many requests to make.

  3. When you use 4 concurrent requests, each of those requests counts towards your total limit of 1000 requests per hour. This means if you're making four requests at the same time, all four are subtracted from your limit. For instance, if you make 4 concurrent requests in one go, your remaining limit would be 1000 - 4 = 996 requests for the rest of the hour. If you continuously make 4 requests at a time without stopping, you would reach your limit quicker than if you were making one request at a time. However, the advantage of concurrent requests is that you can get more work done faster.

Rate Limit Mitigation - Retrying with exponential backoff

One easy way to avoid rate limit errors is to automatically retry requests with a random exponential backoff. Retrying with exponential backoff means performing a short sleep when a rate limit error is hit, then retrying the unsuccessful request. If the request is still unsuccessful, the sleep length is increased and the process is repeated. This continues until the request is successful or until a maximum number of retries is reached. This approach has many benefits:

  • Automatic retries means you can recover from rate limit errors without crashes or missing data.
  • Exponential backoff means that your first retries can be tried quickly, while still benefiting from longer delays if your first few retries fail.
  • Adding random jitter to the delay helps retries from all hitting at the same time.
  • Note that unsuccessful requests contribute to your per-hour limit, so continuously resending a request won’t work.

Rate Limits in headers

You can view important information about your rate limits such as the remaining requests and other metadata in the headers of the HTTP response.

HeaderSample ValueDescription
x-ratelimit-limit1000The total limit for a given period of time
x-ratelimit-remaining995The amount of requests remaining out of the total limit
x-ratelimit-limit-reset1619380800The timestamp, in epoch, when the limit will reset to the value in x-rate-limit-limit

Requesting Limit Increases

Vega is happy to work with you to increase your API rate limits. To request an API rate limit increase, contact your Customer Success Manager or send a request to support@vegacloud.io. Please provide detailed information about your use case, current limitations, and the specific increase you need. Ensure your request outlines the business or technical necessity for the increase, demonstrating a clear understanding of the API's usage policies and your commitment to adhering to best practices.