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

# Plans and limits

> Backtest lookback by plan, rate limit and run time.

Backtesting is an add-on with its own API key. How far back a backtest can start depends on how the add-on is
billed:

| Add-on billing | Earliest `start` |
| - | - |
| Monthly | 1 year ago |
| Quarterly | 3 years ago |
| Annual | Full history, from 1 September 2021 |

The lookback rolls forward every day. It applies to `start` only: once a backtest starts inside your lookback
it can run up to today.

A `start` earlier than your lookback is refused before the backtest runs:

```json theme={null}
{ "statusCode": 403, "message": "start is before your backtest lookback, which begins 2025-11-07" }
```

Every response carries your earliest allowed `start` in a header, so code can set it rather than hard-code
it:

```http theme={null}
Sandmark-Backtest-Window-Start: 2025-11-07
```

## Rate limit

Each backtest key may start **10 backtests per minute**. Past that you get `429` with a `Retry-After` header.
The limit is separate from your volatility data key.

## Run time

A strategy that looks once a day typically returns in a few seconds, even over the full five years of
history. Each run has a hard limit of 120 seconds inside the engine. The settings that cost the most time are:

* `clock.decision_hour_utc: null`, which looks every hour instead of once a day and loads about 24 times as
  much data. Keep hourly runs to a few months.
* `structure.expiry.by: "listed"` with a high `clock.max_dte`, which brings far-dated contracts into every
  decision. Lower `max_dte` to what the strategy actually trades.

Set your HTTP client's timeout to at least 180 seconds.

## Errors

| Code | Meaning |
| - | - |
| `400` | The body isn't JSON, or `start` isn't a `YYYY-MM-DD` date. |
| `401` | Missing or invalid backtest key. |
| `403` | `start` is before your lookback. |
| `422` | The strategy spec failed validation. `detail[].loc` names each field, such as `["body", "structure", "legs", 0, "strike"]`. |
| `429` | More than 10 backtests in a minute. |
| `5xx` | The run failed or exceeded the time limit. Shorten the window or simplify the strategy, then retry. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.