Rate Limits
To ensure fair usage and system stability, the Tokencraft API implements rate limiting on all endpoints.Current Limits
100 requests per minute per API token This limit applies to all endpoints collectively. Whether you’re calling one endpoint 100 times or spreading requests across multiple endpoints, the total cannot exceed 100 requests per minute.How It Works
Rate limits are calculated using a sliding window:- Window: 60 seconds (1 minute)
- Limit: 100 requests
- Reset: Rolling/sliding window
Rate Limit Headers
Every API response includes rate limit information in the headers:| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed per window |
X-RateLimit-Remaining | Requests remaining in current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
When Limit Is Exceeded
When you exceed the rate limit, you’ll receive a429 Too Many Requests response:
- Wait until the reset time
- Implement exponential backoff
- Reduce request frequency
Checking Rate Limits
JavaScript Example
Python Example
Handling Rate Limits
1. Exponential Backoff
Retry with increasing delays:2. Request Queuing
Queue requests to respect rate limits:3. Request Batching
Combine multiple operations into single requests:4. Caching
Cache responses to reduce API calls:Best Practices
1. Monitor Your Usage
Track rate limit headers in your application:2. Use Multiple Tokens
For high-volume applications, use separate tokens:3. Optimize Request Patterns
4. Handle Gracefully
Always handle rate limit errors:Rate Limit Increases
Need higher limits? Contact us at [email protected] with:- Your use case
- Expected request volume
- API token ID