Skip to main content

Rate Limits

The Digital.ai Platform implements rate limiting to ensure fair usage and system stability. When you exceed rate limits your requests are blocked and you receive diagnostic headers to help you understand why.

Understand Rate Limit Headers

Every API response includes headers that show your current rate limit status:

HeaderDescription
X-RateLimit-LimitMaximum number of requests allowed in the current time window
X-RateLimit-RemainingNumber of requests you have left in the current time window
X-RateLimit-ResetUnix timestamp indicating when your rate limit resets
X-RateLimit-WindowTime window for the rate limit (sec, min, hour, or day)

Check Your Rate Limit Status

Use the following command to view rate limit headers in your API response:

curl -I -H "Authorization: Bearer YOUR_TOKEN" https://api.us.digital.ai/endpoint/

Look for the X-RateLimit-* headers in the output.

Rate Limit Best Practices

To avoid hitting rate limits:

  • Monitor headers - Check X-RateLimit-Remaining before making batch requests
  • Implement backoff - When you receive a 429 error, wait before retrying
  • Use reset time - Calculate wait time from X-RateLimit-Reset
  • Spread requests - Distribute API calls evenly over time
  • Cache responses - Reduce redundant API calls

Example: Wait Before Retry

# Get reset time from header
RESET_TIME=$(curl -I https://api.us.digital.ai/endpoint/ 2>&1 | grep X-RateLimit-Reset | awk '{print $2}')

# Calculate wait time
WAIT_SECONDS=$((RESET_TIME - $(date +%s)))

# Wait before retrying
sleep $WAIT_SECONDS

Troubleshoot Blocked Requests

When your request is blocked, the response includes the X-K6i-Waf-Blocked header to indicate the reason. Use the following sections to diagnose and resolve the specific type of block.

Rate Limit Exceeded (429 Error)

You've made too many requests within the allowed time window. This can happen across multiple time windows (second, minute, hour, or day).

Common causes:

  • Making requests too quickly
  • Running multiple scripts simultaneously
  • Not implementing proper retry logic

How to identify: Look for HTTP 429 status and X-K6i-Waf-Blocked: rate-limit header.

The HTTP 429 status includes the following headers:

HTTP/1.1 429 Too Many Requests
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1702045260
X-RateLimit-Window: min
X-K6i-Waf-Blocked: rate-limit

API rate limit exceeded

What to do

  1. Check the X-RateLimit-Remaining header to see how many requests you have left.
  2. Wait until the time indicated in X-RateLimit-Reset before retrying.
  3. Convert the Unix timestamp to a readable format:
date -d @1702045260
  1. Spread your requests evenly over time to avoid future rate limit errors.

Common Rate Limiting Issues

I Have Remaining Requests but Still Receive a 429 Error

Multiple time windows are checked simultaneously (second, minute, hour, day). You might have requests remaining in the minute window but exceeded the second window.

Solution: Check the X-RateLimit-Window header to see which window you exceeded.

How Do I Convert the Reset Timestamp?

The X-RateLimit-Reset value is a Unix timestamp (seconds since January 1, 1970).

Convert to readable time:

# Linux/Mac
date -d @1702045200

# Or use an online converter: https://www.epochconverter.com/

Get Help

Run this command and include the output when contacting support:

curl -v -H "Authorization: Bearer YOUR_TOKEN" \
https://api.us.digital.ai/endpoint/ 2>&1 | grep -E "(X-RateLimit|X-K6i-Waf|HTTP)"

Contact Support

When contacting Customer Support, include the information relevant to your issue:

For rate limit issues (429 errors):

  • Values of all X-RateLimit-* headers
  • The X-RateLimit-Window that triggered the limit
  • Your current IP address: curl https://api.ipify.org
  • Request details:
    • Endpoint URL
    • Timestamp of when the error occurred
    • What you were trying to do
note

Rate limits vary by service and account type. The headers in each response show your actual limits.

For IP allowlist issues (403 errors):

  • The X-K6i-Waf-Rule header value
  • Your current IP address: curl https://api.ipify.org
  • Whether you recently changed networks or locations
  • Request details:
    • Endpoint URL
    • Timestamp of when the error occurred