# Limits and credits

> How many requests you can make, and which calls use AI credits.

## Rate limits

| Limit | Applies to |
| --- | --- |
| 120 requests a minute | Each key |
| 50,000 requests a day | Each organization, across all its keys. Resets at midnight UTC. |

MCP tool calls count the same as REST requests.

Every response has `X-RateLimit-Limit` and `X-RateLimit-Remaining` headers for the per-minute limit. Going over returns `429` with a `Retry-After` header saying how many seconds to wait:

**Python**

```python
import time

def call(api, method, path, **kwargs):
    while True:
        res = api.request(method, path, **kwargs)
        if res.status_code != 429:
            return res
        time.sleep(int(res.headers.get("Retry-After", "5")))
```

**JavaScript**

```javascript
async function call(url, init) {
  for (;;) {
    const res = await fetch(url, init);
    if (res.status !== 429) return res;
    const wait = Number(res.headers.get("Retry-After") ?? 5);
    await new Promise((r) => setTimeout(r, wait * 1000));
  }
}
```

> **Syncing a lot of data?**
> Page with `limit=100` (the largest page) and keep an eye on `X-RateLimit-Remaining`. A full board of a few thousand items takes well under a minute.

## AI credits

Most calls are free. Calls that run AI use your organization's AI credits, the same credits the app uses:

| Call | MCP tool | Credits |
| --- | --- | --- |
| `POST /v1/knowledge/search` | `search_knowledge` | 1 |
| `POST /v1/knowledge/who-knows` | `who_knows` | 1 |

Each of these responses says how many credits it used in `credits_used`. Usage shows under **Billing** in PlaybookOps as "API and MCP", and admins can see it per key under **Admin → API**.

When the organization is out of credits, has reached its monthly budget, or the key's owner has reached their personal limit, these calls return `402` and nothing is charged. See [errors](https://developers.playbookops.ai/errors) for the codes.
