> ## Documentation Index
> Fetch the complete documentation index at: https://tiktools.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Rate Limits

> API rate limits, WebSocket connection limits, and quotas by subscription tier.

## Tier Limits

| Feature                   | Sandbox (Free) | Basic (\$7/wk) | Pro (\$15/wk) | Ultra (\$45/wk) |
| ------------------------- | -------------- | -------------- | ------------- | --------------- |
| **API Requests**          | 50/day         | 10,000/day     | 75,000/day    | 300,000/day     |
| **WebSocket Connections** | 1              | 5              | 50            | 500             |
| **WebSocket Duration**    | 5 min          | 30 min         | Unlimited     | Unlimited       |
| **Bulk Check Users**      | 1              | 10             | 50            | 100             |
| **Rate (per minute)**     | 10 req/min     | 30 req/min     | 60 req/min    | 120 req/min     |

## Rate Limit Headers

Every API response includes rate limit information:

| Header                  | Description                                      |
| ----------------------- | ------------------------------------------------ |
| `X-RateLimit-Limit`     | Maximum requests allowed in the current window   |
| `X-RateLimit-Remaining` | Remaining requests before throttling             |
| `X-RateLimit-Reset`     | Unix timestamp when the rate limit window resets |

## Handling Rate Limits

When you exceed your rate limit, the API returns HTTP `429 Too Many Requests`:

```json theme={null}
{
  "status_code": 429,
  "message": "Rate limit exceeded. Please wait before making more requests."
}
```

### Best Practices

1. **Check headers** - Monitor `X-RateLimit-Remaining` to avoid hitting limits
2. **Implement backoff** - Use exponential backoff when receiving 429 responses
3. **Cache results** - Cache `check_alive` and `room_info` responses when polling
4. **Use WebSocket** - For real-time data, WebSocket is more efficient than polling REST

## Check Your Limits

Use the [`/webcast/rate_limits`](/rest-api/rate-limits) endpoint to see your current quota:

```bash theme={null}
curl "https://api.tik.tools/webcast/rate_limits?apiKey=YOUR_KEY"
```

```json theme={null}
{
  "status_code": 0,
  "data": {
    "tier": "basic",
    "api": { "limit": 30, "remaining": 28, "reset_at": 1234567890 },
    "websocket": { "limit": 10, "current": 2 }
  }
}
```
