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

# Rate Limits & Concurrency

> Understanding rate limits, thread limits, and quotas.

## Concurrency Limits

Each user has a maximum number of concurrent tasks (threads) they can run simultaneously. The limit depends on your plan or package.

If you exceed your thread limit, the API returns `ERROR_THREAD_THRESHOLD_EXCEEDED`.

## Package Quotas

Package-based keys (`PKG-`) have quotas depending on the package type:

| Package Type | Quota                                        |
| ------------ | -------------------------------------------- |
| `unlimited`  | No limit during subscription                 |
| `daily`      | Fixed tasks per day (resets at midnight UTC) |
| `hourly`     | Fixed tasks per hour (resets each hour)      |

Exceeding your quota returns `ERROR_RATE_LIMIT_EXCEEDED`.

## Handling Rate Limit Errors

When you hit a rate limit, implement exponential backoff:

```python theme={null}
import time
import requests

def create_task_with_retry(client_key, task, max_retries=5):
    for attempt in range(max_retries):
        resp = requests.post("https://api.funbypass.com/createTask", json={
            "clientKey": client_key,
            "task": task
        })
        data = resp.json()

        if data.get("errorCode") == "ERROR_THREAD_THRESHOLD_EXCEEDED":
            wait = 2 ** attempt
            time.sleep(wait)
            continue

        return data

    raise Exception("Max retries exceeded")
```

## Service Availability

If the service is temporarily disabled, all task creation requests return `ERROR_SERVICE_UNAVALIABLE`. Monitor the [status page](https://app.funbypass.com/dashboard/status) for real-time availability.
