Skip to main content

Overview

The Kaspa Developer Platform API implements rate limiting to ensure fair usage and maintain service quality for all users. Rate limits are applied based on your API key tier.

Rate Limit Tiers

We offer free and paid tiers to access the API. You can upgrade/downgrade your tier at any time. For more information, see Pricing Page.

Rate Limit Headers

Every API response includes headers that show your current rate limit status:
ratelimit-limit: 500;w=1 
ratelimit-remaining: 490 
ratelimit-reset: 0
x-request-cost-ru: 10 

Handling Rate Limits

When you exceed a rate limit, you’ll receive a 429 Too Many Requests response:
{
  "statusCode": 429,
  "message": "Rate limit exceeded"
}

Best Practices

  1. Monitor rate limit headers: Track your usage to avoid hitting limits
  2. Implement exponential backoff: When rate limited, wait before retrying
  3. Cache responses: Reduce API calls by caching frequently accessed data
  4. Batch requests: Use batch endpoints when available
  5. Upgrade your tier: If you consistently hit limits, consider upgrading

Example: Exponential Backoff

async function makeRequestWithRetry(url: string, options: RequestInit, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    try {
      const response = await fetch(url, options);
      
      if (response.status === 429) {
        // Rate limited - wait before retrying
        const retryAfter = Math.pow(2, i) * 1000; // Exponential backoff
        await new Promise(resolve => setTimeout(resolve, retryAfter));
        continue;
      }
      
      return response;
    } catch (error) {
      if (i === maxRetries - 1) throw error;
    }
  }
}

Need Higher Limits?

If you need higher rate limits, you can upgrade your plan anytime.
I