{"openapi":"3.1.0","info":{"title":"ENSEMBLE API","description":"The asset allocation platform for the agentic era. Build any strategy, test it, and read exactly how it was built.","version":"1.0.0"},"paths":{"/v1/account/profile":{"get":{"tags":["Account"],"summary":"Get Connected Profile","description":"Return the profile represented by this request's authenticated credentials.\n\nThe opaque ID is stable across token refresh, reconnect, and display-name\nchanges. Unavailable optional display fields are omitted. This read does\nnot initialize an account or billing record and accepts no account selector.","operationId":"getProfile","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/account":{"get":{"tags":["Account"],"summary":"Get Account","description":"Identity, plan and collection sizes for the authenticated account.","operationId":"getAccount","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/account/billing":{"get":{"tags":["Account"],"summary":"Get Billing","description":"Headroom for metered work: what the account can still spend, what is\nheld by builds and runs in flight, and what one run or build holds.\n\nEvery build and run is metered in cents. The figures here are the ones\nadmission uses, so `remaining_cents` below `projected_run_cents` means\nthe next run is refused with 402. A 402 is final for this request; no work\nstarts. `usage_help_url` explains the\naccount limitation. Projected holds are estimates, not final charges.\nThis read may initialize the account's billing record and signup grant.","operationId":"getBilling","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountBilling"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/account/billing/charges":{"get":{"tags":["Account"],"summary":"List Billing Charges","description":"Your itemized usage, newest first, including credits and amounts not billed.\n\nActivity descriptions survive deletion or renaming of a model. Older charges\nwithout captured context are explicitly unidentified. The applied cap is a\nhistorical snapshot, not today's setting. Excludes temporary admission holds\nand the flat subscription fee. Filters span all pages and use usage timestamps,\nthe same timestamps sent to Stripe. Only the authenticated owner's charges\nare visible; admin privileges never widen this billing-history read.","operationId":"listBillingCharges","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Usage timestamp, inclusive (ISO 8601)","title":"Start Date"},"description":"Usage timestamp, inclusive (ISO 8601)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Usage timestamp, exclusive (ISO 8601)","title":"End Date"},"description":"Usage timestamp, exclusive (ISO 8601)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Rows per page","default":50,"title":"Limit"},"description":"Rows per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Rows to skip","default":0,"title":"Offset"},"description":"Rows to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingChargePage"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/assets":{"get":{"tags":["Assets"],"summary":"List Assets","description":"Screen the catalog. Structured filters AND together with `q` (ticker or\nfull text). `tags` matches any of its values, `tags_all` requires every\none, `tags_none` excludes any of them; all accept only the closed\nvocabulary, which `include=facets` returns by dimension.\n`country` is the single country named by the fund (germany, japan, …);\na broader region does not match. `price_coverage` separates a catalog\nseed from stored bars, and `tax_evidence` is unclassified when tax form\nand legal structure are null. `min_market_cap` is a size floor on market\ncap or fund AUM. Sort by `symbol`, `name`, `aum`, `expense_ratio`,\n`leverage` or `first_price_date`.","operationId":"listAssets","parameters":[{"name":"include","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"const":"facets","type":"string"}},{"type":"null"}],"description":"facets: counts for the current filter set and the closed tag vocabulary","title":"Include"},"description":"facets: counts for the current filter set and the closed tag vocabulary"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Rows per page","default":50,"title":"Limit"},"description":"Rows per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Rows to skip","default":0,"title":"Offset"},"description":"Rows to skip"},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Ticker or full-text search, composed with structured filters","title":"Q"},"description":"Ticker or full-text search, composed with structured filters"},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Asset type: etf | fund | stock | crypto","title":"Type"},"description":"Asset type: etf | fund | stock | crypto"},{"name":"exchange","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Listing exchange code, e.g. US","title":"Exchange"},"description":"Listing exchange code, e.g. US"},{"name":"sector","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Stock sector (legacy data blob)","title":"Sector"},"description":"Stock sector (legacy data blob)"},{"name":"min_market_cap","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Minimum market cap or fund AUM, in USD","title":"Min Market Cap"},"description":"Minimum market cap or fund AUM, in USD"},{"name":"delisted","in":"query","required":false,"schema":{"type":"boolean","description":"Include delisted assets","default":false,"title":"Delisted"},"description":"Include delisted assets"},{"name":"tax_form","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"1099 | k1 | pfic (NULL excluded)","title":"Tax Form"},"description":"1099 | k1 | pfic (NULL excluded)"},{"name":"legal_structure","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ric | uit | grantor_trust | commodity_pool | etn | closed_end_trust","title":"Legal Structure"},"description":"ric | uit | grantor_trust | commodity_pool | etn | closed_end_trust"},{"name":"asset_class","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"equity | fixed_income | commodity | currency | alternatives | asset_allocation","title":"Asset Class"},"description":"equity | fixed_income | commodity | currency | alternatives | asset_allocation"},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Match ANY of these tags. Descriptive `dimension:value` tags, repeatable or comma-separated (sector:energy, commodity:precious_metals, theme:gold_miners, region:us, size:large, bond:high_yield). An unrecognized tag is a 422.","title":"Tags"},"description":"Match ANY of these tags. Descriptive `dimension:value` tags, repeatable or comma-separated (sector:energy, commodity:precious_metals, theme:gold_miners, region:us, size:large, bond:high_yield). An unrecognized tag is a 422."},{"name":"tags_all","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Require ALL of these tags. Descriptive `dimension:value` tags, repeatable or comma-separated (sector:energy, commodity:precious_metals, theme:gold_miners, region:us, size:large, bond:high_yield). An unrecognized tag is a 422.","title":"Tags All"},"description":"Require ALL of these tags. Descriptive `dimension:value` tags, repeatable or comma-separated (sector:energy, commodity:precious_metals, theme:gold_miners, region:us, size:large, bond:high_yield). An unrecognized tag is a 422."},{"name":"tags_none","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Exclude assets carrying ANY of these tags; untagged assets pass. Descriptive `dimension:value` tags, repeatable or comma-separated (sector:energy, commodity:precious_metals, theme:gold_miners, region:us, size:large, bond:high_yield). An unrecognized tag is a 422.","title":"Tags None"},"description":"Exclude assets carrying ANY of these tags; untagged assets pass. Descriptive `dimension:value` tags, repeatable or comma-separated (sector:energy, commodity:precious_metals, theme:gold_miners, region:us, size:large, bond:high_yield). An unrecognized tag is a 422."},{"name":"leverage_min","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Signed leverage lower bound (inclusive)","title":"Leverage Min"},"description":"Signed leverage lower bound (inclusive)"},{"name":"leverage_max","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Signed leverage upper bound (inclusive)","title":"Leverage Max"},"description":"Signed leverage upper bound (inclusive)"},{"name":"issuer","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Issuer / fund family prefix (case-insensitive)","title":"Issuer"},"description":"Issuer / fund family prefix (case-insensitive)"},{"name":"max_first_price_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Require first_price_date on or before this day (history depth)","title":"Max First Price Date"},"description":"Require first_price_date on or before this day (history depth)"},{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Single-country mandate read from the fund name. argentina, australia, austria, belgium, brazil, canada, chile, china, colombia, denmark, finland, france, germany, greece, hong_kong, iceland, india, indonesia, ireland, israel, italy, japan, kuwait, malaysia, mexico, netherlands, new_zealand, norway, philippines, poland, qatar, saudi_arabia, singapore, south_africa, south_korea, spain, sweden, switzerland, taiwan, thailand, turkey, united_arab_emirates, united_kingdom, vietnam. A broader region, a second country, or an unrecognized value does not match. Holdings are not consulted.","title":"Country"},"description":"Single-country mandate read from the fund name. argentina, australia, austria, belgium, brazil, canada, chile, china, colombia, denmark, finland, france, germany, greece, hong_kong, iceland, india, indonesia, ireland, israel, italy, japan, kuwait, malaysia, mexico, netherlands, new_zealand, norway, philippines, poland, qatar, saudi_arabia, singapore, south_africa, south_korea, spain, sweden, switzerland, taiwan, thailand, turkey, united_arab_emirates, united_kingdom, vietnam. A broader region, a second country, or an unrecognized value does not match. Holdings are not consulted."},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"symbol | name | aum | expense_ratio | leverage | first_price_date","default":"symbol","title":"Sort"},"description":"symbol | name | aum | expense_ratio | leverage | first_price_date"},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"asc | desc","default":"asc","title":"Order"},"description":"asc | desc"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetPage"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/assets/{asset}":{"get":{"tags":["Assets"],"summary":"Get Asset","description":"The catalog record: wrapper, tax form, leverage, issuer, tags, country\nand the date range of its bars. `price_coverage` separates the catalog\nseed from stored bars. `tax_evidence` is unclassified when tax form and\nlegal structure are null, which is not a 1099. `country` is set when\nthe name states one country. `backfill` names your rule for the symbol,\nwhen you have one, so a history that predates the listing is explained.\nWhether a particular broker will accept a symbol is not tracked here.","operationId":"getAsset","parameters":[{"name":"asset","in":"path","required":true,"schema":{"type":"string","description":"Symbol (`AAPL`) or asset ID (`asset_...` or legacy `a-...`)","title":"Asset"},"description":"Symbol (`AAPL`) or asset ID (`asset_...` or legacy `a-...`)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/assets/{asset}/history":{"get":{"tags":["Assets"],"summary":"Get Asset History","description":"Daily total returns, spliced with your backfill rule when one exists,\nthen cut to `start_date`/`end_date` so a dated read matches what a\nbacktest sees. A read past the stored edge refreshes the bars first and\nwaits a few seconds for them. Answers 202 with `status: fetching` while\na load is still in flight and the window has nothing to show.\n`data_edge` is the last bar stored whatever the window, so an\nempty window is legible: past the edge, or before the listing.","operationId":"getAssetHistory","parameters":[{"name":"asset","in":"path","required":true,"schema":{"type":"string","description":"Symbol (`AAPL`) or asset ID (`asset_...` or legacy `a-...`)","title":"Asset"},"description":"Symbol (`AAPL`) or asset ID (`asset_...` or legacy `a-...`)"},{"name":"include","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"const":"metrics","type":"string"}},{"type":"null"}],"description":"metrics: return, risk and drawdown statistics over the returned slice","title":"Include"},"description":"metrics: return, risk and drawdown statistics over the returned slice"},{"name":"backfill","in":"query","required":false,"schema":{"type":"boolean","description":"Splice your backfill rule in before the asset's first bar. False returns its own bars only.","default":true,"title":"Backfill"},"description":"Splice your backfill rule in before the asset's first bar. False returns its own bars only."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Earliest bar to return (YYYY-MM-DD, inclusive). Omit for the beginning of the series (for a model, its default view start).","title":"Start Date"},"description":"Earliest bar to return (YYYY-MM-DD, inclusive). Omit for the beginning of the series (for a model, its default view start)."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Latest bar to return (YYYY-MM-DD, inclusive). Omit for the end of the series.","title":"End Date"},"description":"Latest bar to return (YYYY-MM-DD, inclusive). Omit for the end of the series."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetHistory"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/models/trash":{"get":{"tags":["Models"],"summary":"List Trashed Models","description":"Your recoverable models, newest deletion first. No code or results are exposed in Trash. Expired models cannot be restored and are omitted even if cleanup is delayed.","operationId":"listTrashedModels","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Rows per page","default":50,"title":"Limit"},"description":"Rows per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Rows to skip","default":0,"title":"Offset"},"description":"Rows to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrashedModelPage"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/models/trash/{model}/restore":{"post":{"tags":["Models"],"summary":"Restore Model","description":"Restore before the 30-day deadline, with code and retained history intact. Sharing and automatic updates stay off; no build or run is started. Trashed member models block restoration (409 trash_dependencies).","operationId":"restoreModel","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Exact model ID returned by listTrashedModels","title":"Model"},"description":"Exact model ID returned by listTrashedModels"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/models/trash/{model}":{"delete":{"tags":["Models"],"summary":"Permanently Delete Model","description":"Permanently delete a model already in Trash, including its code, drafts, builds and runs. Cannot be undone. Billing history remains separate; minimal deletion receipts expire after 30 days.","operationId":"deleteTrashedModel","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Exact model ID returned by listTrashedModels","title":"Model"},"description":"Exact model ID returned by listTrashedModels"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/models":{"post":{"tags":["Models"],"summary":"Create Model","description":"Create an investment model from a prompt or from your own script.\n\nA model backtests allocations to assets, other models, or both. Existing models referenced by ID, name, or symbol become members. The build (script generation plus a sandboxed backtest at the declared defaults) runs in the background and typically takes 10-60 seconds; this answers at once with the model ID and `status` building. The model's `run` becomes null when work ends; `status` and `error` describe its outcome. With `script`, generation is skipped: the script is validated against the contract and smoke-run. Metered per build (base plus compute; tokens only when generating). `auto_update=false` and `notify_email=false` disable recurring work and allocation emails. Omitting these preserves the existing enabled defaults.","operationId":"createModel","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelCreateRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["Models"],"summary":"List Models","description":"The caller's models, newest first. Favorites, labels and status filter the complete library before pagination.","operationId":"listModels","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Only programs in this status: building, active, updating, paused or failed","title":"Status"},"description":"Only programs in this status: building, active, updating, paused or failed"},{"name":"is_favorite","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Only favorited (true) or unfavorited (false) models; omit for all","title":"Is Favorite"},"description":"Only favorited (true) or unfavorited (false) models; omit for all"},{"name":"labels","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","minLength":1,"maxLength":50},"description":"Match any of these private labels, case-insensitively; combines with status and is_favorite","default":[],"title":"Labels"},"description":"Match any of these private labels, case-insensitively; combines with status and is_favorite"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Rows per page","default":50,"title":"Limit"},"description":"Rows per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Rows to skip","default":0,"title":"Offset"},"description":"Rows to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelSummaryPage"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/models/validate":{"post":{"tags":["Models"],"summary":"Validate Model Script","description":"Check a model script against the contract without building it.\n\nThe same static checks a build with `script` runs first: the declared constants, the entry point, the harness imports, determinism, INPUTS, and that every entry in INPUTS.universe.default (or legacy UNIVERSE) resolves to the catalog or to one of your models. Answers 200 either way: `valid` with the derived `inputs_schema`, or `errors` naming the rule and the line. Nothing runs, nothing is stored, nothing is metered. Validation uses the versioned ENSEMBLE runtime contract.","operationId":"validateModel","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Validation"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/models/{model}":{"get":{"tags":["Models"],"summary":"Get Model","description":"The model's fact sheet: status, the run in progress, what it holds, what holds it, its `inputs_schema`, and `build_id` for the script it serves.\n\nOwners may use the ID, slug, symbol, or exact name; anyone may read a public model by its slug.","operationId":"getModel","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Model ID (model_... or legacy m-...), slug, symbol or exact name","title":"Model"},"description":"Model ID (model_... or legacy m-...), slug, symbol or exact name"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Models"],"summary":"Update Model","description":"Rename, change the symbol, favorite, organize with private labels, toggle sharing, set the nightly refresh, or move the default view.\n\n`auto_update` and `notify_email` need a built model (409 `not_ready`). `start_date` and `start_rule` only move where the default view begins; nothing is recomputed. The backtest's start date is an execution input, separate from this view window.","operationId":"updateModel","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Model ID (model_... or legacy m-...), slug, symbol or exact name","title":"Model"},"description":"Model ID (model_... or legacy m-...), slug, symbol or exact name"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Models"],"summary":"Delete Model","description":"Move a model and its history to private Trash for 30 days, then permanently purge them. Sharing and automatic updates stop immediately and stay off after restore. Billing history is retained separately. 409 while work is in progress (`model_busy`), an active model holds it (`model_held`), or a backfill reads it (`model_backfills_symbol`).","operationId":"deleteModel","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Model ID (model_... or legacy m-...), slug, symbol or exact name","title":"Model"},"description":"Model ID (model_... or legacy m-...), slug, symbol or exact name"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/models/{model}/rebuild":{"post":{"tags":["Models"],"summary":"Rebuild Model","description":"Regenerate the model's implementation.\n\nWith `prompt`, the model is rewritten to the new description. With `script`, your implementation replaces the stored one (validated and smoke-run, no generation). With neither, the stored prompt is used again: a failed model is rebuilt from its own failure (the generator sees the script that broke and the error), a built model is simply regenerated. A built model keeps serving its current implementation until the new one succeeds; existing runs keep the `script_hash` they ran under. Answers 202 with `run.kind` rebuild; the model's `run` becomes null when work ends. Metered like a create. 409 `rebuild_conflict` while a build owns the model.","operationId":"rebuildModel","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Model ID (model_... or legacy m-...), slug, symbol or exact name","title":"Model"},"description":"Model ID (model_... or legacy m-...), slug, symbol or exact name"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelRebuildRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/models/{model}/runs":{"post":{"tags":["Models"],"summary":"Run Model","description":"Run the model's stored script (no generation).\n\nPass intent=test for an isolated result, even with default inputs; intent=refresh publishes approved defaults on success. Omission keeps the following legacy behavior for existing integrations. An empty body runs the declared defaults: that run is the live path, its result becomes what the model serves and cascades to the models that hold it. With `inputs`, unset keys take their defaults (see `inputs_schema`) and `from_run_id` starts from another run's inputs with `inputs` overlaid; unknown keys are rejected with the accepted keys named. Any run away from the defaults is a snapshot to compare, share or promote. `inputs.start_date` (YYYY-MM-DD) starts the backtest later than the data allows; earlier prices still feed lookbacks. Metered: one base unit plus one unit per second of sandbox time, charged once per run. 500 manual runs per account per day (429). Answers 202 with the queued run, or 200 with the finished run when `wait=true`. 409 `run_conflict` while a default run or a rebuild owns the model.","operationId":"runModel","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Model ID (model_... or legacy m-...), slug, symbol or exact name","title":"Model"},"description":"Model ID (model_... or legacy m-...), slug, symbol or exact name"},{"name":"wait","in":"query","required":false,"schema":{"type":"boolean","description":"Block until the run finishes","default":false,"title":"Wait"},"description":"Block until the run finishes"},{"name":"include","in":"query","required":false,"schema":{"type":"array","items":{"const":"result","type":"string"},"description":"result: the finished model run payload (with `wait=true`)","default":[],"title":"Include"},"description":"result: the finished model run payload (with `wait=true`)"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelRunRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Completed inline (`wait=true`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}}}},"get":{"tags":["Models"],"summary":"List Model Runs","description":"Runs of a model, newest first, without their results. `live` marks the one the model serves.","operationId":"listModelRuns","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Model ID (model_... or legacy m-...), slug, symbol or exact name","title":"Model"},"description":"Model ID (model_... or legacy m-...), slug, symbol or exact name"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Rows per page","default":50,"title":"Limit"},"description":"Rows per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Rows to skip","default":0,"title":"Offset"},"description":"Rows to skip"},{"name":"updates_only","in":"query","required":false,"schema":{"type":"boolean","description":"Only routine refreshes, excluding tests and strategy builds","default":false,"title":"Updates Only"},"description":"Only routine refreshes, excluding tests and strategy builds"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunPage"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/models/{model}/builds":{"get":{"tags":["Models"],"summary":"List Model Builds","description":"Every build and rebuild attempt, newest first, without scripts. Owner only. `GET /builds/{build_id}` returns one with its script.","operationId":"listModelBuilds","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Model ID (model_... or legacy m-...), slug, symbol or exact name","title":"Model"},"description":"Model ID (model_... or legacy m-...), slug, symbol or exact name"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Rows per page","default":50,"title":"Limit"},"description":"Rows per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Rows to skip","default":0,"title":"Offset"},"description":"Rows to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildSummaryPage"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/models/{model}/script":{"get":{"tags":["Models"],"summary":"Get Model Script","description":"Download the model's standalone Python (public by slug, or owner).\n\nThe file inlines the runtime harness so it runs outside the platform. The model's `script_url` points here.","operationId":"getModelScript","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Model ID (model_... or legacy m-...), slug, symbol or exact name","title":"Model"},"description":"Model ID (model_... or legacy m-...), slug, symbol or exact name"}],"responses":{"200":{"description":"Standalone Python implementation","content":{"text/x-python":{"schema":{"type":"string"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/models/{model}/history":{"get":{"tags":["Models"],"summary":"Get Model History","description":"The model's history over a window, in the blocks you ask for (public or owner).\n\n`dates` is shared by every per-day block. Member models are multiplied through in `allocation` and expanded in `tree`; node weights are fractions of this model at every depth, and `labels` names every key. `latest` is the current allocation plus the latest rebalance decision resolved through each member. `metrics` and `fees` describe the same window. The window defaults to the model's default view (`window` on the fact sheet); `full_history=true` reveals everything computed. `run_id` reads a snapshot run instead of the live history.","operationId":"getModelHistory","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Model ID (model_... or legacy m-...), slug, symbol or exact name","title":"Model"},"description":"Model ID (model_... or legacy m-...), slug, symbol or exact name"},{"name":"include","in":"query","required":false,"schema":{"type":"array","items":{"enum":["returns","allocation","positions","holdings","tree","latest","custom","metrics","fees","contribution"],"type":"string"},"description":"Blocks to return: returns (daily gross returns), allocation (daily weights resolved to tickers plus CASH, with the rebalance ledger; positions and holdings are aliases), tree (daily weights with member models expanded), latest (the current allocation and target allocation), custom (the model's own diagnostics), metrics (performance figures), fees (net-of-fee overlay, Business)","default":["returns"],"title":"Include"},"description":"Blocks to return: returns (daily gross returns), allocation (daily weights resolved to tickers plus CASH, with the rebalance ledger; positions and holdings are aliases), tree (daily weights with member models expanded), latest (the current allocation and target allocation), custom (the model's own diagnostics), metrics (performance figures), fees (net-of-fee overlay, Business)"},{"name":"run_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Read this run's result instead of the live history","title":"Run Id"},"description":"Read this run's result instead of the live history"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Earliest bar to return (YYYY-MM-DD, inclusive). Omit for the beginning of the series (for a model, its default view start).","title":"Start Date"},"description":"Earliest bar to return (YYYY-MM-DD, inclusive). Omit for the beginning of the series (for a model, its default view start)."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Latest bar to return (YYYY-MM-DD, inclusive). Omit for the end of the series.","title":"End Date"},"description":"Latest bar to return (YYYY-MM-DD, inclusive). Omit for the end of the series."},{"name":"full_history","in":"query","required":false,"schema":{"type":"boolean","description":"Models only: return everything computed instead of starting at the model's default view start (see the fact sheet's `window`). Ignored when start_date is given.","default":false,"title":"Full History"},"description":"Models only: return everything computed instead of starting at the model's default view start (see the fact sheet's `window`). Ignored when start_date is given."},{"name":"management_fee","in":"query","required":false,"schema":{"type":"number","minimum":0,"description":"Annual management fee as a fraction, e.g. 0.01 for 1% (`include=fees`)","default":0.0,"title":"Management Fee"},"description":"Annual management fee as a fraction, e.g. 0.01 for 1% (`include=fees`)"},{"name":"financing_rate","in":"query","required":false,"schema":{"type":"number","minimum":0,"description":"Annual rate on gross exposure above 100%, as a fraction (`include=fees`)","default":0.0,"title":"Financing Rate"},"description":"Annual rate on gross exposure above 100%, as a fraction (`include=fees`)"},{"name":"commission_bps","in":"query","required":false,"schema":{"type":"number","minimum":0,"description":"Commissions in basis points of traded notional (`include=fees`)","default":0.0,"title":"Commission Bps"},"description":"Commissions in basis points of traded notional (`include=fees`)"},{"name":"slippage_bps","in":"query","required":false,"schema":{"type":"number","minimum":0,"description":"Slippage in basis points of traded notional (`include=fees`)","default":0.0,"title":"Slippage Bps"},"description":"Slippage in basis points of traded notional (`include=fees`)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelHistory"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"`include=fees` requires the Business plan"},"404":{"description":"Model not found or has no history"}}}},"/v1/models/{model}/draft":{"get":{"tags":["Models"],"summary":"Get Model Draft","description":"Read the saved working copy, or a version-zero copy of current strategy. No writes or metering.","operationId":"getModelDraft","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Owned model ID, slug, symbol or exact name","title":"Model"},"description":"Owned model ID, slug, symbol or exact name"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelDraftView"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["Models"],"summary":"Save Model Draft","description":"Autosave changes without affecting current results. expected_version and base_hash protect concurrent edits; reset starts over from approved source. Free.","operationId":"setModelDraft","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Owned model ID, slug, symbol or exact name","title":"Model"},"description":"Owned model ID, slug, symbol or exact name"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelDraftView"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/models/{model}/draft/test":{"post":{"tags":["Models"],"summary":"Test Model Draft","description":"Freeze and test the saved draft without publishing. A changed prompt generates candidate source; input-only edits reuse source. Metered once per request_key; reuse the key on retries. Poll the returned revision.","operationId":"testModelDraft","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Owned model ID, slug, symbol or exact name","title":"Model"},"description":"Owned model ID, slug, symbol or exact name"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevisionTestRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelRevisionView"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/models/{model}/revisions":{"get":{"tags":["Models"],"summary":"List Model Revisions","description":"Paginated strategy changes and candidate tests, including failures. Source is returned by the individual revision read.","operationId":"listModelRevisions","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Owned model ID, slug, symbol or exact name","title":"Model"},"description":"Owned model ID, slug, symbol or exact name"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Rows per page","default":50,"title":"Limit"},"description":"Rows per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Rows to skip","default":0,"title":"Offset"},"description":"Rows to skip"},{"name":"event","in":"query","required":false,"schema":{"anyOf":[{"enum":["changes","tests"],"type":"string"},{"type":"null"}],"description":"Filter applied changes or candidate tests before pagination","title":"Event"},"description":"Filter applied changes or candidate tests before pagination"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelRevisionViewPage"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/models/{model}/revisions/{revision_id}":{"get":{"tags":["Models"],"summary":"Get Model Revision","description":"Read frozen candidate inputs, source, progress, actual usage and apply eligibility. Owner only.","operationId":"getModelRevision","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Owned model ID, slug, symbol or exact name","title":"Model"},"description":"Owned model ID, slug, symbol or exact name"},{"name":"revision_id","in":"path","required":true,"schema":{"type":"string","description":"Revision ID returned by testing or listing model revisions","title":"Revision Id"},"description":"Revision ID returned by testing or listing model revisions"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelRevisionView"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Models"],"summary":"Rename Model Test","description":"Rename a completed or failed candidate, including a failure without a result. Frozen strategy and apply eligibility are unchanged. Owner only; free.","operationId":"updateModelRevision","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Owned model ID, slug, symbol or exact name","title":"Model"},"description":"Owned model ID, slug, symbol or exact name"},{"name":"revision_id","in":"path","required":true,"schema":{"type":"string","description":"Revision ID returned by testing or listing model revisions","title":"Revision Id"},"description":"Revision ID returned by testing or listing model revisions"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevisionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelRevisionView"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/models/{model}/revisions/{revision_id}/apply":{"post":{"tags":["Models"],"summary":"Apply Model Revision","description":"Atomically make the exact reviewed source, inputs, dependencies and result current. Requires a successful test and unchanged base strategy. Idempotent; no generation, extra test or charge. Dependent refreshes follow publication and retain their normal metering.","operationId":"applyModelRevision","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string","description":"Owned model ID, slug, symbol or exact name","title":"Model"},"description":"Owned model ID, slug, symbol or exact name"},{"name":"revision_id","in":"path","required":true,"schema":{"type":"string","description":"Revision ID returned by testing or listing model revisions","title":"Revision Id"},"description":"Revision ID returned by testing or listing model revisions"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevisionApplyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelRevisionView"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/runs/compare":{"get":{"tags":["Runs"],"summary":"Compare Runs","description":"Several of your runs side by side: the inputs that differ and the figures\na reader judges: model performance metrics.\n\nThe runs must be of one kind; they may belong to different programs.","operationId":"compareRuns","parameters":[{"name":"run_ids","in":"query","required":true,"schema":{"type":"array","items":{"type":"string"},"minItems":2,"maxItems":8,"description":"2 to 8 runs of one kind","title":"Run Ids"},"description":"2 to 8 runs of one kind"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunComparison"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/runs/{run_id}":{"get":{"tags":["Runs"],"summary":"Get Run","description":"One run by id: status, inputs, summary, usage, the program it belongs to\n(with its `inputs_schema`), and its result on request. Owner or shared\nrun only. The returned model and run IDs identify the retained model history.","operationId":"getRun","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","description":"Run ID (run_... or legacy mr-/r-...). Use the returned ID; kind identifies the program type.","title":"Run Id"},"description":"Run ID (run_... or legacy mr-/r-...). Use the returned ID; kind identifies the program type."},{"name":"include","in":"query","required":false,"schema":{"type":"array","items":{"const":"result","type":"string"},"description":"result: the model run's stored backtest history","default":[],"title":"Include"},"description":"result: the model run's stored backtest history"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Runs"],"summary":"Update Run","description":"Relabel a run or share it at /run/{run_id}.","operationId":"updateRun","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","description":"Run ID (run_... or legacy mr-/r-...). Use the returned ID; kind identifies the program type.","title":"Run Id"},"description":"Run ID (run_... or legacy mr-/r-...). Use the returned ID; kind identifies the program type."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Runs"],"summary":"Delete Run","description":"Delete a finished snapshot. The live run and in-flight runs cannot be deleted (409).","operationId":"deleteRun","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","description":"Run ID (run_... or legacy mr-/r-...). Use the returned ID; kind identifies the program type.","title":"Run Id"},"description":"Run ID (run_... or legacy mr-/r-...). Use the returned ID; kind identifies the program type."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/runs/{run_id}/promote":{"post":{"tags":["Runs"],"summary":"Promote Run","description":"Make a model run's inputs the script's defaults.\n\nQueues a default run (source `promote`). For every model,\na successful candidate installs its INPUTS defaults, a `revision` build,\nmembership and depths. Verified results publish in the same transaction;\nsuperseded results retain the prior allocations and queue a fresh run.\nExecution failures preserve prior defaults and results. Required child\nmodels settle before execution.\nSuccessful live runs cascade to dependents. Answers 202 with that run, or 200 with it finished when\n`wait=true`. Models only (409 `not_promotable` for other kinds); 409 when\nthe run is not complete, the script changed beyond INPUTS defaults, the\nrun already uses the defaults, or a default run is in flight. A run from\nan earlier revision still promotes when the live script differs only in\nthose default literals.","operationId":"promoteRun","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","description":"Run ID (run_... or legacy mr-/r-...). Use the returned ID; kind identifies the program type.","title":"Run Id"},"description":"Run ID (run_... or legacy mr-/r-...). Use the returned ID; kind identifies the program type."},{"name":"wait","in":"query","required":false,"schema":{"type":"boolean","description":"Block until the new default run finishes","default":false,"title":"Wait"},"description":"Block until the new default run finishes"}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Completed inline (`wait=true`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}}}}},"/v1/builds/{build_id}":{"get":{"tags":["Builds"],"summary":"Get Build","description":"One build attempt with the script it produced and the full error,\nincluding the traceback. A program's `build_id` names the build behind\nthe script it serves; a run's `script_hash` matches the build that\nproduced it. A legacy `b-<uuid>` id still resolves, stored as-is or\nre-prefixed to mb-/sb-/ab-. Owner only.","operationId":"getBuild","parameters":[{"name":"build_id","in":"path","required":true,"schema":{"type":"string","description":"Build ID (build_... or legacy mb-/sb-/ab-/b-...). Read kind for the program type. A legacy b-<uuid> from a fact sheet still resolves.","title":"Build Id"},"description":"Build ID (build_... or legacy mb-/sb-/ab-/b-...). Read kind for the program type. A legacy b-<uuid> from a fact sheet still resolves."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Build"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/backfills":{"get":{"tags":["Backfills"],"summary":"List Backfills","description":"Your backfill rules, by target symbol.","operationId":"listBackfills","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Rows per page","default":50,"title":"Limit"},"description":"Rows per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Rows to skip","default":0,"title":"Offset"},"description":"Rows to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackfillPage"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/backfills/{symbol}":{"put":{"tags":["Backfills"],"summary":"Set Backfill","description":"Extend one symbol's price history with a longer-lived stand-in.\n\nUse this when a wrapper has the treatment you want but not the history\nyour backtest needs: OILK avoids a K-1 but starts in 2016, so backfilling\nit from USO lets a model hold OILK across a window that predates it. A\nmodel source lets you shape the stand-in's risk profile first (a lightly\nlevered TLT model standing in for EDV, say). The source's returns are\nspliced in before the target's first bar, scaled so the two series join\ncontinuously. Setting a symbol that already has a rule replaces the rule.","operationId":"setBackfill","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","description":"The ticker whose history the rule extends, e.g. OILK","title":"Symbol"},"description":"The ticker whose history the rule extends, e.g. OILK"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackfillSetRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Backfill"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Backfills"],"summary":"Delete Backfill","description":"Remove a symbol's rule. Models keep their stored history until they run again.","operationId":"deleteBackfill","parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","description":"The ticker whose history the rule extends, e.g. OILK","title":"Symbol"},"description":"The ticker whose history the rule extends, e.g. OILK"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/optimizers":{"post":{"tags":["Optimizers"],"summary":"Create Optimizer","description":"Author one portfolio-weighting class. Pass `prompt` to have the LLM\nwrite it (metered like a build) or `script` with exact Python exposing\n`@staticmethod opt(ret_df, syms)`. The class is frozen and injected into\nevery later backtest that names it. Models identify the stored optimizer\nby its class name.","operationId":"createOptimizer","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptimizerCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Optimizer"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["Optimizers"],"summary":"List Optimizers","description":"Your optimizer classes, by name.","operationId":"listOptimizers","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Rows per page","default":50,"title":"Limit"},"description":"Rows per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Rows to skip","default":0,"title":"Offset"},"description":"Rows to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptimizerPage"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/optimizers/{optimizer}":{"get":{"tags":["Optimizers"],"summary":"Get Optimizer","description":"The class source, its hash, and the models whose scripts name it.","operationId":"getOptimizer","parameters":[{"name":"optimizer","in":"path","required":true,"schema":{"type":"string","description":"Optimizer ID (`optimizer_...` or legacy `o-...`) or class name (`MaxSharpeOpt`)","title":"Optimizer"},"description":"Optimizer ID (`optimizer_...` or legacy `o-...`) or class name (`MaxSharpeOpt`)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Optimizer"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Optimizers"],"summary":"Update Optimizer","description":"Replace the class source and/or its description. A script edit is live\nfor every future run of a model that names the class. Renaming the class\nis refused while stored scripts still reference the old name.","operationId":"updateOptimizer","parameters":[{"name":"optimizer","in":"path","required":true,"schema":{"type":"string","description":"Optimizer ID (`optimizer_...` or legacy `o-...`) or class name (`MaxSharpeOpt`)","title":"Optimizer"},"description":"Optimizer ID (`optimizer_...` or legacy `o-...`) or class name (`MaxSharpeOpt`)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptimizerUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Optimizer"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Optimizers"],"summary":"Delete Optimizer","description":"Delete an optimizer. Refused while stored scripts still name it.","operationId":"deleteOptimizer","parameters":[{"name":"optimizer","in":"path","required":true,"schema":{"type":"string","description":"Optimizer ID (`optimizer_...` or legacy `o-...`) or class name (`MaxSharpeOpt`)","title":"Optimizer"},"description":"Optimizer ID (`optimizer_...` or legacy `o-...`) or class name (`MaxSharpeOpt`)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/optimizers/{optimizer}/allocate":{"post":{"tags":["Optimizers"],"summary":"Allocate","description":"Run the class over the trailing common history of the given tickers\nand/or model IDs and return its weights. Tickers see the same\nbackfill-spliced history a backtest would.","operationId":"allocate","parameters":[{"name":"optimizer","in":"path","required":true,"schema":{"type":"string","description":"Optimizer ID (`optimizer_...` or legacy `o-...`) or class name (`MaxSharpeOpt`)","title":"Optimizer"},"description":"Optimizer ID (`optimizer_...` or legacy `o-...`) or class name (`MaxSharpeOpt`)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllocateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Allocation"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/webhooks":{"get":{"tags":["Webhooks"],"summary":"List Webhooks","description":"Your registered receivers.","operationId":"listWebhooks","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Rows per page","default":50,"title":"Limit"},"description":"Rows per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Rows to skip","default":0,"title":"Offset"},"description":"Rows to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPage"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Webhooks"],"summary":"Create Webhook","description":"Register a receiver. Deliveries are POSTs signed with the returned HMAC\nsecret; `secret` documents the verification scheme. Business plan.","operationId":"createWebhook","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/webhooks/{webhook_id}":{"delete":{"tags":["Webhooks"],"summary":"Delete Webhook","description":"Remove a receiver.","operationId":"deleteWebhook","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","description":"Webhook ID (webhook_... or legacy UUID)","title":"Webhook Id"},"description":"Webhook ID (webhook_... or legacy UUID)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/feedback":{"post":{"tags":["Feedback"],"summary":"Submit Feedback","description":"Send a message to the ENSEMBLE team: a bug, a wrong result, a missing\ncapability, or anything else. Returns a feedback id (`feedback_...` or legacy `f-...`) and a `report` with\n`fix_authorized`, `review_url` and the queue. 20 per hour.\nReporting never authorizes implementation,\neven for admins. Plans and notes are reviewed and approved in the admin\ndashboard before a scheduled implementation batch. This does not approve\nor close a report.","operationId":"submitFeedback","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackSubmitRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackReceipt"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["Feedback"],"summary":"List Feedback","description":"Read-only status of feedback reports, newest activity first.\n\nA member sees reports they submitted. An allowlisted admin sees every\nreport's authorization, queue, review link, pull request and closure,\nwithout the message. Does not claim, approve or close.","operationId":"listFeedback","parameters":[{"name":"status","in":"query","required":false,"schema":{"enum":["open","closed","all"],"type":"string","description":"Inbox status: open (default), closed, or all","default":"open","title":"Status"},"description":"Inbox status: open (default), closed, or all"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Rows per page","default":50,"title":"Limit"},"description":"Rows per page"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Rows to skip","default":0,"title":"Offset"},"description":"Rows to skip"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackReportPage"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/feedback/{feedback_id}":{"get":{"tags":["Feedback"],"summary":"Get Feedback","description":"Read-only status of one report: `fix_authorized`, `review_url`, queue,\npull request and closure. A missing id and a report you cannot see are\nboth not found. Does not claim, approve or close.","operationId":"getFeedback","parameters":[{"name":"feedback_id","in":"path","required":true,"schema":{"type":"string","description":"Feedback ID (feedback_... or legacy f-...)","title":"Feedback Id"},"description":"Feedback ID (feedback_... or legacy f-...)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackReport"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/runtime/{kind}":{"get":{"tags":["Runtime"],"summary":"Get Runtime","description":"The contract a supplied script is validated against.\n\nConstants, entry point, the harness interface as a stub with every\nsignature and docstring, the validation rules, and a skeleton. Describes\nthe Python interface used by the validator and execution sandbox.\nFree; cacheable until the harness version changes.","operationId":"getRuntime","parameters":[{"name":"kind","in":"path","required":true,"schema":{"const":"models","type":"string","description":"models","title":"Kind"},"description":"models"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Runtime"}}}},"4XX":{"description":"The request was refused; `error.type` says why","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"5XX":{"description":"The server failed; quote `X-Request-Id` when reporting it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"Account":{"properties":{"user_id":{"type":"string","title":"User Id","description":"WorkOS user id (user_01...)"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Account email (null if the identity provider is unreachable)"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Display name (null if the identity provider is unreachable)"},"plan":{"type":"string","title":"Plan","description":"Billing plan: starter | hobby | business"},"auth_method":{"type":"string","enum":["api_key","jwt"],"title":"Auth Method","description":"How this request authenticated: api_key (an ensemble_ key) or jwt (an AuthKit session or OAuth token). A stale OAuth session and a correct key can name different accounts."},"role":{"type":"string","enum":["admin","member"],"title":"Role","description":"admin when this user id is on the server admin allowlist; member otherwise. An admin's explicit reports can be fixed without a separate approval. This field does not grant approval: approving a fix requires the admin dashboard."},"counts":{"$ref":"#/components/schemas/AccountCounts","description":"Collection sizes. An unexpectedly empty collection here means the credential belongs to a different account than expected."}},"type":"object","required":["user_id","plan","auth_method","role","counts"],"title":"Account","description":"Identity and holdings of the account behind the current credential."},"AccountBilling":{"properties":{"plan":{"type":"string","title":"Plan","description":"Billing plan: starter | hobby | business"},"phase":{"type":"string","enum":["credits","metered","unfunded","unavailable"],"title":"Phase","description":"credits: local credits cover new work, previously accrued metered usage remains owed; metered: credits are spent, usage bills against the spending cap; unfunded: credits are spent and there is no active subscription (every metered request is refused); unavailable: the decision needs Stripe and Stripe could not be reached."},"remaining_cents":{"type":"integer","title":"Remaining Cents","description":"Headroom for new work: credits plus verified metered headroom (cap minus accrued usage), minus outstanding holds. Unverified metered funds are excluded. A request is refused when its projected cost exceeds this."},"held_cents":{"type":"integer","title":"Held Cents","description":"Projected cost of builds and runs currently in flight"},"credits_remaining_cents":{"type":"integer","title":"Credits Remaining Cents","description":"Local credits left: monthly included, signup grant and promo"},"spending_cap_cents":{"type":"integer","title":"Spending Cap Cents","description":"Metered spend allowed per billing period (dashboard setting)"},"period_usage_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Period Usage Cents","description":"Metered liability incurred this billing period, including queued Stripe delivery. Adding credits never reduces this amount. Null when the billing period could not be verified."},"projected_run_cents":{"type":"integer","title":"Projected Run Cents","description":"What one run of a stored script holds at admission"},"projected_build_cents":{"type":"integer","title":"Projected Build Cents","description":"What one build or rebuild on the default agent tier holds at admission"},"has_payment_method":{"type":"boolean","title":"Has Payment Method","description":"A Stripe customer exists for the account"},"has_subscription":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Subscription","description":"Active subscription: true or false when verified, null when unavailable"},"current_period_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period Start"},"current_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period End"},"signup_credits_expire_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Signup Credits Expire At","description":"When the unspent signup grant lapses"},"usage_help_url":{"type":"string","title":"Usage Help Url","description":"Informational help for usage, holds and account limitations"},"dashboard_url":{"type":"string","title":"Dashboard Url","description":"Deprecated alias of usage_help_url (informational help)","deprecated":true}},"type":"object","required":["plan","phase","remaining_cents","held_cents","credits_remaining_cents","spending_cap_cents","projected_run_cents","projected_build_cents","has_payment_method","usage_help_url","dashboard_url"],"title":"AccountBilling","description":"What the account can spend right now, in the same figures the 402 uses.\n\nEvery build and run is metered in units of one cent. Admission holds the\nprojected cost against `remaining_cents`; the request that would take it\nbelow zero is refused with 402 `insufficient_credits` (no funding on\nrecord) or `insufficient_funds` (spending cap reached for the period)."},"AccountCounts":{"properties":{"models":{"$ref":"#/components/schemas/AccountModelCounts","description":"Model counts by type"},"backfills":{"type":"integer","title":"Backfills","description":"Number of backfill rules"},"optimizers":{"type":"integer","title":"Optimizers","description":"Number of stored optimizer classes"}},"type":"object","required":["models","backfills","optimizers"],"title":"AccountCounts","description":"Sizes of the account's collections."},"AccountModelCounts":{"properties":{"total":{"type":"integer","title":"Total","description":"Total models"},"direct":{"type":"integer","title":"Direct","description":"Models that hold assets only"},"composite":{"type":"integer","title":"Composite","description":"Models that hold other models"}},"type":"object","required":["total","direct","composite"],"title":"AccountModelCounts","description":"Model counts by structure."},"AllocateInput":{"properties":{"symbol":{"type":"string","title":"Symbol"},"kind":{"type":"string","enum":["asset","model"],"title":"Kind"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"first_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Date"}},"type":"object","required":["symbol","kind"],"title":"AllocateInput"},"AllocateOptimizerRef":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"AllocateOptimizerRef"},"AllocateRequest":{"properties":{"symbols":{"items":{"type":"string"},"type":"array","maxItems":50,"minItems":1,"title":"Symbols","description":"Tickers and/or model IDs (model_... or legacy m-...) to allocate across, at most 50","example":["SPY","TLT","GLD"]},"lookback":{"type":"integer","maximum":2520.0,"minimum":20.0,"title":"Lookback","description":"Trailing common trading days to feed the optimizer","default":252},"as_of":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"As Of","description":"Inclusive YYYY-MM-DD cutoff; defaults to the latest common bar","example":"2024-12-31"}},"type":"object","required":["symbols"],"title":"AllocateRequest","description":"Run a stored optimizer over a mix of tickers and model IDs."},"Allocation":{"properties":{"optimizer":{"$ref":"#/components/schemas/AllocateOptimizerRef"},"as_of":{"type":"string","title":"As Of"},"lookback":{"type":"integer","title":"Lookback"},"rows_used":{"type":"integer","title":"Rows Used"},"weights":{"additionalProperties":{"type":"number"},"type":"object","title":"Weights"},"inputs":{"items":{"$ref":"#/components/schemas/AllocateInput"},"type":"array","title":"Inputs"}},"type":"object","required":["optimizer","as_of","lookback","rows_used","weights","inputs"],"title":"Allocation"},"Asset":{"properties":{"asset_class":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Asset Class","description":"equity, fixed_income, commodity, currency, alternatives, asset_allocation"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"Descriptive `dimension:value` tags, e.g. region:us, size:large, sector:energy, commodity:precious_metals, bond:high_yield, theme:gold_miners. Multi-valued because the facts are (a gold+miners fund carries both) and independent of the wrapper, so a 3x utilities fund still reads sector:utilities. Empty means unclassified."},"legal_structure":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Structure","description":"ric, uit, grantor_trust, commodity_pool, etn, closed_end_trust"},"tax_form":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Form","description":"1099, k1, or pfic"},"leverage":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Leverage","description":"Signed target leverage multiple; reset frequency varies by product. SH = -1.0, UVXY = 1.5, DGP = 2.0"},"issuer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issuer","description":"Fund family / issuer name"},"cik":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cik","description":"SEC EDGAR CIK"},"first_price_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"First Price Date","description":"First daily bar. The stored history's first bar when bars are on file, otherwise the catalog seed. See price_coverage."},"last_price_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Last Price Date","description":"Most recent daily bar: the later of the stored history edge and the catalog seed. price_coverage says which one you are looking at. An unread asset with no seed is null, which is not evidence of no prices."},"price_coverage":{"$ref":"#/components/schemas/PriceCoverage","description":"Seed versus stored bars. source is history (bars on file), catalog (seed only), unread (neither), or empty (a read found no bars)."},"tax_evidence":{"$ref":"#/components/schemas/TaxEvidence","description":"Whether tax_form and legal_structure are classified from a source and as-of, stored without that evidence, or null. Null is unclassified, not 1099."},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country","description":"Single-country mandate read from the name. Null when the name states a broader region, more than one country, or none. Funds that share a value are the same country exposure. Holdings are not consulted. The list filter names the accepted values."},"id":{"type":"string","title":"Id","description":"Asset ID (asset_... or legacy a-...)"},"symbol":{"type":"string","title":"Symbol"},"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type","description":"Asset type: etf | fund | stock | crypto"},"exchange":{"type":"string","title":"Exchange"},"currency":{"type":"string","title":"Currency","default":"USD"},"delisted":{"type":"boolean","title":"Delisted","default":false},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"data":{"additionalProperties":true,"type":"object","title":"Data","description":"Instrument-specific blob. List endpoints project this; GET returns it whole."},"backfill":{"anyOf":[{"$ref":"#/components/schemas/AssetBackfill"},{"type":"null"}],"description":"The caller's backfill rule for this symbol, if any"}},"type":"object","required":["price_coverage","tax_evidence","id","symbol","name","type","exchange","updated_at"],"title":"Asset","description":"Full asset payload for GET-by-id/symbol.\n\nSame columns as a screener row, plus the whole data blob and the caller's\nbackfill — both are per-asset reads, so neither belongs on a 500-row page."},"AssetBackfill":{"properties":{"source_type":{"type":"string","enum":["asset","model"],"title":"Source Type"},"source":{"type":"string","title":"Source","description":"Ticker or model ID supplying the history"},"source_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Name","description":"Display name of the source, when it has one"},"splice_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Splice Date","description":"First bar of the symbol's own history. Everything before it comes from `source`, scaled to join continuously."}},"type":"object","required":["source_type","source"],"title":"AssetBackfill","description":"The caller's history-extension rule for this symbol.\n\nPresent on asset reads so an extended series is self-documenting: a 2x\nsilver ETN listed in 2026 whose history starts in 2008 is a backfill, not\ncorrupt data, and the reader should not have to infer that from a date."},"AssetFacets":{"properties":{"type":{"items":{"$ref":"#/components/schemas/FacetBucket"},"type":"array","title":"Type"},"tax_form":{"items":{"$ref":"#/components/schemas/FacetBucket"},"type":"array","title":"Tax Form"},"legal_structure":{"items":{"$ref":"#/components/schemas/FacetBucket"},"type":"array","title":"Legal Structure"},"asset_class":{"items":{"$ref":"#/components/schemas/FacetBucket"},"type":"array","title":"Asset Class"},"tags":{"items":{"$ref":"#/components/schemas/FacetBucket"},"type":"array","title":"Tags","description":"Tag counts, fully qualified (`sector:energy`); the head of a long tail"},"issuer":{"items":{"$ref":"#/components/schemas/FacetBucket"},"type":"array","title":"Issuer"},"dimensions":{"items":{"$ref":"#/components/schemas/TagDimension"},"type":"array","title":"Dimensions","description":"The closed tag vocabulary by dimension. A tag outside it is rejected, not approximated."}},"type":"object","title":"AssetFacets","description":"Counts within the current filter set, plus the vocabulary the tag filters accept."},"AssetHistory":{"properties":{"id":{"type":"string","title":"Id"},"symbol":{"type":"string","title":"Symbol"},"status":{"type":"string","title":"Status"},"dates":{"items":{"type":"string"},"type":"array","title":"Dates"},"returns":{"items":{"type":"number"},"type":"array","title":"Returns"},"first_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"First Date"},"last_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Last Date"},"rows":{"type":"integer","title":"Rows","default":0},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date","description":"Requested window start (inclusive)"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date","description":"Requested window end (inclusive)"},"fetched_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Fetched At"},"data_edge":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Data Edge","description":"Last bar stored for the asset, whatever the window. An empty window that starts after this is past the edge, not missing data."},"stale":{"type":"boolean","title":"Stale","description":"The bars are older than the refresh window; a refresh failed or is in flight","default":false},"refreshing":{"type":"boolean","title":"Refreshing","description":"A refresh is running now; read again in a few seconds for the new edge","default":false},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"backfill":{"anyOf":[{"$ref":"#/components/schemas/AssetBackfill"},{"type":"null"}]},"metrics":{"anyOf":[{"$ref":"#/components/schemas/AssetMetrics"},{"type":"null"}],"description":"Present with `include=metrics`; computed over the returned slice"}},"type":"object","required":["id","symbol","status"],"title":"AssetHistory","description":"Daily total-return stream for one asset.\n\nWhen `backfill` is set the stream is the spliced full history and\n`backfill.splice_date` marks where the asset's own bars begin. A\nrequested `start_date`/`end_date` window is echoed back, and `dates`,\n`returns`, `first_date`, `last_date`, `rows` and `metrics` all describe\nthe returned slice (inclusive bounds)."},"AssetListItem":{"properties":{"asset_class":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Asset Class","description":"equity, fixed_income, commodity, currency, alternatives, asset_allocation"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"Descriptive `dimension:value` tags, e.g. region:us, size:large, sector:energy, commodity:precious_metals, bond:high_yield, theme:gold_miners. Multi-valued because the facts are (a gold+miners fund carries both) and independent of the wrapper, so a 3x utilities fund still reads sector:utilities. Empty means unclassified."},"legal_structure":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Structure","description":"ric, uit, grantor_trust, commodity_pool, etn, closed_end_trust"},"tax_form":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Form","description":"1099, k1, or pfic"},"leverage":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Leverage","description":"Signed target leverage multiple; reset frequency varies by product. SH = -1.0, UVXY = 1.5, DGP = 2.0"},"issuer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issuer","description":"Fund family / issuer name"},"cik":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cik","description":"SEC EDGAR CIK"},"first_price_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"First Price Date","description":"First daily bar. The stored history's first bar when bars are on file, otherwise the catalog seed. See price_coverage."},"last_price_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Last Price Date","description":"Most recent daily bar: the later of the stored history edge and the catalog seed. price_coverage says which one you are looking at. An unread asset with no seed is null, which is not evidence of no prices."},"price_coverage":{"$ref":"#/components/schemas/PriceCoverage","description":"Seed versus stored bars. source is history (bars on file), catalog (seed only), unread (neither), or empty (a read found no bars)."},"tax_evidence":{"$ref":"#/components/schemas/TaxEvidence","description":"Whether tax_form and legal_structure are classified from a source and as-of, stored without that evidence, or null. Null is unclassified, not 1099."},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country","description":"Single-country mandate read from the name. Null when the name states a broader region, more than one country, or none. Funds that share a value are the same country exposure. Holdings are not consulted. The list filter names the accepted values."},"id":{"type":"string","title":"Id","description":"Asset ID (asset_... or legacy a-...)"},"symbol":{"type":"string","title":"Symbol"},"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type","description":"Asset type: etf | fund | stock | crypto"},"exchange":{"type":"string","title":"Exchange"},"currency":{"type":"string","title":"Currency","default":"USD"},"delisted":{"type":"boolean","title":"Delisted","default":false},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"data":{"additionalProperties":true,"type":"object","title":"Data","description":"Instrument-specific blob. List endpoints project this; GET returns it whole."}},"type":"object","required":["price_coverage","tax_evidence","id","symbol","name","type","exchange","updated_at"],"title":"AssetListItem","description":"Screener row: catalog columns, with data projected to LIST_DATA_KEYS."},"AssetMetrics":{"properties":{"total_return":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Return"},"cagr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cagr"},"volatility":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volatility"},"sharpe":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sharpe"},"sortino":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sortino"},"max_drawdown":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Drawdown"},"calmar":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Calmar"},"best_month":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Best Month"},"worst_month":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Worst Month"},"positive_months":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Positive Months"},"trading_days":{"type":"integer","title":"Trading Days","default":0}},"type":"object","title":"AssetMetrics"},"AssetPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/AssetListItem"},"type":"array","title":"Data"},"total":{"type":"integer","title":"Total","description":"Assets matching the filters, across every page"},"facets":{"anyOf":[{"$ref":"#/components/schemas/AssetFacets"},{"type":"null"}],"description":"Present with `include=facets`"}},"type":"object","required":["data","total"],"title":"AssetPage","description":"One page of the catalog screener."},"Backfill":{"properties":{"symbol":{"type":"string","title":"Symbol","description":"The target ticker, uppercase"},"source_type":{"type":"string","enum":["asset","model"],"title":"Source Type"},"source":{"type":"string","title":"Source","description":"Ticker or model ID supplying the history"},"source_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Name","description":"The asset's or model's name, when it has one"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["symbol","source_type","source","created_at","updated_at"],"title":"Backfill","description":"One stored backfill rule."},"BackfillSetRequest":{"properties":{"source":{"type":"string","maxLength":80,"minLength":1,"title":"Source","description":"A ticker (`USO`) or one of your built models' IDs (`model_...` or legacy `m-...`)","example":"USO"},"source_type":{"type":"string","enum":["asset","model"],"title":"Source Type","description":"asset: another ticker's history; model: a model's return stream","default":"asset"}},"type":"object","required":["source"],"title":"BackfillSetRequest","description":"The stand-in for one symbol. Setting a symbol that has a rule replaces it."},"BillingActivity":{"properties":{"resource_type":{"type":"string","title":"Resource Type"},"resource_id":{"type":"string","title":"Resource Id"},"resource_name":{"type":"string","title":"Resource Name"},"operation":{"type":"string","title":"Operation"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"breakdown":{"additionalProperties":{"anyOf":[{"type":"integer"},{"type":"number"}]},"type":"object","title":"Breakdown"}},"type":"object","required":["resource_type","resource_id","resource_name","operation"],"title":"BillingActivity"},"BillingCharge":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"activity":{"anyOf":[{"$ref":"#/components/schemas/BillingActivity"},{"type":"null"}],"description":"Immutable activity description; null for legacy charges without retained context"},"cost_cents":{"type":"integer","title":"Cost Cents"},"credits_used_cents":{"type":"integer","title":"Credits Used Cents"},"metered_cents":{"type":"integer","title":"Metered Cents"},"waived_cents":{"type":"integer","title":"Waived Cents"},"waiver_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Waiver Reason"},"spending_cap_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Spending Cap Cents","description":"Cap applied when this charge settled; unknown for older charges"},"billing_period_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Billing Period Start"},"billing_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Billing Period End"},"delivery_status":{"type":"string","title":"Delivery Status"}},"type":"object","required":["id","created_at","cost_cents","credits_used_cents","metered_cents","waived_cents","delivery_status"],"title":"BillingCharge"},"Build":{"properties":{"id":{"type":"string","title":"Id","description":"Build ID (build_... or legacy mb-/sb-/ab-/b-...). Read kind for the program type."},"kind":{"type":"string","const":"model","title":"Kind"},"program_id":{"type":"string","title":"Program Id","description":"The model built"},"attempt":{"type":"string","enum":["build","rebuild","revision"],"title":"Attempt","description":"build: the first build; rebuild: a later generation; revision: a promote rewrote the script's defaults without generating"},"status":{"type":"string","enum":["succeeded","failed","cancelled"],"title":"Status"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"effort":{"anyOf":[{"type":"string","enum":["min","mid","max"]},{"type":"null"}],"title":"Effort"},"script_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Script Hash","description":"SHA-256 of the script this attempt produced; runs carry the same hash"},"error":{"anyOf":[{"$ref":"#/components/schemas/BuildError"},{"type":"null"}]},"usage":{"anyOf":[{"$ref":"#/components/schemas/BuildUsage"},{"type":"null"}]},"trace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trace Id"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"type":"string","format":"date-time","title":"Completed At"},"script":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Script"},"traceback":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Traceback"},"timing":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Timing"}},"type":"object","required":["id","kind","program_id","attempt","status","completed_at"],"title":"Build","description":"A build with the script it produced and the full error, including traceback."},"BuildError":{"properties":{"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type","description":"validation_failed: the request was rejected before any code was written (not billed). generation_failed: the generated script failed validation. execution_failed: the sandbox run failed. internal_error and cancelled are ours and not billed."},"message":{"type":"string","title":"Message"},"code_excerpt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code Excerpt","description":"The lines of the script around the failure, if any"},"validation":{"anyOf":[{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array"},{"type":"null"}],"title":"Validation","description":"The rejection(s), present when the build failed validation"}},"type":"object","required":["message"],"title":"BuildError"},"BuildSummary":{"properties":{"id":{"type":"string","title":"Id","description":"Build ID (build_... or legacy mb-/sb-/ab-/b-...). Read kind for the program type."},"kind":{"type":"string","const":"model","title":"Kind"},"program_id":{"type":"string","title":"Program Id","description":"The model built"},"attempt":{"type":"string","enum":["build","rebuild","revision"],"title":"Attempt","description":"build: the first build; rebuild: a later generation; revision: a promote rewrote the script's defaults without generating"},"status":{"type":"string","enum":["succeeded","failed","cancelled"],"title":"Status"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"effort":{"anyOf":[{"type":"string","enum":["min","mid","max"]},{"type":"null"}],"title":"Effort"},"script_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Script Hash","description":"SHA-256 of the script this attempt produced; runs carry the same hash"},"error":{"anyOf":[{"$ref":"#/components/schemas/BuildError"},{"type":"null"}]},"usage":{"anyOf":[{"$ref":"#/components/schemas/BuildUsage"},{"type":"null"}]},"trace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trace Id"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"type":"string","format":"date-time","title":"Completed At"}},"type":"object","required":["id","kind","program_id","attempt","status","completed_at"],"title":"BuildSummary","description":"One terminal build attempt, as listed. Owner-only."},"BuildUsage":{"properties":{"units":{"type":"integer","title":"Units"},"base":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Base"},"tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tokens"},"seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seconds"},"effort":{"anyOf":[{"type":"string","enum":["min","mid","max"]},{"type":"null"}],"title":"Effort","description":"The effort the attempt was billed at"}},"type":"object","required":["units"],"title":"BuildUsage","description":"Billing usage for one generation."},"Deleted":{"properties":{"id":{"type":"string","title":"Id","description":"The deleted record's id (a backfill's symbol)"},"kind":{"type":"string","enum":["model","run","backfill","optimizer","webhook"],"title":"Kind"},"deleted":{"type":"boolean","const":true,"title":"Deleted","default":true}},"type":"object","required":["id","kind"],"title":"Deleted","description":"The confirmation every DELETE returns. A silent 204 cannot be told from\na swallowed error at the end of a pipeline; this can, and names what went."},"DraftUpdate":{"properties":{"expected_version":{"type":"integer","minimum":0.0,"title":"Expected Version","description":"Optimistic lock. Use zero for a new working draft."},"base_hash":{"type":"string","title":"Base Hash","description":"Strategy fingerprint returned with the draft; detects intervening changes."},"prompt":{"anyOf":[{"type":"string","maxLength":25000,"minLength":10},{"type":"null"}],"title":"Prompt","description":"Plain-language strategy instructions for the working draft"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description","description":"Short explanation of the model's purpose, published only on apply"},"inputs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Inputs","description":"Candidate input values, validated against the draft's input schema"},"script":{"anyOf":[{"type":"string","maxLength":150000},{"type":"null"}],"title":"Script","description":"Optional supplied candidate source. Null uses the stored source or generates from changed instructions."},"effort":{"anyOf":[{"type":"string","enum":["min","mid","max"]},{"type":"null"}],"title":"Effort","description":"Candidate generation effort; balanced (mid) by default"},"from_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Run Id","description":"Explicitly start from an owned historical result with recoverable source and inputs."},"reset":{"type":"boolean","title":"Reset","description":"Replace the draft with the current approved strategy, subject to expected_version.","default":false}},"type":"object","required":["expected_version","base_hash"],"title":"DraftUpdate"},"ErrorBody":{"properties":{"type":{"type":"string","enum":["invalid_request","authentication","permission","not_found","conflict","rate_limited","insufficient_funds","server_error"],"title":"Type","description":"invalid_request (422): the request could not be understood; authentication (401): no or invalid credential; permission (403): the plan or the account does not allow it; not_found (404); conflict (409): the resource is busy or the change is impossible in its current state; rate_limited (429); insufficient_funds (402): the account cannot pay for the operation; server_error (5xx)."},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code","description":"A stable, more specific reason (e.g. `run_conflict`), when one exists"},"message":{"type":"string","title":"Message","description":"What went wrong and, where possible, what to do"},"param":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Param","description":"The request field the error refers to, if any"},"details":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"items":{"$ref":"#/components/schemas/ErrorRelatedModel"},"type":"array"},{"type":"null"}]},"type":"object"},{"type":"null"}],"title":"Details","description":"Facts behind the failure. An auto_update_required_by_parents conflict carries `parents` with model IDs, names and links. A 402 carries `projected_cents`, `remaining_cents`, `held_cents`, `credits_remaining_cents`, `spending_cap_cents`, `period_usage_cents`, `phase`, `retryable` (false: this request is final), `usage_help_url` and its deprecated alias `dashboard_url`."}},"type":"object","required":["type","message"],"title":"ErrorBody"},"ErrorRelatedModel":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"url":{"type":"string","title":"Url"}},"type":"object","required":["id","name","url"],"title":"ErrorRelatedModel"},"ErrorResponse":{"properties":{"error":{"$ref":"#/components/schemas/ErrorBody"}},"type":"object","required":["error"],"title":"ErrorResponse","description":"Every non-2xx response. The `X-Request-Id` header identifies the request."},"FacetBucket":{"properties":{"value":{"type":"string","title":"Value"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["value","count"],"title":"FacetBucket"},"FeeAssumptions":{"properties":{"management_fee":{"type":"number","minimum":0.0,"title":"Management Fee","description":"Annual management fee as a fraction, e.g. 0.01 for 1%","default":0.0},"financing_rate":{"type":"number","minimum":0.0,"title":"Financing Rate","description":"Annual rate charged on gross exposure above 100%, as a fraction","default":0.0},"commission_bps":{"type":"number","minimum":0.0,"title":"Commission Bps","description":"Commissions, in basis points of two-sided traded notional","default":0.0},"slippage_bps":{"type":"number","minimum":0.0,"title":"Slippage Bps","description":"Slippage, in basis points of two-sided traded notional","default":0.0}},"type":"object","title":"FeeAssumptions","description":"Flat industry-standard rates overlaid on gross returns (`include=fees`).\n\nTime-varying or exotic costs belong in the model's own script and its\ncustom diagnostics. Fund expense ratios are already in the prices."},"FeedbackClosure":{"properties":{"environment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Environment","description":"cloud, local, dashboard, or unknown"},"runner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Runner","description":"Name recorded when the report was closed"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id","description":"Run that closed the report"},"run_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Url","description":"Link to that run"},"pr_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pr Url","description":"Pull request recorded at closure"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary","description":"Reserved for compatibility; private closure notes are not exposed"},"closed_at":{"type":"string","title":"Closed At","description":"When this closure was recorded"},"via":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Via","description":"cloud_fixer, local_agent, or admin_dashboard"},"actor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Id","description":"Run or admin id that closed the report"}},"type":"object","required":["closed_at"],"title":"FeedbackClosure","description":"Latest closure attribution. Verification evidence is in the private admin history."},"FeedbackQueue":{"properties":{"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","description":"inbox, queued, planning, needs_input, review, approved, implementing, verifying, blocked, or closed."},"owner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner","description":"Cursor run id that claimed the report"},"environment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Environment","description":"cloud or local, declared by the claiming run"},"runner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Runner","description":"Name the claiming run declared for itself"},"run_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Url","description":"Link to the owning run, when one was recorded"},"attempts":{"type":"integer","title":"Attempts","description":"Planning or implementation attempts","default":0},"plan_revision":{"type":"integer","title":"Plan Revision","description":"Current proposed plan revision","default":0},"resolution":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution","description":"implemented, rejected, duplicate, manual, or legacy_closed"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary","description":"Reserved for compatibility; private review summaries are not exposed"},"approved":{"type":"boolean","title":"Approved","description":"An admin approved the reviewed fix from the dashboard. This read did not do that.","default":false}},"type":"object","title":"FeedbackQueue","description":"Planning and implementation state for one report. Null fields mean that step has not happened."},"FeedbackReceipt":{"properties":{"id":{"type":"string","title":"Id","description":"Feedback ID (feedback_... or legacy f-...) to reference in follow-ups"},"status":{"type":"string","title":"Status","description":"Always `received`"},"message":{"type":"string","title":"Message","description":"Human-readable acknowledgement"},"report":{"$ref":"#/components/schemas/FeedbackReport","description":"Status at submission. Poll GET /v1/feedback/{feedback_id} after that."}},"type":"object","required":["id","status","message","report"],"title":"FeedbackReceipt","description":"Acknowledgement of a feedback submission, plus the status to follow."},"FeedbackReport":{"properties":{"id":{"type":"string","title":"Id","description":"Feedback ID (feedback_... or legacy f-...)"},"status":{"type":"string","title":"Status","description":"Inbox status: open or closed"},"source_type":{"type":"string","title":"Source Type","description":"user, agent, or internal"},"channel":{"type":"string","title":"Channel","description":"gui, mcp, cli, or api"},"mine":{"type":"boolean","title":"Mine","description":"True when this credential submitted the report"},"fix_authorized":{"type":"boolean","title":"Fix Authorized","description":"Server decision. True only after an admin approves the current plan and notes. Report text cannot change it. This response does not approve or close anything."},"review_url":{"type":"string","title":"Review Url","description":"Admin detail for this report. Approval, when required, happens there in a dashboard session."},"queue":{"$ref":"#/components/schemas/FeedbackQueue"},"pr_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pr Url","description":"Pull request from the queue or the latest closure"},"closure":{"anyOf":[{"$ref":"#/components/schemas/FeedbackClosure"},{"type":"null"}],"description":"Latest closure, when the report has been closed"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"closed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Closed At"}},"type":"object","required":["id","status","source_type","channel","mine","fix_authorized","review_url","queue"],"title":"FeedbackReport","description":"Read-only status of one report. No message body, context, or attachments."},"FeedbackSubmitRequest":{"properties":{"message":{"type":"string","maxLength":5000,"minLength":1,"title":"Message","description":"What happened or what you want. Paste error text verbatim."},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Optional JSON: model id, tool/endpoint, arguments, client. Secrets are redacted."}},"type":"object","required":["message"],"title":"FeedbackSubmitRequest","description":"Request model for submitting feedback"},"HoldingLabel":{"properties":{"symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"type":{"type":"string","enum":["model","asset","cash"],"title":"Type"},"depth":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Depth","description":"Model nodes only"}},"type":"object","required":["type"],"title":"HoldingLabel","description":"Display metadata for a key in `allocation` or a node in `tree`."},"InputsDiffRow":{"properties":{"key":{"type":"string","title":"Key","description":"Dotted path for nested inputs"},"values":{"additionalProperties":true,"type":"object","title":"Values","description":"run_id -> value"}},"type":"object","required":["key","values"],"title":"InputsDiffRow"},"Model":{"properties":{"id":{"type":"string","title":"Id","description":"Model ID (model_... or legacy m-...)"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"May be null if the build failed before naming"},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol","description":"May be null if the build failed before naming"},"status":{"type":"string","enum":["building","active","updating","paused","blocked","failed"],"title":"Status","description":"building: no results yet; active: results served and refreshed nightly; updating: a rebuild or refresh is running (results keep serving); blocked: updates await a failed or unavailable dependency; paused: results served, nightly refresh off; failed: the build never produced a usable model"},"run":{"anyOf":[{"$ref":"#/components/schemas/ModelActivity"},{"type":"null"}],"description":"The build, rebuild, or default run in progress; null when idle"},"warning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Warning","description":"Something went wrong without changing the status: a failed rebuild, a paused auto-update, or overdue data"},"depth":{"type":"integer","title":"Depth","description":"0 when the model holds assets only; otherwise one more than its deepest member","default":0},"structure":{"anyOf":[{"$ref":"#/components/schemas/ModelStructure"},{"type":"null"}],"description":"Distinct models and assets across the whole tree; null until built"},"as_of":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"As Of","description":"Last market session covered by the results"},"auto_update":{"type":"boolean","title":"Auto Update","description":"Whether the nightly refresh is on","default":false},"refresh":{"anyOf":[{"$ref":"#/components/schemas/ModelRefresh"},{"type":"null"}]},"is_public":{"type":"boolean","title":"Is Public"},"is_favorite":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Favorite","description":"Owner's favorite state; null for non-owner readers"},"labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Labels","description":"Owner's private organizational labels; null for non-owner readers"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"Tear sheet URL; set once the model has built"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"approved_revision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved Revision Id"},"editing_available":{"type":"boolean","title":"Editing Available","default":false},"prompt":{"type":"string","title":"Prompt"},"universe":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Universe","description":"Symbols the model's code actually trades, as recorded by the runtime: tickers, member model IDs, or both. Null until a run has succeeded."},"components":{"items":{"$ref":"#/components/schemas/ModelRef"},"type":"array","title":"Components","description":"Models this model holds directly"},"held_by":{"items":{"$ref":"#/components/schemas/ModelRef"},"type":"array","title":"Held By","description":"Models that hold this model directly. It cannot be deleted while any remain."},"error":{"anyOf":[{"$ref":"#/components/schemas/ModelError"},{"type":"null"}]},"script_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Script Url","description":"Download URL for the standalone Python implementation (runtime harness inlined, served as text/x-python). Null until code exists."},"window":{"anyOf":[{"$ref":"#/components/schemas/ModelWindow"},{"type":"null"}],"description":"The span the model is judged over. Null until a run has succeeded; the stored setting is still reported via start_date / start_rule."},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date","description":"Where the default view of the history begins (YYYY-MM-DD). The full history is always computed and `full_history=true` on any history read reveals it; omission lets start_rule choose. The backtest's start date is an execution input, separate from this view window."},"start_rule":{"type":"string","enum":["two_members","all_members","first_member"],"title":"Start Rule","description":"Where the default view begins when no start_date is set. two_members (default): the first day two universe members have data, the earliest a rebalance between them means anything. all_members: the first day every member has data. first_member: the first day any member has data, the full history.","default":"two_members"},"availability":{"anyOf":[{"$ref":"#/components/schemas/ModelAvailability"},{"type":"null"}]},"schedule":{"anyOf":[{"$ref":"#/components/schemas/ModelSchedule"},{"type":"null"}]},"usage":{"anyOf":[{"$ref":"#/components/schemas/ModelUsage"},{"type":"null"}]},"metadata":{"anyOf":[{"$ref":"#/components/schemas/ModelMetadata"},{"type":"null"}]},"custom_keys":{"anyOf":[{"$ref":"#/components/schemas/ModelCustomKeys"},{"type":"null"}],"description":"Key manifest for the model's custom diagnostics. The data itself is at GET /models/{model}/history?include=custom."},"inputs_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Inputs Schema","description":"JSON Schema for `inputs` on a run, with defaults: the script's declared inputs followed by the platform's `start_date` (format date, default null). A run at the defaults computes the full history and goes live; a run with a `start_date` trades nothing before it and is a snapshot."},"live_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Live Run Id","description":"The default run whose result is the live history"},"estimate_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Estimate Cents","description":"On the 202 from create and rebuild: what the queued build holds against the balance, in cents. The charge that lands when it finishes replaces this figure. Null on every other read."},"build_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Build Id","description":"The build that produced the current script; on a failed program, the failed build, so getBuild shows what was billed. getBuild returns it."},"is_owner":{"type":"boolean","title":"Is Owner","description":"True when the caller owns this model","default":false}},"type":"object","required":["id","status","is_public","created_at","updated_at","prompt"],"title":"Model"},"ModelActivity":{"properties":{"kind":{"type":"string","enum":["build","rebuild","run"],"title":"Kind","description":"build: first build; rebuild: new implementation from a prompt or script; run: the stored script against new market data (a default run that will go live)"},"status":{"type":"string","enum":["queued","running"],"title":"Status"},"stage":{"type":"string","title":"Stage","description":"Human-readable current stage, e.g. 'Backtesting'"},"stage_id":{"anyOf":[{"type":"string","enum":["n1_security_screening","n1b_universe_resolution","n2_code_generation","n3_code_validation","n4_modal_execution","n5_result_qa"]},{"type":"null"}],"title":"Stage Id","description":"Pipeline stage id; null for a run"},"attempt":{"type":"integer","minimum":1.0,"title":"Attempt","default":1},"max_attempts":{"type":"integer","minimum":1.0,"title":"Max Attempts","default":1},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"stages":{"items":{"$ref":"#/components/schemas/ModelActivityStage"},"type":"array","title":"Stages","description":"Per-stage detail for a build or rebuild; empty for a run"}},"type":"object","required":["kind","status","stage"],"title":"ModelActivity","description":"What is running against the model right now. Null when idle."},"ModelActivityStage":{"properties":{"id":{"type":"string","enum":["n1_security_screening","n1b_universe_resolution","n2_code_generation","n3_code_validation","n4_modal_execution","n5_result_qa"],"title":"Id"},"status":{"type":"string","enum":["pending","running","completed","error"],"title":"Status"},"attempt":{"type":"integer","minimum":1.0,"title":"Attempt","default":1},"duration_seconds":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Duration Seconds"}},"type":"object","required":["id","status"],"title":"ModelActivityStage","description":"One generation stage of a build or rebuild."},"ModelAvailability":{"properties":{"partial":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partial","description":"First computed bar (some members may still be missing)"},"complete":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Complete","description":"First bar on which every universe member has data"},"members":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Members","description":"First bar with data for each universe member, {symbol: date}"},"members_last":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Members Last","description":"Last bar with data for each universe member, {symbol: date}, as the run saw it. A member behind the others lagged the final bar or has ended; the latest target was decided without it."},"backfills":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Backfills","description":"History extensions the run applied, {symbol: source}. Present when a holding's series was extended before its own inception."}},"type":"object","title":"ModelAvailability","description":"Data availability recorded by the run: raw facts, not settings."},"ModelContribution":{"properties":{"available":{"type":"boolean","title":"Available"},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method"},"price_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Basis"},"series":{"additionalProperties":{"items":{"anyOf":[{"type":"number"},{"type":"null"}]},"type":"array"},"type":"object","title":"Series","description":"Daily arithmetic contributions on the shared dates, at direct asset/member level; null means missing evidence"},"omitted_keys":{"items":{"type":"string"},"type":"array","title":"Omitted Keys","description":"Holdings outside the eight largest average absolute weights"},"unavailable_keys":{"items":{"type":"string"},"type":"array","title":"Unavailable Keys","description":"Holdings with missing recorded price evidence"}},"type":"object","required":["available"],"title":"ModelContribution","description":"Frozen, bounded attribution; absent evidence never uses current prices."},"ModelCreateRequest":{"properties":{"prompt":{"anyOf":[{"type":"string","maxLength":25000,"minLength":10},{"type":"null"}],"title":"Prompt","description":"Natural language description of the investment model. A model trades assets, other models, or both; reference your existing models by ID, name, or symbol and they become members. Omit when providing `script`.","example":"Buy and hold SPY"},"script":{"anyOf":[{"type":"string","maxLength":150000},{"type":"null"}],"title":"Script","description":"Your own implementation instead of a prompt. Validated against the same contract as generated code, smoke-run in the sandbox, and stored verbatim. Billed as a build without generation tokens."},"name":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Name","description":"Model name (defaults to a sequential name like MODEL-0001; editable any time via update)","example":"My SPY Strategy"},"symbol":{"anyOf":[{"type":"string","maxLength":12,"pattern":"^[A-Z0-9\\-]+$"},{"type":"null"}],"title":"Symbol","description":"Model symbol (defaults to a sequential code like MDL-0001; editable any time via update)","example":"SPY-BH"},"is_favorite":{"type":"boolean","title":"Is Favorite","description":"Favorite this model in your private library","default":false},"auto_update":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Update","description":"Initial automatic refresh preference. Omission preserves the legacy enabled default. Set false for one-time research; enabling can also enable component models."},"notify_email":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Notify Email","description":"Initial allocation email preference. Omission preserves the legacy enabled default. Set false unless notifications were requested."},"labels":{"items":{"type":"string","maxLength":50,"minLength":1},"type":"array","maxItems":50,"title":"Labels","description":"Private organizational labels, such as Alpaca or Altruist; case-insensitive"},"effort":{"type":"string","enum":["min","mid","max"],"title":"Effort","description":"How hard the generator works. min (default, all plans): a fast single-shot build. mid (Hobby and Business): a stronger model plus a fidelity review of the script against your description. max (Business): additionally inspects results and refines the implementation. Higher effort bills more per token.","default":"min"},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date","description":"Where the default view of the history begins (YYYY-MM-DD). The full history is always computed and `full_history=true` on any history read reveals it; omission lets start_rule choose. The backtest's start date is an execution input, separate from this view window. A date or period named in the prompt is used when this is omitted.","example":"2020-01-01"},"start_rule":{"anyOf":[{"type":"string","enum":["two_members","all_members","first_member"]},{"type":"null"}],"title":"Start Rule","description":"Where the default view begins when no start_date is set. two_members (default): the first day two universe members have data, the earliest a rebalance between them means anything. all_members: the first day every member has data. first_member: the first day any member has data, the full history. Inferred from the prompt when omitted; two_members otherwise."}},"type":"object","title":"ModelCreateRequest","description":"Create a new investment model from a prompt or from your own script."},"ModelCustomBlock":{"properties":{"series":{"additionalProperties":{"items":{},"type":"array"},"type":"object","title":"Series","description":"Per-date diagnostics aligned with `dates`"},"values":{"additionalProperties":true,"type":"object","title":"Values","description":"Scalars, summaries, and other non-daily output"},"truncation":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Truncation","description":"Per-key notes when the size budget forced truncation"}},"type":"object","title":"ModelCustomBlock","description":"Model-recorded diagnostics beyond returns and positions.\n\nKey names are chosen by the model; the two-part shape is fixed. A series\nis aligned 1:1 with the model's `dates`. The whole block is capped at 512KB."},"ModelCustomKeys":{"properties":{"series":{"items":{"type":"string"},"type":"array","title":"Series","description":"Keys under `series`"},"values":{"items":{"type":"string"},"type":"array","title":"Values","description":"Keys under `values`"}},"type":"object","title":"ModelCustomKeys","description":"Names recorded in a model's custom diagnostics, grouped by shape."},"ModelDraftView":{"properties":{"model_id":{"type":"string","title":"Model Id"},"version":{"type":"integer","title":"Version"},"base_revision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Revision Id"},"base_hash":{"type":"string","title":"Base Hash"},"prompt":{"type":"string","title":"Prompt"},"description":{"type":"string","title":"Description","default":""},"inputs":{"additionalProperties":true,"type":"object","title":"Inputs"},"inputs_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Inputs Schema"},"effort":{"type":"string","enum":["min","mid","max"],"title":"Effort","default":"mid"},"latest_revision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Latest Revision Id"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"outdated":{"type":"boolean","title":"Outdated","default":false}},"type":"object","required":["model_id","version","base_hash","prompt","inputs"],"title":"ModelDraftView"},"ModelError":{"properties":{"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"message":{"type":"string","title":"Message"},"code_excerpt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code Excerpt","description":"The lines of generated code around the failure, if any"},"validation":{"anyOf":[{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array"},{"type":"null"}],"title":"Validation","description":"The rejection(s), present when the build failed validation"}},"type":"object","required":["message"],"title":"ModelError","description":"Why the build failed. Present only when `status` is failed."},"ModelFees":{"properties":{"assumptions":{"$ref":"#/components/schemas/FeeAssumptions"},"returns":{"items":{"type":"number"},"type":"array","title":"Returns","description":"Daily net returns; gross is the `returns` block"},"management":{"items":{"type":"number"},"type":"array","title":"Management","description":"Fraction of NAV charged that day"},"financing":{"items":{"type":"number"},"type":"array","title":"Financing"},"trading":{"items":{"type":"number"},"type":"array","title":"Trading"}},"type":"object","required":["assumptions","returns","management","financing","trading"],"title":"ModelFees","description":"Net-of-fee returns and the fee charged each day, aligned with `dates`."},"ModelHistory":{"properties":{"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date","description":"Window start applied (inclusive); the model's default when none was requested"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date","description":"Window end applied (inclusive); null means through the last bar"},"full_history":{"type":"boolean","title":"Full History","description":"True when the model's default view start was bypassed","default":false},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id","description":"The run whose result this is (the live run by default)"},"dates":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Dates","description":"Bar dates shared by the per-day blocks; null when none of them was requested"},"availability":{"anyOf":[{"$ref":"#/components/schemas/ModelAvailability"},{"type":"null"}]},"returns":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"title":"Returns","description":"Daily gross returns"},"allocation_change_indices":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Allocation Change Indices","description":"Indices into `dates` where the allocation differs from the prior day"},"rebalance_indices":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Rebalance Indices","description":"Indices into `dates` on which a target filled, from the rebalance ledger. Null when the ledger does not cover the whole history, so a reader must not infer rebalance days from a drifting allocation."},"rebalance_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rebalance Count","description":"Exact number of filled rebalance dates in this window, from complete ledger coverage or a full-history total. Null when unknown."},"allocation":{"anyOf":[{"items":{"additionalProperties":{"type":"number"},"type":"object"},"type":"array"},{"type":"null"}],"title":"Allocation","description":"One weight dict per day, resolved to tickers plus CASH with member models multiplied through. The current (drifted) allocation series."},"rebalances":{"anyOf":[{"items":{"$ref":"#/components/schemas/RebalanceEntry"},"type":"array"},{"type":"null"}],"title":"Rebalances","description":"The model's rebalance decisions inside the window, oldest first"},"rebalances_truncated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Rebalances Truncated","description":"True when the stored ledger was capped and older decisions are missing"},"tree":{"anyOf":[{"items":{"items":{"$ref":"#/components/schemas/PositionNode"},"type":"array"},"type":"array"},{"type":"null"}],"title":"Tree","description":"One node list per day; member models expanded with their own holdings"},"labels":{"additionalProperties":{"$ref":"#/components/schemas/HoldingLabel"},"type":"object","title":"Labels","description":"Symbol, name, type and depth for every key in `allocation`, `tree` and `rebalances`"},"latest":{"anyOf":[{"$ref":"#/components/schemas/ModelLatest"},{"type":"null"}],"description":"The current book and the latest rebalance decision"},"custom":{"anyOf":[{"$ref":"#/components/schemas/ModelCustomBlock"},{"type":"null"}],"description":"The model's own diagnostics: series sliced to the window, values whole"},"metrics":{"anyOf":[{"$ref":"#/components/schemas/ModelMetrics"},{"type":"null"}]},"fees":{"anyOf":[{"$ref":"#/components/schemas/ModelFees"},{"type":"null"}],"description":"Business: the net-of-fee overlay"},"contribution":{"anyOf":[{"$ref":"#/components/schemas/ModelContribution"},{"type":"null"}]}},"type":"object","title":"ModelHistory","description":"A model's history over one window, in the blocks asked for.\n\n`dates` is shared by every per-day block (`returns`, `allocation`, `tree`,\n`custom.series`, `fees`) and is sent only when one of them is requested;\na `metrics` or `latest` read carries no per-day data. Blocks not\nrequested are null."},"ModelLatest":{"properties":{"as_of":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"As Of","description":"Date of the latest book"},"allocation":{"additionalProperties":{"type":"number"},"type":"object","title":"Allocation","description":"Current allocation, resolved to tickers plus CASH"},"tree":{"items":{"$ref":"#/components/schemas/PositionNode"},"type":"array","title":"Tree"},"target":{"anyOf":[{"$ref":"#/components/schemas/TargetAllocation"},{"type":"null"}]},"previous_target":{"anyOf":[{"$ref":"#/components/schemas/TargetAllocation"},{"type":"null"}],"description":"Previous recorded target, when exact look-through is available"},"unresolved_members":{"items":{"type":"string"},"type":"array","title":"Unresolved Members","description":"Members whose historical allocation was not recorded; underlying-asset exports are unavailable"},"labels":{"additionalProperties":{"$ref":"#/components/schemas/HoldingLabel"},"type":"object","title":"Labels"}},"type":"object","required":["allocation","tree"],"title":"ModelLatest","description":"The most recent book and the latest decision, resolved through members."},"ModelMetadata":{"properties":{"universe":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Universe"},"member_sources":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Member Sources","description":"Resolved member model/run identities and script hashes used by this result, including nested sources."},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"},"initial_cash":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Initial Cash"},"final_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Final Value"},"trades_total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Trades Total"},"rebalance_dates":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rebalance Dates"},"rebalances_per_year":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rebalances Per Year"},"annual_turnover":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Annual Turnover"},"max_gross_exposure":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Gross Exposure"},"harness_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Harness Version"},"backfills":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Backfills"},"optimizers":{"anyOf":[{},{"type":"null"}],"title":"Optimizers"},"trade_log_truncated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Trade Log Truncated"},"target_history_truncated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Target History Truncated"}},"additionalProperties":true,"type":"object","title":"ModelMetadata","description":"Run metadata computed by the runtime. Extra keys are passed through."},"ModelMetrics":{"properties":{"cagr":{"type":"number","title":"Cagr"},"volatility":{"type":"number","title":"Volatility"},"sharpe":{"type":"number","title":"Sharpe","description":"(cagr - risk_free) / volatility"},"max_drawdown":{"type":"number","title":"Max Drawdown"},"trades":{"type":"integer","title":"Trades","description":"Fills in the window: one per symbol per execution, from the engine's trade ledger. A model without a ledger reports its book-change days instead.","default":0},"rebalances":{"type":"integer","title":"Rebalances","description":"Days in the window on which a target filled (distinct execution dates)","default":0},"trading_days":{"type":"integer","title":"Trading Days"},"bars_per_year":{"type":"integer","title":"Bars Per Year","description":"Bars a year the series was annualised at: 252 on an exchange calendar, 365 for a 24/7 market","default":252},"risk_free":{"type":"number","title":"Risk Free","description":"Annual risk-free rate deducted before sharpe","default":0.0}},"type":"object","required":["cagr","volatility","sharpe","max_drawdown","trading_days"],"title":"ModelMetrics","description":"Performance over the window, with the conventions that produced it."},"ModelRebuildRequest":{"properties":{"prompt":{"anyOf":[{"type":"string","maxLength":25000,"minLength":10},{"type":"null"}],"title":"Prompt","description":"New description. Omit to rebuild from the stored prompt. Members may change; a model can never hold one of its own parents.","example":"Buy and hold SPY, rebalanced monthly"},"script":{"anyOf":[{"type":"string","maxLength":150000},{"type":"null"}],"title":"Script","description":"Your own implementation instead of a prompt. Validated against the same contract as generated code, smoke-run in the sandbox, and stored verbatim. Billed as a build without generation tokens."},"name":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Name","description":"Rename the model (defaults to keeping the current name)","example":"My SPY Strategy"},"symbol":{"anyOf":[{"type":"string","maxLength":12,"pattern":"^[A-Z0-9\\-]+$"},{"type":"null"}],"title":"Symbol","description":"Change the model symbol (defaults to keeping the current one)","example":"SPY-BH"},"effort":{"anyOf":[{"type":"string","enum":["min","mid","max"]},{"type":"null"}],"title":"Effort","description":"How hard the generator works. min (default, all plans): a fast single-shot build. mid (Hobby and Business): a stronger model plus a fidelity review of the script against your description. max (Business): additionally inspects results and refines the implementation. Higher effort bills more per token. Defaults to the effort of the previous build when the prompt is omitted, otherwise min."},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date","description":"Where the default view of the history begins (YYYY-MM-DD). The full history is always computed and `full_history=true` on any history read reveals it; omission lets start_rule choose. The backtest's start date is an execution input, separate from this view window. Omitted: a new prompt is read for a date or period, otherwise the stored setting is kept.","example":"2020-01-01"},"start_rule":{"anyOf":[{"type":"string","enum":["two_members","all_members","first_member"]},{"type":"null"}],"title":"Start Rule","description":"Where the default view begins when no start_date is set. two_members (default): the first day two universe members have data, the earliest a rebalance between them means anything. all_members: the first day every member has data. first_member: the first day any member has data, the full history. Omitted: the stored rule is kept."}},"type":"object","title":"ModelRebuildRequest","description":"Regenerate a model's implementation (LLM + sandbox).\n\nWith `prompt`, the model is rewritten to the new description. Without it,\nthe stored prompt is used again: on a failed model the generator is handed\nthe script that failed and the error it died on; on a built model the\nimplementation is simply regenerated (for example at a higher effort).\nThe model keeps its ID and URL, and a built model keeps serving its\ncurrent implementation until the new one succeeds."},"ModelRef":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol"},"depth":{"type":"integer","title":"Depth","description":"That model's own depth (0 = assets only)","default":0}},"type":"object","required":["id"],"title":"ModelRef","description":"A model related to this one: a member it holds, or a parent that holds it."},"ModelRefresh":{"properties":{"state":{"type":"string","enum":["current","disabled","pending","running","waiting","retrying","blocked"],"title":"State"},"requested_session":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Requested Session"},"next_retry":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Retry"},"blockers":{"items":{"$ref":"#/components/schemas/ModelRefreshBlocker"},"type":"array","title":"Blockers"}},"type":"object","required":["state"],"title":"ModelRefresh","description":"Present freshness, independent of the last run's historical outcome."},"ModelRefreshBlocker":{"properties":{"model_id":{"type":"string","title":"Model Id"},"name":{"type":"string","title":"Name"},"reason_code":{"type":"string","title":"Reason Code"},"reason":{"type":"string","title":"Reason"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"}},"type":"object","required":["model_id","name","reason_code","reason"],"title":"ModelRefreshBlocker"},"ModelRevisionView":{"properties":{"id":{"type":"string","title":"Id"},"model_id":{"type":"string","title":"Model Id"},"number":{"type":"integer","title":"Number"},"status":{"type":"string","enum":["queued","running","ready","applied","failed"],"title":"Status"},"base_revision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Revision Id"},"draft_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Draft Version"},"prompt":{"type":"string","title":"Prompt"},"description":{"type":"string","title":"Description","default":""},"inputs":{"additionalProperties":true,"type":"object","title":"Inputs"},"inputs_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Inputs Schema"},"script":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Script"},"script_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Script Hash"},"build_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Build Id"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"data_as_of":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data As Of"},"result_available":{"type":"boolean","title":"Result Available","default":false},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"timing":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Timing"},"usage":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Usage"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"applied_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Applied At"},"can_apply":{"type":"boolean","title":"Can Apply","default":false},"blocked_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Blocked Reason"},"newer_data_available":{"type":"boolean","title":"Newer Data Available","default":false},"estimate_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Estimate Cents"}},"type":"object","required":["id","model_id","number","status","prompt","inputs","created_at"],"title":"ModelRevisionView"},"ModelRunRequest":{"properties":{"inputs":{"additionalProperties":true,"type":"object","title":"Inputs","description":"Values for the declared inputs; see `inputs_schema` on the program. If declared, universe is an ordered JSON array of ticker symbols and/or owned model IDs. Overrides create a snapshot; promote a successful run to change live defaults and dependencies."},"from_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Run Id","description":"Start from this run's inputs (and settings); `inputs` overlay it"},"label":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Label","description":"A short name for the run, shown in lists and comparisons"},"intent":{"anyOf":[{"type":"string","enum":["test","refresh"]},{"type":"null"}],"title":"Intent","description":"test never changes the current model, even at default inputs. refresh uses approved defaults and publishes on success. Omission retains the legacy input-equality behavior."}},"type":"object","title":"ModelRunRequest","description":"Run the stored script. At default inputs the result becomes the live history.\n\n`inputs.start_date` (YYYY-MM-DD, before today) is the platform's input on\nevery model: the engine trades nothing before it while earlier prices\nstill feed lookbacks. Set it for a backtest that starts later than the\ndata allows; such a run is a snapshot, never the live history."},"ModelSchedule":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"notify_email":{"type":"boolean","title":"Notify Email"},"next_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Run At"},"last_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Run At"},"last_outcome":{"anyOf":[{"type":"string","enum":["updated","unchanged","skipped","failed"]},{"type":"null"}],"title":"Last Outcome","description":"updated: new session folded in; unchanged: no new session yet; skipped/failed: the run did not complete; automatic-update preferences are unchanged"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"last_notified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Notified At"}},"type":"object","required":["enabled","notify_email"],"title":"ModelSchedule","description":"Nightly auto-update state. Null until the model has succeeded once."},"ModelStructure":{"properties":{"models":{"type":"integer","title":"Models","description":"Distinct models below this one, at every level","default":0},"assets":{"type":"integer","title":"Assets","description":"Distinct tickers the tree ultimately holds (cash excluded)","default":0}},"type":"object","title":"ModelStructure","description":"What the model's whole tree resolves to."},"ModelSummary":{"properties":{"id":{"type":"string","title":"Id","description":"Model ID (model_... or legacy m-...)"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"May be null if the build failed before naming"},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol","description":"May be null if the build failed before naming"},"status":{"type":"string","enum":["building","active","updating","paused","blocked","failed"],"title":"Status","description":"building: no results yet; active: results served and refreshed nightly; updating: a rebuild or refresh is running (results keep serving); blocked: updates await a failed or unavailable dependency; paused: results served, nightly refresh off; failed: the build never produced a usable model"},"run":{"anyOf":[{"$ref":"#/components/schemas/ModelActivity"},{"type":"null"}],"description":"The build, rebuild, or default run in progress; null when idle"},"warning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Warning","description":"Something went wrong without changing the status: a failed rebuild, a paused auto-update, or overdue data"},"depth":{"type":"integer","title":"Depth","description":"0 when the model holds assets only; otherwise one more than its deepest member","default":0},"structure":{"anyOf":[{"$ref":"#/components/schemas/ModelStructure"},{"type":"null"}],"description":"Distinct models and assets across the whole tree; null until built"},"as_of":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"As Of","description":"Last market session covered by the results"},"auto_update":{"type":"boolean","title":"Auto Update","description":"Whether the nightly refresh is on","default":false},"refresh":{"anyOf":[{"$ref":"#/components/schemas/ModelRefresh"},{"type":"null"}]},"is_public":{"type":"boolean","title":"Is Public"},"is_favorite":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Favorite","description":"Owner's favorite state; null for non-owner readers"},"labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Labels","description":"Owner's private organizational labels; null for non-owner readers"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"Tear sheet URL; set once the model has built"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","status","is_public","created_at","updated_at"],"title":"ModelSummary","description":"A model as it appears in a list."},"ModelUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Name","description":"Update model name"},"symbol":{"anyOf":[{"type":"string","maxLength":12,"pattern":"^[A-Z0-9\\-]+$"},{"type":"null"}],"title":"Symbol","description":"Update model symbol"},"is_public":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Public","description":"Toggle public sharing"},"is_favorite":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Favorite","description":"Favorite (true) or unfavorite (false) this model; omitted or null leaves it unchanged"},"labels":{"anyOf":[{"items":{"type":"string","maxLength":50,"minLength":1},"type":"array","maxItems":50},{"type":"null"}],"title":"Labels","description":"Replace private organizational labels; [] clears them, omitted or null leaves them unchanged"},"auto_update":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Update","description":"Enable (true) automatic updates for this model and all descendants, or disable (false) this model alone. Child executions also use credits. Disabling a child required by an enabled parent returns 409 auto_update_required_by_parents with parent links. Requires a built model."},"notify_email":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Notify Email","description":"Email the owner when a nightly refresh produces a new target allocation. Requires a built model."},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date","description":"Where the default view of the history begins (YYYY-MM-DD). The full history is always computed and `full_history=true` on any history read reveals it; omission lets start_rule choose. The backtest's start date is an execution input, separate from this view window. Moves the default view only; nothing is rerun. Send null to clear.","example":"2020-01-01"},"start_rule":{"anyOf":[{"type":"string","enum":["two_members","all_members","first_member"]},{"type":"null"}],"title":"Start Rule","description":"Where the default view begins when no start_date is set. two_members (default): the first day two universe members have data, the earliest a rebalance between them means anything. all_members: the first day every member has data. first_member: the first day any member has data, the full history. Changing it moves the default view only; no rerun."}},"type":"object","title":"ModelUpdateRequest","description":"Update a model's settings. Every field is optional; omitted fields are untouched.\n\n`start_date` is the one field where an explicit `null` means something:\nit clears the view start and the rule decides again."},"ModelUsage":{"properties":{"units":{"type":"integer","title":"Units"},"base":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Base"},"tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tokens"},"seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seconds"},"effort":{"anyOf":[{"type":"string","enum":["min","mid","max"]},{"type":"null"}],"title":"Effort","description":"The effort the build was billed at"}},"type":"object","required":["units"],"title":"ModelUsage","description":"Billing usage for the most recent generation."},"ModelWindow":{"properties":{"start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start","description":"Default view start (YYYY-MM-DD)"},"end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End","description":"Last computed bar (YYYY-MM-DD)"},"rule":{"type":"string","enum":["two_members","all_members","first_member"],"title":"Rule","description":"Where the default view begins when no start_date is set. two_members (default): the first day two universe members have data, the earliest a rebalance between them means anything. all_members: the first day every member has data. first_member: the first day any member has data, the full history.","default":"two_members"},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date","description":"View start set on the model, or null when the rule decides"},"full_start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Start","description":"First computed bar; equals `start` when nothing is hidden"},"constrained_by":{"items":{"type":"string"},"type":"array","title":"Constrained By","description":"Members whose inception set `start` under the rule; empty for an explicit date"}},"type":"object","title":"ModelWindow","description":"The span of history a model is judged over, and why it starts there.\n\n`start` and `end` bound the default view: every history endpoint applies\nthem when no window is requested. `full_start` is the first computed bar;\nit precedes `start` only when the rule hides a partial-universe period,\nwhich `full_history=true` reveals."},"Optimizer":{"properties":{"id":{"type":"string","title":"Id","description":"Optimizer ID (optimizer_... or legacy o-...)"},"name":{"type":"string","title":"Name","description":"Python class name"},"description":{"type":"string","title":"Description"},"source":{"type":"string","enum":["prompt","script"],"title":"Source"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"script":{"type":"string","title":"Script"},"hash":{"type":"string","title":"Hash"},"used_by":{"items":{"$ref":"#/components/schemas/OptimizerModelRef"},"type":"array","title":"Used By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","description","source","script","hash","created_at","updated_at"],"title":"Optimizer","description":"One stored optimizer class."},"OptimizerCreateRequest":{"properties":{"prompt":{"anyOf":[{"type":"string","maxLength":8000,"minLength":10},{"type":"null"}],"title":"Prompt","description":"The weighting rule in words. The LLM writes the class; metered like a build.","example":"Maximum Sharpe, long-only, 40% cap, 63-day covariance window"},"script":{"anyOf":[{"type":"string","maxLength":20000,"minLength":20},{"type":"null"}],"title":"Script","description":"Exact Python source for one class with `@staticmethod opt(ret_df, syms)`. No LLM."},"name":{"anyOf":[{"type":"string","maxLength":40,"minLength":1},{"type":"null"}],"title":"Name","description":"Class name (CapWords). Must match the class in `script`; a hint for `prompt`.","example":"MaxSharpeOpt"},"effort":{"type":"string","enum":["min","mid","max"],"title":"Effort","description":"How hard the generator works. min (default, all plans): a fast single-shot build. mid (Hobby and Business): a stronger model plus a fidelity review of the script against your description. max (Business): additionally inspects results and refines the implementation. Higher effort bills more per token.","default":"min"}},"type":"object","title":"OptimizerCreateRequest","description":"Author one optimizer: exactly one of `prompt` or `script`."},"OptimizerModelRef":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["id"],"title":"OptimizerModelRef","description":"A stored model whose script names this optimizer."},"OptimizerUpdateRequest":{"properties":{"script":{"anyOf":[{"type":"string","maxLength":20000,"minLength":20},{"type":"null"}],"title":"Script","description":"Replacement class source, re-validated and smoke-tested"},"description":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Description","description":"Replacement one-line description"}},"type":"object","title":"OptimizerUpdateRequest","description":"Replace the class source and/or its one-line description."},"PositionNode":{"properties":{"id":{"type":"string","title":"Id","description":"Member model ID, ticker, or CASH"},"weight":{"type":"number","title":"Weight"},"as_of":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"As Of","description":"Book date the member's allocation was read from (latest view only)"},"children":{"anyOf":[{"items":{"$ref":"#/components/schemas/PositionNode"},"type":"array"},{"type":"null"}],"title":"Children","description":"The member's own allocation; absent for assets and cash"}},"type":"object","required":["id","weight"],"title":"PositionNode","description":"One line in an allocation tree. Weights are fractions of the top-level\nmodel at every depth, so a node's weight equals the sum of its children's."},"PriceCoverage":{"properties":{"source":{"type":"string","title":"Source","description":"history | catalog | unread | empty"},"fetched_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Fetched At","description":"When the stored bars were last written, if bars are on file"},"history_first_price_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"History First Price Date","description":"First stored bar. Null when no bars are on file."},"history_last_price_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"History Last Price Date","description":"Last stored bar. Null when no bars are on file."},"catalog_first_price_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Catalog First Price Date","description":"Catalog seed for the first bar, which can lag or lead the stored bars."},"catalog_last_price_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Catalog Last Price Date","description":"Catalog seed for the last bar, which can lag or lead the stored bars."},"verification":{"type":"string","title":"Verification","description":"How to read source. A seed is not a served edge."}},"type":"object","required":["source","verification"],"title":"PriceCoverage","description":"Seed dates versus the bars actually stored for this symbol."},"Profile":{"properties":{"id":{"type":"string","minLength":1,"pattern":"\\S","title":"Id","description":"Opaque immutable WorkOS user ID; stable across reconnect and display changes"},"name":{"type":"string","title":"Name","description":"Available account display name"},"email":{"type":"string","title":"Email","description":"Available email for display, not identity"}},"additionalProperties":false,"type":"object","required":["id"],"title":"Profile","description":"Minimal credential-scoped identity; unavailable display fields are omitted."},"RebalanceEntry":{"properties":{"decision_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision Date"},"fill_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fill Date","description":"Null while pending"},"status":{"type":"string","enum":["pending","filled"],"title":"Status"},"weights":{"additionalProperties":{"type":"number"},"type":"object","title":"Weights"}},"type":"object","required":["status","weights"],"title":"RebalanceEntry","description":"One rebalance decision from the model's target ledger.\n\n`weights` are what the model asked to hold at this model's own level\n(member model IDs or tickers, before look-through), keyed like `labels`."},"RevisionApplyRequest":{"properties":{"expected_base_revision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Base Revision Id","description":"Approved revision against which the candidate was tested; null only for a model without approved source"}},"type":"object","required":["expected_base_revision_id"],"title":"RevisionApplyRequest"},"RevisionTestRequest":{"properties":{"expected_version":{"type":"integer","minimum":1.0,"title":"Expected Version","description":"The exact saved draft version to test"},"request_key":{"type":"string","maxLength":80,"minLength":1,"title":"Request Key","description":"Unique per Test click; reuse on retries to avoid duplicate execution and charging."}},"type":"object","required":["expected_version","request_key"],"title":"RevisionTestRequest"},"RevisionUpdate":{"properties":{"label":{"type":"string","maxLength":80,"minLength":1,"title":"Label","description":"Stable display name for a completed or failed test; does not change tested content"}},"type":"object","required":["label"],"title":"RevisionUpdate"},"Run":{"properties":{"id":{"type":"string","title":"Id","description":"Run ID (run_... or legacy mr-/r-...). Read kind for the program type."},"kind":{"type":"string","const":"model","title":"Kind"},"program":{"$ref":"#/components/schemas/RunProgramRef"},"status":{"type":"string","enum":["queued","running","complete","failed"],"title":"Status"},"source":{"type":"string","enum":["build","manual","scheduled","cascade","promote"],"title":"Source","description":"build: the build's smoke run; manual: requested; scheduled: the nightly; cascade: a member changed; promote: after a promote"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"inputs":{"additionalProperties":true,"type":"object","title":"Inputs"},"is_default":{"type":"boolean","title":"Is Default","description":"Inputs equal the script's declared defaults"},"intent":{"anyOf":[{"type":"string","enum":["test","refresh"]},{"type":"null"}],"title":"Intent"},"result_available":{"type":"boolean","title":"Result Available","description":"Whether the full result is retained and readable","default":false},"revision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revision Id"},"result_context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result Context","description":"Execution-time strategy, input schema, display window and data provenance. Unknown legacy values are omitted, never borrowed from the current model."},"is_public":{"type":"boolean","title":"Is Public","default":false},"live":{"type":"boolean","title":"Live","description":"This run's result is what the program serves","default":false},"data_as_of":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data As Of"},"script_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Script Hash","description":"SHA-256 of the script that ran; resolves to a build via getBuild"},"summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Summary","description":"Headline figures, kept even when the full result is pruned"},"usage":{"anyOf":[{"$ref":"#/components/schemas/RunUsage"},{"type":"null"}]},"estimate_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Estimate Cents","description":"On the response that queued this run: what it holds against the balance, in cents, until `usage` replaces it. Null on other reads."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result","description":"With include=result: the model backtest history, including dates, returns, positions, targets and metadata."},"owner":{"anyOf":[{"$ref":"#/components/schemas/RunOwner"},{"type":"null"}],"description":"The owner's branding (single run read)"},"is_owner":{"type":"boolean","title":"Is Owner","description":"True when the caller owns this run","default":false}},"type":"object","required":["id","kind","program","status","source","inputs","is_default","created_at"],"title":"Run","description":"One model execution."},"RunComparison":{"properties":{"kind":{"type":"string","const":"model","title":"Kind"},"runs":{"items":{"$ref":"#/components/schemas/Run"},"type":"array","title":"Runs"},"inputs_diff":{"items":{"$ref":"#/components/schemas/InputsDiffRow"},"type":"array","title":"Inputs Diff","description":"Inputs that differ across the runs"},"metrics":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Metrics","description":"run_id -> model performance metrics over each stored run history"},"period":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Period","description":"Inclusive common start and end dates used for every compared metric"},"dates":{"items":{"type":"string"},"type":"array","title":"Dates","description":"Common trading dates shared by the compared return series"},"returns":{"additionalProperties":{"items":{"type":"number"},"type":"array"},"type":"object","title":"Returns","description":"run_id -> returns on the common dates"},"unavailable_run_ids":{"items":{"type":"string"},"type":"array","title":"Unavailable Run Ids"},"no_overlap":{"type":"boolean","title":"No Overlap","default":false}},"type":"object","required":["kind","runs"],"title":"RunComparison","description":"Several runs of one kind side by side."},"RunOwner":{"properties":{"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url","description":"Business branding, when the owner set a logo"}},"type":"object","title":"RunOwner"},"RunProgramRef":{"properties":{"kind":{"type":"string","const":"model","title":"Kind"},"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"},"inputs_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Inputs Schema","description":"The program's declared inputs with defaults (on a single run read)"}},"type":"object","required":["kind","id"],"title":"RunProgramRef","description":"The program a run belongs to."},"RunUpdateRequest":{"properties":{"label":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Label","description":"A short name for the run, shown in lists and comparisons"},"is_public":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Public","description":"Share this run at /run/{run_id}"}},"type":"object","title":"RunUpdateRequest"},"RunUsage":{"properties":{"units":{"type":"integer","title":"Units"},"base":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Base"},"seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seconds"}},"type":"object","required":["units"],"title":"RunUsage"},"Runtime":{"properties":{"kind":{"type":"string","const":"models","title":"Kind"},"version":{"type":"string","title":"Version","description":"Harness version; changes when the interface changes"},"contract":{"$ref":"#/components/schemas/RuntimeContract"},"interface":{"type":"string","title":"Interface","description":"The harness's public interface as a Python stub: every signature and docstring, plus the INPUTS spec grammar"},"rules":{"items":{"$ref":"#/components/schemas/RuntimeRule"},"type":"array","title":"Rules","description":"What validation rejects, one statement each"},"skeleton":{"type":"string","title":"Skeleton","description":"A minimal script that satisfies the contract"}},"type":"object","required":["kind","version","contract","interface","rules","skeleton"],"title":"Runtime","description":"The contract a supplied script is validated against."},"RuntimeContract":{"properties":{"constants":{"items":{"type":"string"},"type":"array","title":"Constants","description":"Module-level constants the script must declare"},"entry_point":{"type":"string","title":"Entry Point","description":"The function the sandbox calls, with its parameters"},"builders":{"items":{"type":"string"},"type":"array","title":"Builders","description":"Harness functions the entry point must return the output of"},"import_path":{"type":"string","title":"Import Path","description":"The harness module the script imports from"},"imports":{"items":{"type":"string"},"type":"array","title":"Imports","description":"Every name the script may import from the harness"},"reserved_inputs":{"items":{"type":"string"},"type":"array","title":"Reserved Inputs","description":"Input keys the platform supplies on every run; never declare them"},"limits":{"$ref":"#/components/schemas/RuntimeLimits"}},"type":"object","required":["constants","entry_point","builders","import_path","imports","reserved_inputs","limits"],"title":"RuntimeContract"},"RuntimeLimits":{"properties":{"inputs":{"type":"integer","title":"Inputs","description":"Maximum number of INPUTS entries"},"script_chars":{"type":"integer","title":"Script Chars","description":"Maximum script length in characters"}},"type":"object","required":["inputs","script_chars"],"title":"RuntimeLimits"},"RuntimeRule":{"properties":{"type":{"type":"string","title":"Type","description":"The rule's name, the same word a validation rejection carries"},"statement":{"type":"string","title":"Statement","description":"What the rule requires"}},"type":"object","required":["type","statement"],"title":"RuntimeRule"},"TagDimension":{"properties":{"dimension":{"type":"string","title":"Dimension"},"label":{"type":"string","title":"Label"},"question":{"type":"string","title":"Question","description":"What the dimension classifies"},"applies_to":{"items":{"type":"string"},"type":"array","title":"Applies To","description":"Asset classes it describes; empty means every class"},"max_tags":{"type":"integer","title":"Max Tags","description":"How many of its tags one asset may carry"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"The exact strings `tags` and `tags_all` accept"},"notes":{"items":{"type":"string"},"type":"array","title":"Notes"}},"type":"object","required":["dimension","label","question","max_tags","tags"],"title":"TagDimension","description":"One axis of the closed tag vocabulary."},"TargetAllocation":{"properties":{"decision_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision Date"},"fill_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fill Date","description":"Null while pending"},"status":{"type":"string","enum":["pending","filled"],"title":"Status"},"allocation":{"additionalProperties":{"type":"number"},"type":"object","title":"Allocation","description":"Resolved to tickers plus CASH"},"tree":{"items":{"$ref":"#/components/schemas/PositionNode"},"type":"array","title":"Tree"}},"type":"object","required":["status","allocation","tree"],"title":"TargetAllocation","description":"The model's latest rebalance decision, what a follower should hold.\n\nDistinct from the daily book, which is what the backtest held after price\ndrift. `pending` means the decision was made on the last bar and fills at\nthe next session's close. Members contribute their own latest decisions."},"TaxEvidence":{"properties":{"status":{"type":"string","title":"Status","description":"classified | unverified | unclassified"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Classifier source. Required, with as_of, before status is classified."},"as_of":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"As Of","description":"As-of date of the classification evidence. Null when unclassified."},"verification":{"type":"string","title":"Verification","description":"Why this status was assigned. Unclassified is not 1099."}},"type":"object","required":["status","verification"],"title":"TaxEvidence","description":"Provenance for tax_form and legal_structure. Null columns are unclassified."},"TrashedModel":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol"},"deleted_at":{"type":"string","format":"date-time","title":"Deleted At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At","description":"Recovery deadline; content is permanently purged after 30 days"}},"type":"object","required":["id","name","symbol","deleted_at","expires_at"],"title":"TrashedModel"},"ValidateRequest":{"properties":{"script":{"type":"string","maxLength":150000,"title":"Script","description":"Your implementation. Checked statically against the contract (`GET /runtime/{kind}`) exactly as a build would check it, but never run and never stored"}},"type":"object","required":["script"],"title":"ValidateRequest","description":"A script to check against the contract."},"Validation":{"properties":{"valid":{"type":"boolean","title":"Valid","description":"True when a build with this script would pass validation"},"errors":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Errors","description":"Why not, in the order a build would report them; empty when valid"},"inputs_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Inputs Schema","description":"The JSON Schema derived from INPUTS, when valid"},"sources":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Sources","description":"The tickers and model ids the script declares, when valid"},"version":{"type":"string","title":"Version","description":"Harness version the script was checked against"}},"type":"object","required":["valid","errors","version"],"title":"Validation","description":"What a build would say about the script before running it."},"ValidationError":{"properties":{"type":{"type":"string","title":"Type","description":"Which rule rejected it: syntax, forbidden, price_source, nondeterministic, constants, entry_point, imports, inputs, members, universe, sources, metadata or other"},"message":{"type":"string","title":"Message","description":"The rejection, written to teach the fix"},"line":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Line","description":"The line named by the message, if any"}},"type":"object","required":["type","message"],"title":"ValidationError","description":"One reason a script was rejected before it ran."},"Webhook":{"properties":{"id":{"type":"string","title":"Id","description":"Webhook ID (webhook_... or legacy UUID). Use the returned ID verbatim."},"url":{"type":"string","title":"Url","description":"Receiver URL"},"secret":{"type":"string","title":"Secret","description":"HMAC signing secret. Verify a delivery by computing HMAC-SHA256(secret, '{t}.{raw_body}') and comparing it to the v1 value in the X-Ensemble-Signature header ('t=<ts>,v1=<hex>')."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"enabled":{"type":"boolean","title":"Enabled","description":"Whether deliveries are active"},"last_delivery_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Delivery At","description":"Most recent delivery attempt"},"last_delivery_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Delivery Status","description":"HTTP status or error label of the most recent delivery"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","url","secret","enabled","created_at"],"title":"Webhook"},"WebhookCreateRequest":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url","description":"HTTPS URL that receives signed POST deliveries"},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Description","description":"A label"}},"type":"object","required":["url"],"title":"WebhookCreateRequest"},"BackfillPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Backfill"},"type":"array","title":"Data"},"total":{"type":"integer","minimum":0.0,"title":"Total","description":"Rows matching the filters, across every page"}},"type":"object","required":["data","total"],"title":"BackfillPage"},"BillingChargePage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/BillingCharge"},"type":"array","title":"Data"},"total":{"type":"integer","minimum":0.0,"title":"Total","description":"Rows matching the filters, across every page"}},"type":"object","required":["data","total"],"title":"BillingChargePage"},"BuildSummaryPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/BuildSummary"},"type":"array","title":"Data"},"total":{"type":"integer","minimum":0.0,"title":"Total","description":"Rows matching the filters, across every page"}},"type":"object","required":["data","total"],"title":"BuildSummaryPage"},"FeedbackReportPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/FeedbackReport"},"type":"array","title":"Data"},"total":{"type":"integer","minimum":0.0,"title":"Total","description":"Rows matching the filters, across every page"}},"type":"object","required":["data","total"],"title":"FeedbackReportPage"},"ModelRevisionViewPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ModelRevisionView"},"type":"array","title":"Data"},"total":{"type":"integer","minimum":0.0,"title":"Total","description":"Rows matching the filters, across every page"}},"type":"object","required":["data","total"],"title":"ModelRevisionViewPage"},"ModelSummaryPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ModelSummary"},"type":"array","title":"Data"},"total":{"type":"integer","minimum":0.0,"title":"Total","description":"Rows matching the filters, across every page"}},"type":"object","required":["data","total"],"title":"ModelSummaryPage"},"OptimizerPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Optimizer"},"type":"array","title":"Data"},"total":{"type":"integer","minimum":0.0,"title":"Total","description":"Rows matching the filters, across every page"}},"type":"object","required":["data","total"],"title":"OptimizerPage"},"RunPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Run"},"type":"array","title":"Data"},"total":{"type":"integer","minimum":0.0,"title":"Total","description":"Rows matching the filters, across every page"}},"type":"object","required":["data","total"],"title":"RunPage"},"TrashedModelPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/TrashedModel"},"type":"array","title":"Data"},"total":{"type":"integer","minimum":0.0,"title":"Total","description":"Rows matching the filters, across every page"}},"type":"object","required":["data","total"],"title":"TrashedModelPage"},"WebhookPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Webhook"},"type":"array","title":"Data"},"total":{"type":"integer","minimum":0.0,"title":"Total","description":"Rows matching the filters, across every page"}},"type":"object","required":["data","total"],"title":"WebhookPage"}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"`Authorization: Bearer <token>`, where the token is an API key (`ensemble_...`, from the dashboard under Developer) or an AuthKit access token."}}},"security":[{"bearer":[]}]}