> Source: https://developers.terrawallet.us/docs/rate-limits . Terra Wallet developer docs (early access).

# Rate limits

The Terra API limits requests per key and per organization. Every response tells you where you stand, so you can
slow down before you hit the limit.

> **Preview.** The API is in early access. The limits themselves may change and are not part of the contract.

## Headers

| Header | Meaning |
|---|---|
| `RateLimit-Limit` | The number of requests allowed in the current window |
| `RateLimit-Remaining` | How many requests are left in the current window |
| `RateLimit-Reset` | Seconds until the current window ends |

Limits are counted per API key, per dashboard session, and per client IP on public routes, in fixed windows.
Sign-in routes add their own tighter limits.

## When you hit the limit

The API returns `429` with the code `RATE_LIMITED`, a `Retry-After` header and `retryAfter` in the body, both in
seconds:

```text
HTTP/1.1 429 Too Many Requests
Retry-After: <seconds>

{ "error": { "code": "RATE_LIMITED", "message": "...", "requestId": "req_...", "retryAfter": <seconds> } }
```

Wait that long, then retry with exponential backoff and jitter. Retried creates must reuse the same
`Idempotency-Key` (see [Idempotency](https://developers.terrawallet.us/docs/idempotency.md)).

## Public checkout routes

The public routes that hosted checkout uses (`/v1/checkout/...`) have strict per-IP limits and Turnstile
checks. Do not call them from your server: use the authenticated routes with your secret key.

## Edge protection

On top of the API's own limits, Cloudflare's edge applies WAF and rate-limit rules to `/api/v1`. A burst that
looks like abuse may be stopped at the edge before it reaches the API.

## Good habits

- Read `RateLimit-Remaining` and slow down as it approaches zero.
- Batch your own work: create payment intents when a customer checks out, not ahead of time.
- Use webhooks instead of polling for payment status.
- Give background jobs their own key with only the scopes they need, so you can watch and revoke them
  separately. Remember that the organization-wide limit still covers every key.
