> For the complete documentation index, see [llms.txt](https://developers.gallantreecapital.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.gallantreecapital.com/guides/rate-limits.md).

# Rate limits

Every developer app is rate-limited by tier. The limits below apply per app, per environment, measured against a rolling 60-second window.

## Tiers

| Tier           | Requests per minute |
| -------------- | ------------------- |
| **Sandbox**    | 60                  |
| **Starter**    | 300                 |
| **Growth**     | 1,000               |
| **Enterprise** | 5,000               |

* **Sandbox apps** are always on the sandbox tier — the 60/min limit is a nudge to keep integration tests polite, not a commercial ceiling. Move to a production tier when you go live.
* **Starter / Growth / Enterprise** are production tiers, assigned when the app is provisioned. Upgrading tiers is a portal action; contact your Gallantree account manager for the current tier availability.

## Response headers

Every response carries three headers so you can throttle client-side:

| Header                  | Meaning                                                          |
| ----------------------- | ---------------------------------------------------------------- |
| `x-ratelimit-limit`     | The tier limit (constant per app)                                |
| `x-ratelimit-remaining` | Requests you can still make in the current window                |
| `x-ratelimit-reset`     | Unix timestamp (seconds since epoch, UTC) when the window resets |

Watch `x-ratelimit-remaining` in your client — if it hits `0`, the next request will return `429` regardless of urgency.

## When you're throttled

```http
HTTP/1.1 429 Too Many Requests
Retry-After: 27
x-ratelimit-limit: 300
x-ratelimit-remaining: 0
x-ratelimit-reset: 1755267600

{ "message": "Too many requests. Please try again later." }
```

* **`Retry-After`** is seconds until the next request will succeed. Respect it — retrying earlier just wastes cycles and does not reset the window.
* **Exponential back-off** on top of `Retry-After` is polite behaviour when the server is under load; consider a jittered `Retry-After × 1.5` on the first retry.

## Sizing your integration

If you're pulling data on a schedule, plan the polling cadence against your tier — a sync that lists every loan every minute at page-size 25 uses **N/25 requests per run**, so a 1,000-loan lender fits comfortably on Starter (40 requests, well under 300/min) but a 30,000-loan lender needs Growth or webhooks (see [Subscribe to events](/webhooks/subscribe.md)).

Webhooks are almost always a better answer than polling — they don't count against your API rate limit, and they arrive within seconds of the underlying change.

## Runnable example — client-side back-off

```bash
call() {
  response=$(curl -sS -w "\n%{http_code}" -D headers.tmp \
    "https://developers.gallantreecapital.com/api/v1/loans" \
    -H "x-api-key: $GALLANTREE_API_KEY")
  status=$(echo "$response" | tail -n1)
  body=$(echo "$response" | head -n -1)
  if [ "$status" = "429" ]; then
    wait=$(grep -i "^retry-after:" headers.tmp | awk '{print $2}' | tr -d '\r')
    echo "429 — sleeping ${wait}s"
    sleep "$wait"
    call
  else
    echo "$body"
  fi
}
call
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.gallantreecapital.com/guides/rate-limits.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
