Developers menu

LAB: LAB API

LAB from a script, with a lab key: the same conveyor the terminal drives, spending the same credits. Developing an idea is free; a backtest or an optimize pass is one credit, refunded on failure.

This product serves

Plan: LAB. LAB credits: developing an idea is free, a backtest or an optimize pass is one credit, the desk is free once an idea is tested. LIVE includes 5 credits a month. Pricing.

The conveyor. An idea walks one road in order: chat (free) compiles plain words into a rule; POST /api/lab/run with kind: "backtest" (1 credit) moves it from rule to tested; kind: "quant" (1 credit) from tested to ready; POST /api/lab/idea with action: "desk" (free) parks it. A step out of order is refused.

One idea at a time. A run on a second idea while one is mid-test answers 409 with the holder; desk or drop the first.

The verdict. interesting is true only when the rule clears costs out of sample, beats its core-only baseline there, and does it by more than its own error bar (net_rr_t of 2 or more, the error clustered by session). The optimize returns every variant, never a picked winner, with the overfitting it cost (pbo, dsr).

import os, requests

H = {"Authorization": f"Bearer {os.environ['FIRMTAPE_LAB_KEY']}"}
BASE = "https://firmtape.com"

r = requests.post(f"{BASE}/api/lab/chat", headers=H, json={"message": "fade a +3 sigma stretch above vwap on top-decile volume; 15 minute horizon"}).json()
if r["kind"] != "spec":
    raise SystemExit(r["say"])          # LAB asked a question
idea = r["idea"]["id"]
bt = requests.post(f"{BASE}/api/lab/run", headers=H, json={"id": idea, "kind": "backtest"}).json()
qo = requests.post(f"{BASE}/api/lab/run", headers=H, json={"id": idea, "kind": "quant"}).json()
requests.post(f"{BASE}/api/lab/idea", headers=H, json={"id": idea, "action": "desk"})

Endpoints

More

  • LAB over MCP: The MCP server's lab_ tools and options_strategy_test drive the same conveyor from an assistant, with a lab key or after signing in through OAuth.

Limits

WhatLimitNotes
LAB APICredits: a backtest or an optimize pass is 1 credit, an OPTIONS archive run 10Developing an idea is free but needs a positive balance. One idea holds the conveyor at a time. A failed job refunds its credit.

Measurements of dealer positioning, never a forecast or a trade call. This page is built from FirmTape's public contract, the same files the OpenAPI document is built from; the tests hold them against the route code. Markdown: /docs/developers/lab.md.