---
title: "Rate limits"
description: "Understand organization request limits, read rate-limit headers, and recover from a 429."
url: "https://www.thecompany.company/docs/api/rate-limits"
---

# Rate limits

> Understand organization request limits, read rate-limit headers, and recover from a 429.

Rate limits apply by organization and operation bucket. Requests from different users, tokens, or workers share a limit when they hit the same bucket in the same organization.

## Request limits [#request-limits]

Both the one-minute and one-day windows must have room. Each is a fixed window that starts with the first counted request, not a calendar boundary. These are the baseline policies; your organization’s plan or overrides can change the effective values.

| Bucket | Examples | Per minute | Per day |
| --- | --- | --- | --- |
| `read` | [List sessions](/docs/api/sessions/list), [open an event stream](/docs/api/sessions/stream-events) | 600 | 50,000 |
| `write` | [Submit a prompt](/docs/api/sessions/push-events), [send a session message](/docs/api/sessions/send-message), [create a thread](/docs/api/sessions/create-thread) | 300 | 20,000 |
| `session` | [Create a session](/docs/api/sessions/create), [archive a thread](/docs/api/sessions/archive-thread) | 20 | 200 |

The `session` bucket has higher plan defaults. Organization overrides can replace either window’s limit.

| Plan | Per minute | Per day |
| --- | --- | --- |
| Pro or Max | 60 | 1,000 |
| Ultra | 120 | 5,000 |
| Team | 240 | 10,000 |
| Enterprise | 600 | 50,000 |

Buckets are assigned by operation, not HTTP method: creating a session and sending a session message are both `POST` requests, but they use different limits. These are request limits, not a cap on concurrent sessions or streams. Opening or reconnecting a stream uses the read budget; events arriving over an open stream do not each make another request.

## Response headers [#response-headers]

When the API has a rate-limit result to report, the `X-RateLimit-*` headers describe the applicable window with the fewest requests remaining. If windows tie, the headers report the one that resets later. One response does not report both windows.

| Header | Meaning |
| --- | --- |
| `X-RateLimit-Limit` | Maximum requests in the reported window. |
| `X-RateLimit-Remaining` | Requests left in that window as of this check. |
| `X-RateLimit-Reset` | When that window resets, as Unix epoch seconds. |
| `Retry-After` | On an App API rate-limit rejection, seconds to wait before retrying. |

Some responses do not include rate-limit headers. Missing headers do not mean the caller has unlimited capacity.

## Handle a 429 [#handle-a-429]

An App API rate-limit rejection returns `429 Too Many Requests`. Its JSON body names the bucket in `resource` and repeats the `Retry-After` delay in `retryAfter`. For example:

```json
{
  "_tag": "RateLimitExceededError",
  "resource": "session",
  "retryAfter": 12
}
```

1. Wait at least `Retry-After` seconds, or use `retryAfter` if your client cannot read the header. If neither is available, use bounded exponential backoff.
2. Spread retries with jitter and slow down workers sharing that bucket. Other callers may spend capacity while you wait, so a retry is not guaranteed to succeed.
3. Respect your retry limit or deadline. If the daily window runs out, defer work instead of repeatedly retrying.

If a connection drops or a write returns a `5xx` instead of a typed rate-limit rejection, [check the result before retrying](/docs/api/errors#retry-safely).
