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

# Rate limits

> Verified per-route throttles for the SimpleFunctions APIs, plus the 429 + retry contract.

Rate limits live at three layers — IP (anti-abuse), per-key (fair-use), per-route (cost protection). The numbers below are the **verified** limits checked into the codebase as of the current release. Routes not listed default to the platform's general fair-use ceiling; if a number matters for your integration, email **`patrick@simplefunctions.dev`** rather than reverse-engineer it.

## Verified per-route limits

These are read from `RATE_LIMIT` constants in code:

| Route                                    | Limit                                              | Notes                                                                                                                                                                                                                 |
| ---------------------------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET /api/public/query`                  | **10 / min** anonymous, **60 / min** authenticated | Authenticated callers get the 60/min tier and the `model` parameter unlock.                                                                                                                                           |
| `GET /api/public/query-econ`             | 30 / min                                           | LLM-backed search; cached identical queries don't count.                                                                                                                                                              |
| `GET /api/public/query-gov`              | 10 / min                                           | LLM-backed search.                                                                                                                                                                                                    |
| `GET /api/public/guide?q=`               | **10 / min** anonymous (free-text `?q=` path only) | Only the LLM intent-classification `?q=` path is capped; the deterministic `?intent=` path is unlimited. Authenticated (`Bearer`) callers bypass the anonymous cap. Over the limit returns `429` + `Retry-After: 60`. |
| `POST /api/public/discuss`               | 5 / min                                            | Discussion synthesis.                                                                                                                                                                                                 |
| `POST /api/monitor-the-situation/enrich` | 10 / min                                           | Web intelligence enrichment.                                                                                                                                                                                          |
| `POST /api/forum/messages`               | 10 / min                                           | Posting cap.                                                                                                                                                                                                          |

## Input cost guards

Some LLM-backed routes bound their input space instead of (or on top of) a rate limit, so an anonymous caller can't force unbounded fresh model calls by varying a parameter:

| Route                      | Guard                                                                                                                                                                                     |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET /api/public/briefing` | The `window` parameter accepts only `1h`, `6h`, `12h`, `24h`, `48h`, `72h`, `7d`, `30d`. Any other value falls back to `24h` (no error), keeping the `(topic, window)` LLM cache bounded. |

## Real-time data API (`data.simplefunctions.dev/v1`)

| Surface                                                         | Limit                                                |
| --------------------------------------------------------------- | ---------------------------------------------------- |
| `/v1/markets`, `/v1/candles/{ticker}`, `/v1/orderbook/{ticker}` | 240 req / min                                        |
| `/v1/snapshot`, `/v1/movers`, `/v1/search`                      | 120 req / min                                        |
| `wss://app.simplefunctions.dev/ws`                              | 5 concurrent connections, 200 subscribed topics each |

## Headers and 429 contract

Platform-enforced rate limits may include these headers:

```http theme={null}
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 42
X-RateLimit-Reset: 1714572345
```

When limited:

```http theme={null}
HTTP/1.1 429 Too Many Requests
Retry-After: 12
```

with body:

```json theme={null}
{ "ok": false, "error": { "code": "RATE_LIMITED", "status": 429, "message": "..." } }
```

Honor `Retry-After` (seconds) before the next request whenever it is present.

## Routes without an explicit constant

Most authenticated and read-only routes (`/api/agent/*`, `/api/portfolio/*`, `/api/thesis/*`, `/api/intents/*`, `/api/watch/*`, `/api/alert-rules/*`, `/api/webhook-endpoints/*`, `/api/mcp/*`, ...) are governed by the platform's fair-use ceiling rather than a per-route constant in code. Hitting the ceiling returns the same `429 RATE_LIMITED` shape.

For a guaranteed sustained rate beyond the platform default — for a production agent loop, dashboard, or analytics pipeline — email **`patrick@simplefunctions.dev`** with the use case so we can size capacity to actual traffic.

## See also

<CardGroup cols={2}>
  <Card title="API keys" href="/enterprise/api-keys">
    Key creation and rotation.
  </Card>

  <Card title="Errors" href="/reference/errors">
    `RATE_LIMITED` envelope and handling.
  </Card>
</CardGroup>
