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

# API rate limiting for Laravel Cloud

> Learn how Laravel Cloud rate limits API requests and how to handle rate limit responses.

The Laravel Cloud API limits how many requests you can make in a given period of time. Rate limits keep the API fast and reliable for everyone, and they protect your organization from runaway scripts and integrations.

Cloud tracks rate limits per organization. Every API token in your organization, including tokens used by the [Laravel Cloud CLI](https://cloud.laravel.com/docs/api/cli.md), shares the same limits. Cloud tracks requests that use an invalid API token by IP address instead.

## Limits

Every API request counts toward the general limit. Some endpoints also have a stricter limit of their own, and requests to those endpoints count toward both limits.

| Limit | Applies to | Requests |
| - | - | - |
| General | All API endpoints | 120 per minute |
| Resource creation | Endpoints that create or change infrastructure | 30 per minute |
| Commands | Running commands on an environment | 20 per minute |

## Rate limit headers

Cloud includes the following headers in API responses so you can track your usage:

| Header | Description |
| - | - |
| `X-RateLimit-Limit` | The maximum number of requests you can make in the current window. |
| `X-RateLimit-Remaining` | The number of requests you have left in the current window. |
| `Retry-After` | The number of seconds to wait before you retry. Cloud sends this header only when you exceed a limit. |
| `X-RateLimit-Reset` | The Unix timestamp when you can retry. Cloud sends this header only when you exceed a limit. |

## Exceeding a limit

When you exceed a rate limit, Cloud rejects the request with a `429 Too Many Requests` status code:

```http theme={null}
HTTP/1.1 429 Too Many Requests
Retry-After: 42
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1764000000

{
  "message": "Too Many Attempts."
}
```

Wait for the number of seconds in the `Retry-After` header before you send another request. Cloud rejects any request to the same limit that you send before then.

> [!TIP]
>
> Cache responses you read often, such as application and environment details, so your integrations stay well within the general limit.
