---
title: Rate limits
description: How many requests a key and an application may send, and what the API answers past that.
sidebar:
  icon: gauge
---

## Rate limits [#rate-limits]

Each credential may send a set number of requests a minute. How they're counted depends on the credential:

| Credential                             | Counted                                                              |
| -------------------------------------- | -------------------------------------------------------------------- |
| An API key                             | On its own                                                           |
| A [partner key](/developers/embedding) | Across every workspace it acts in                                    |
| An application                         | For each member it acts for, whichever of its access tokens it sends |
| A session of the web app               | Not counted                                                          |

On a server that bills, a billing account without a payment method counts all its credentials together ([By billing account](#standing)).

The API and the [MCP endpoint](/developers/mcp) share one count. It's kept in fixed windows of one minute that start on the minute. On your own server, `PEAL_API_REQUESTS_PER_MINUTE` sets the number, 600 unless set ([Environment variables](/self-hosting/environment-variables#core)).

### By billing account [#standing]

On a server that bills, as Peal Cloud does, the number depends on the [billing account](/guides/workspace/billing#accounts) that pays for the workspace the credential acts in. Three policies apply:

| Policy     | Requests a minute                     | When                                                                                                    |
| ---------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `free`     | 60                    | The billing account has no payment method                                                               |
| `default`  | 600, the server's setting | It has one ([A payment method](/guides/workspace/billing#payment-method)), or a plan priced by channels |
| `override` | What Peal set for the workspace       | On request, 1,200 usually: write to us                                                  |

Which billing account counts depends on the credential. An API key takes its workspace's account, a partner key its partner's home workspace's, and an application the workspace its token is bound to. A token bound to no workspace, such as the command line's, takes the account its member pays for (the free tier when they pay for none), and the limit Peal set for the workspace a request names, if any.

On the `free` policy, every key, partner key and application of a billing account shares one count, and a member who pays for no account has one of their own. More credentials don't send more. With a payment method, each credential counts on its own.

When you add a payment method, the limit goes up within a minute. A server that doesn't bill applies its one setting to every credential.

Every answer to a counted credential says where it stands, in the headers of the IETF draft "RateLimit header fields for HTTP":

| Header             | Example                | What it says                                                                          |
| ------------------ | ---------------------- | ------------------------------------------------------------------------------------- |
| `RateLimit-Policy` | `"default";q=600;w=60` | The policy: `q` requests every `w` seconds.                                           |
| `RateLimit`        | `"default";r=412;t=23` | What is left: `r` requests, for `t` more seconds, after which the count starts again. |
| `Retry-After`      | `23`                   | On a 429 only: how many seconds to wait.                                              |

> **A platform's 429 isn't this limit**
>
> A 429 `platform_rate_limited` means a platform asked Peal to slow down, as a
> [lookup](/developers) can find, and this count is untouched. The hosted pages
> of connect links and review links, which take no key, have limits of their own
> by address.

### Past the limit [#too-many-requests]

Past the limit, the request answers 429 `too_many_requests`, and nothing was done:

```http
HTTP/1.1 429 Too Many Requests
Content-Type: application/json
RateLimit-Policy: "default";q=600;w=60
RateLimit: "default";r=0;t=17
Retry-After: 17
X-Request-Id: 019a7b33-41c7-7d50-a2e9-6b8c0d1e2f3a
```

```json
{
  "_tag": "TooManyRequests",
  "code": "too_many_requests",
  "message": "This credential sent more than `limit` requests in `windowSeconds` seconds: nothing was done. Wait `retryAfterSeconds` seconds, as the `Retry-After` header says, then send the request again. Every answer to a key or a token carries the `RateLimit-Policy` and `RateLimit` headers, which say how many requests are left. `policy` says which limit applied: on a server that bills, a billing account without a payment method sends fewer (`free`), and `withPaymentMethod` is what a payment method gives.",
  "requestId": "019a7b33-41c7-7d50-a2e9-6b8c0d1e2f3a",
  "limit": 600,
  "policy": "default",
  "windowSeconds": 60,
  "retryAfterSeconds": 17
}
```

Wait `retryAfterSeconds`, then send the request again. A client that reads `RateLimit` slows down before it's refused.

On the `free` policy, the error also carries `withPaymentMethod`, the limit a payment method gives, and its `message` says so. Servers older than these two fields don't send `policy` or `withPaymentMethod`.

The MCP endpoint answers the same status and headers, with a JSON-RPC error. When the server can't keep the count, it lets the request through.

### Limits of one feature [#feature-limits]

Some features have a limit of their own, on top of this one:

| Limit                                                  | Error                      | See                                                            |
| ------------------------------------------------------ | -------------------------- | -------------------------------------------------------------- |
| The writing assistant's requests per workspace and day | `assistant_quota_exceeded` | [Ask the writing assistant](/guides/posts/assistant#assistant) |
| Imports, and reads of uploaded files, running at once  | `media_import_busy`        | [Media](/guides/media)                                         |
| Test events and resends of webhooks per hour           | `too_many_webhook_sends`   | [The delivery log](/developers/webhooks/delivery#log)          |
| Pending invitations, and invitation emails a day       | `too_many_invitations`     | [Invitations](/guides/workspace#invitations)                   |
| What a plan allows, on a server that bills             | `plan_limit_reached`       | [Plans and billing](/guides/workspace/billing#limits)          |
