Rate limits & timeouts
Throttles, the 29-second ceiling, and streaming long runs.
Two limits shape how you call this API: a request rate, and a hard 29-second ceiling on how long any single HTTP request can take. The second one matters more than the first, because index calculation is genuinely slow work and the ceiling is not negotiable.
Request rate
| Surface | Limit | Scope | Over limit |
|---|---|---|---|
| REST API | ~60 requests/min | Per API key (gateway usage plan) | Gateway throttle response |
| MCP server | 60 requests/min | Per team | 429 with Retry-After |
| MCP server, signed out | 30 requests/min | Per IP address | 429 with Retry-After |
The REST throttle is a usage plan attached to the API key, so it only applies to requests the gateway validated a key for. Because it is per key, one busy batch job can starve everything else sharing that key — issue separate keys for separate workloads.
The MCP server counts per team, not per key, and uses a fixed 60-second window rather than a rolling one. The window resets on a boundary, so a burst that exhausts the budget early leaves you blocked for the remainder of that minute and then fully replenished.
{"error": "Rate limit exceeded for this team. Retry shortly.","code": "rate_limited"}
Honour `Retry-After`
Retry-After header. Sleeping for that value is strictly better than a blind
exponential backoff, because the fixed window means the header tells you exactly when the budget resets rather than
approximately.The 29-second ceiling
API Gateway's integration timeout is 29 seconds. It is an AWS-side maximum, not a setting anyone can raise, and every route that does its work inline inherits it — /execute and /chat among them. The MCP server runs on its own gateway, where the same ceiling is 30 seconds.
If the work behind such a request has not finished by then, the connection is cut regardless of what the worker is doing. The worker usually carries on, which means a timed-out request is not proof the work failed.
A timeout is not a failure signal
This ceiling explains a design decision you will meet elsewhere and might otherwise find arbitrary: the long-running backtest and deploy paths never hold a response open on the run. They validate, launch the job, and return a bkt_... id immediately, so the call always answers cleanly instead of being severed mid-response. This is true on both surfaces — REST POST /simulate (poll GET /backtests/{backtest_id}) and POST /workflows, and the MCP run_backtest / deploy_index tools (poll get_backtest) — because they share one engine.
The polling pattern
- 1
Launch the run
REST
POST /simulate(or the MCPrun_backtesttool) validates, starts the work in the background and returns an id immediately — abkt_...for a backtest, plus anidx_...for a deploy viaPOST /workflows/deploy_index. The launch never holds the response open on the computation, so it cannot be severed mid-run. - 2
Poll the id
GET /backtests/{backtest_id}over REST — or the MCPget_backtesttool — reads the persisted result. It absorbs the in-flight window server-side, waiting a few seconds and re-checking rather than bouncing an instant "running" back, so a poll that arrives just before the result lands still resolves in that one call and back-to-back polling stays cheap. - 3
Read the outcome
Status settles on
completedorfailed; a completed deploy also surfaces itsdeployed_index_idhere. Keep the interval well clear of the 60/min throttle — a few seconds between polls is plenty for work measured in minutes.
Streaming over WebSocket
Polling tells you when something finished. For long runs where you also want progress as it happens, the worker streams alongside the poll.
Connect to wss://846dfj97pc.execute-api.eu-west-1.amazonaws.com/prod/, then pass your connection identifier into /execute or /simulate as websocket_id or connection_id. The HTTP request returns promptly with the backtest_id and the worker pushes frames down the socket as the run progresses.
| Frame | Meaning |
|---|---|
execution_start | The worker has picked up the run |
execution_complete | The run finished; results are attached |
execution_error | The run failed |
backtest_error | A backtest-specific failure |
Two ways past the ceiling, for two jobs
backtest_id and streaming a socket both escape the 29-second ceiling; they answer different
questions, and both are available over plain REST and MCP alike. The poll (GET /backtests/{backtest_id} /
get_backtest) tells you when a run finished and hands you the persisted result — durable and stateless, the
path to reach for by default. The socket shows progress as it happens, which a live UI wants; it is an addition
to the poll, not a replacement. Use the poll to retrieve, the socket to watch.Response size caps
Long histories are large. get_index_values on the MCP server caps a series at 5000 points and evenly downsamples anything longer, always keeping the latest point so the most recent value is never dropped.
The response reports what happened: {count, returned, downsampled}. count is the true number of points in the range, returned is how many you got, and downsampled tells you whether the series you are holding is a thinned view. Check that flag before computing anything path-dependent — drawdown and realised volatility both change meaningfully on a downsampled series.
For a complete series, narrow the date range and page through it, or read index-values-eod through GET /query with its cursor.
Pagination
Only GET /query paginates with a cursor. The cursor is an opaque base64 string; pass it back to get the next page, and treat cursor: null as the end of the data. Do not parse or construct one.
The list endpoints — GET /workflows and GET /deliveries/{id} — are unpaginated full scans. They return everything your team has. That is fine at current sizes and worth knowing about before you build a UI that calls one on every keystroke.
Retry guidance
- Retry
429and500. Do not retry400,401,403or404— nothing about the request will have changed. - On
429, sleep forRetry-Afterwhen it is present rather than guessing. - Otherwise use exponential backoff with jitter, starting around one second, and cap the total attempts. Synchronised retries from several workers turn one throttle into a sustained one.
- Never retry a timed-out long run without first checking whether it completed — use the returned id, not a fresh request.
- Keep polling intervals inside the 60/min budget; polls and real work share the same throttle.
- Cache the operation catalog from
GET /schema. It changes rarely and there is no reason to re-fetch it per request.