REST API
Build models, simulations and analyses, run them at any inputs, and read every result from your own systems. Build, run, live, promote: the same four verbs on every surface, over plain REST.
Quick start
List your models
curl "https://api.ensemble.markets/v1/models?limit=20" \
-H "Authorization: Bearer $ENSEMBLE_API_KEY"
# {"data": [...], "total": 3}Create a model from a prompt
curl -X POST "https://api.ensemble.markets/v1/models" \
-H "Authorization: Bearer $ENSEMBLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "a trend-following strategy across all asset classes"}'
# 202 {"id": "m-...", "status": "building", ...}Poll the build, then read its holdings and metrics
curl "https://api.ensemble.markets/v1/models/$MODEL_ID" \ -H "Authorization: Bearer $ENSEMBLE_API_KEY" curl "https://api.ensemble.markets/v1/models/$MODEL_ID/history?include=latest&include=metrics" \ -H "Authorization: Bearer $ENSEMBLE_API_KEY"
Run a model at other inputs, then promote the run
curl -X POST "https://api.ensemble.markets/v1/models/$MODEL_ID/runs" \
-H "Authorization: Bearer $ENSEMBLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"inputs": {"lookback_months": 18}, "label": "Lookback 18", "wait": true}'
curl -X POST "https://api.ensemble.markets/v1/runs/$RUN_ID/promote" \
-H "Authorization: Bearer $ENSEMBLE_API_KEY"Rerun the defaults on new data
curl -X POST "https://api.ensemble.markets/v1/models/$MODEL_ID/runs" \
-H "Authorization: Bearer $ENSEMBLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Search assets
curl "https://api.ensemble.markets/v1/assets?q=semiconductor&type=etf&include=facets" \ -H "Authorization: Bearer $ENSEMBLE_API_KEY"
Specification
Base URL
https://api.ensemble.markets/v1
Authentication
Authorization: Bearer ensemble_… · API key or a signed-in session
Format
JSON in, JSON out · OpenAPI at /v1/openapi.json · reference at /docs
Conventions
Lists are {data, total} with limit and offset · variants of a read are include= · one error shape with X-Request-Id
Resources
models, simulations, analyses (same eight operations) · runs and builds by id · assets, backfills, optimizers, webhooks
Billing
Usage-based: builds and runs are metered (base plus compute); reads and deletes are free
Clients
The MCP server and the CLI are generated from this API; a typed TypeScript client and the OpenAPI document generate any other