Advanced4 min read
Rate Limits
Understanding and working with API rate limits
Rate Limit Tiers
| Tier | Requests/min | Requests/day |
|---|---|---|
| Free | 100 | 10,000 |
| Pro | 1,000 | 100,000 |
| Enterprise | Custom | Custom |
Rate Limit Headers
http
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1699999999Handling Rate Limits
typescript
try {
const result = await client.execute(tx);
} catch (error) {
if (error.code === 'RATE_LIMITED') {
const retryAfter = error.retryAfter; // seconds
await sleep(retryAfter * 1000);
// Retry request
}
}Best Practices
- •Implement exponential backoff for retries
- •Cache responses when possible
- •Use WebSocket for real-time data instead of polling
- •Batch requests where supported