{
  "openapi": "3.1.0",
  "info": {
    "title": "SML Fractal",
    "version": "2.12.0",
    "description": "ScriptMasterLabs agent-native market modeling service. Live market-data routes (/api/quotes, /api/basket, /api/options/{symbol}, /api/fractal/{symbol}, /api/history/{symbol}) are x402 v2 paid per call on five settleable routes (Base USDC via OMNIGATE, Arc USDC via OMNIGATE, Solana USDC via the 402Proof sidecar, XRP via 402Proof, Xahau XAH via the 402Proof sidecar; routes named at /.well-known/x402). Free delayed sample: /api/quotes?symbols=GME,AMC,IWM (<=15 min, last/changePct only). /api/fractal/{symbol} is paid on every symbol. Per-IP rate limits apply. Fractal outputs are research signals, not advice. Discovery: /.well-known/x402."
  },
  "servers": [
    {
      "url": "https://sml-fractal-trading-os-v2.onrender.com"
    }
  ],
  "tags": [
    {
      "name": "system"
    },
    {
      "name": "market-data"
    },
    {
      "name": "fractal"
    },
    {
      "name": "options"
    },
    {
      "name": "strategy"
    },
    {
      "name": "ecosystem"
    },
    {
      "name": "cycle-pulse"
    },
    {
      "name": "oos-evidence",
      "description": "Free frozen-prediction aggregate, five-day verification and matched always-bullish benchmark"
    },
    {
      "name": "forecast-court",
      "description": "Verified frozen claims, live competitive evidence and outcome receipts; no trading/stakes"
    },
    {
      "name": "asset-focus",
      "description": "Seven-asset completed daily measurements, no new OOS forecasts"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Service health",
        "responses": {
          "200": {
            "description": "Service is healthy"
          }
        }
      }
    },
    "/api/status": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Provider and runtime status",
        "responses": {
          "200": {
            "description": "Current runtime/provider status"
          }
        }
      }
    },
    "/api/quotes": {
      "get": {
        "tags": [
          "market-data"
        ],
        "summary": "Fetch live quotes from configured real-data providers",
        "parameters": [
          {
            "name": "symbols",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated US equity symbols"
          }
        ],
        "responses": {
          "200": {
            "description": "Quote data returned"
          },
          "402": {
            "description": "Payment required (x402 v2). PAYMENT-REQUIRED header carries terms."
          },
          "429": {
            "description": "Per-IP rate limit"
          },
          "503": {
            "description": "No quote provider succeeded; response remains truthful and does not fabricate data"
          }
        },
        "x-payment-info": {
          "protocol": "x402",
          "version": 2,
          "price": {
            "amount": "0.01",
            "currency": "USDC"
          },
          "network": "eip155:8453",
          "networks": [
            "eip155:8453",
            "eip155:5042",
            "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
            "xrpl:0",
            "xrpl:21337"
          ],
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x5bbd32e0478e49a7540ef2d760e0b0f9aa6328b2"
        }
      }
    },
    "/api/history/{symbol}": {
      "get": {
        "tags": [
          "market-data"
        ],
        "summary": "Fetch historical bars",
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "multiplier",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 60
            }
          },
          {
            "name": "timespan",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "hour",
                "minute"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Historical bars with source attribution"
          },
          "402": {
            "description": "Payment required (x402 v2). PAYMENT-REQUIRED header carries terms."
          },
          "429": {
            "description": "Per-IP rate limit"
          }
        },
        "x-payment-info": {
          "protocol": "x402",
          "version": 2,
          "price": {
            "amount": "0.02",
            "currency": "USDC"
          },
          "network": "eip155:8453",
          "networks": [
            "eip155:8453",
            "eip155:5042",
            "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
            "xrpl:0",
            "xrpl:21337"
          ],
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x5bbd32e0478e49a7540ef2d760e0b0f9aa6328b2"
        }
      }
    },
    "/api/options/{symbol}": {
      "get": {
        "tags": [
          "options"
        ],
        "summary": "Scan an options chain using configured real market data",
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "call",
                "put"
              ]
            }
          },
          {
            "name": "minDte",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "maxDte",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 90
            }
          },
          {
            "name": "maxSpreadPct",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Options telemetry and filtered contracts"
          },
          "402": {
            "description": "Payment required (x402 v2). PAYMENT-REQUIRED header carries terms."
          },
          "429": {
            "description": "Per-IP rate limit"
          }
        },
        "x-payment-info": {
          "protocol": "x402",
          "version": 2,
          "price": {
            "amount": "0.05",
            "currency": "USDC"
          },
          "network": "eip155:8453",
          "networks": [
            "eip155:8453",
            "eip155:5042",
            "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
            "xrpl:0",
            "xrpl:21337"
          ],
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x5bbd32e0478e49a7540ef2d760e0b0f9aa6328b2"
        }
      }
    },
    "/api/fractal/{symbol}": {
      "get": {
        "tags": [
          "fractal"
        ],
        "summary": "Run multi-scale historical fractal matching",
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "horizon",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "top",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fractal match evidence, source provenance, and forward-path modeling"
          },
          "402": {
            "description": "Payment required (x402 v2). PAYMENT-REQUIRED header carries terms."
          },
          "429": {
            "description": "Per-IP rate limit"
          }
        },
        "x-payment-info": {
          "protocol": "x402",
          "version": 2,
          "price": {
            "amount": "0.02",
            "currency": "USDC"
          },
          "network": "eip155:8453",
          "networks": [
            "eip155:8453",
            "eip155:5042",
            "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
            "xrpl:0",
            "xrpl:21337"
          ],
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x5bbd32e0478e49a7540ef2d760e0b0f9aa6328b2"
        }
      }
    },
    "/api/basket": {
      "get": {
        "tags": [
          "fractal"
        ],
        "summary": "Compute current basket context",
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Basket context"
          },
          "402": {
            "description": "Payment required (x402 v2). PAYMENT-REQUIRED header carries terms."
          },
          "429": {
            "description": "Per-IP rate limit"
          }
        },
        "x-payment-info": {
          "protocol": "x402",
          "version": 2,
          "price": {
            "amount": "0.01",
            "currency": "USDC"
          },
          "network": "eip155:8453",
          "networks": [
            "eip155:8453",
            "eip155:5042",
            "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
            "xrpl:0",
            "xrpl:21337"
          ],
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x5bbd32e0478e49a7540ef2d760e0b0f9aa6328b2"
        }
      }
    },
    "/api/strategy/evaluate": {
      "post": {
        "tags": [
          "strategy"
        ],
        "summary": "Evaluate a strategy candidate without silently placing a trade",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Strategy evaluation"
          },
          "401": {
            "description": "Owner key required"
          }
        },
        "description": "Owner key required (X-Owner-Key)."
      }
    },
    "/api/sml/catalog": {
      "get": {
        "tags": [
          "ecosystem"
        ],
        "summary": "Discover related ScriptMasterLabs capabilities",
        "responses": {
          "200": {
            "description": "Dynamic ScriptMasterLabs ecosystem catalog and trading-relevant capability links"
          }
        }
      }
    },
    "/api/cycle-pulse/status": {
      "get": {
        "tags": [
          "cycle-pulse"
        ],
        "summary": "Check Cycle Pulse projection, scanner, provider, and access readiness",
        "responses": {
          "200": {
            "description": "Cycle Pulse readiness, personal/private access mode, app route, 62-bar projection horizon, and scanner limit"
          }
        }
      }
    },
    "/api/cycle-pulse/snapshot": {
      "get": {
        "tags": [
          "cycle-pulse"
        ],
        "summary": "Fetch real daily OHLCV and a current quote for any Cycle Pulse symbol",
        "security": [],
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "AMC",
              "pattern": "^[A-Z][A-Z0-9.-]{0,9}$"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tradier-attributed daily OHLCV, current quote, rate-limit evidence, and cache state"
          },
          "400": {
            "description": "Invalid symbol or date range; no charge and no fabricated substitute"
          },
          "401": {
            "description": "Returned only when personal mode is disabled and the private key is missing or invalid"
          },
          "429": {
            "description": "Personal request window or provider-call budget is cooling down"
          },
          "503": {
            "description": "Real-data provider unavailable or not configured; truthful alternatives returned"
          }
        }
      }
    },
    "/api/cycle-pulse/scan": {
      "get": {
        "tags": [
          "cycle-pulse"
        ],
        "summary": "Rank an editable symbol universe for bullish and bearish daily breakouts",
        "security": [],
        "parameters": [
          {
            "name": "symbols",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "AMC,GME,IWM,SPY,QQQ"
            },
            "description": "Comma-separated unique symbols; maximum 18"
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked breakout candidates with direction, score, state, trigger, distance, volume ratio, ATR, compression, and per-symbol failures"
          },
          "400": {
            "description": "Invalid universe or date range"
          },
          "401": {
            "description": "Returned only when personal mode is disabled and the private key is missing or invalid"
          },
          "429": {
            "description": "Personal request window or provider-call budget is cooling down"
          },
          "503": {
            "description": "Real-data provider unavailable; no fabricated scan results returned"
          }
        }
      }
    },
    "/api/oos/decision": {
      "get": {
        "tags": [
          "oos-evidence"
        ],
        "operationId": "getFractalOosDecision",
        "summary": "Read verified GME forecast track record and same-window baseline",
        "description": "Returns aggregate counts, bullish/bearish historical directional hit rates, the matched always-bullish baseline, risk flags and guarded next-action label. Neither the endpoint nor its confidence bounds establish tradable profit. No private forecast snapshots, trades or learned weights exposed.",
        "responses": {
          "200": {
            "description": "Verified live aggregate and descriptive matched-baseline evaluation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "schema_version",
                    "state",
                    "action",
                    "evidence",
                    "live_trading_authorized"
                  ],
                  "properties": {
                    "schema_version": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "action": {
                      "type": "string"
                    },
                    "live_trading_authorized": {
                      "type": "boolean",
                      "const": false
                    },
                    "evidence": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Ledger unavailable or aggregate not ready; do not infer performance"
          }
        }
      }
    },
    "/api/forecast-court/status": {
      "get": {
        "tags": [
          "forecast-court"
        ],
        "summary": "Court evidence ledger and claims/access readiness",
        "responses": {
          "200": {
            "description": "Court status"
          },
          "503": {
            "description": "Ledger unavailable"
          }
        }
      }
    },
    "/api/forecast-court/leaderboard": {
      "get": {
        "tags": [
          "forecast-court"
        ],
        "summary": "Independent live model-versus-baseline Arena leaderboard",
        "responses": {
          "200": {
            "description": "Verified frozen forecast scorecard and Court competitors"
          },
          "503": {
            "description": "Evidence unavailable; no stale-data substitution"
          }
        }
      }
    },
    "/api/forecast-court/receipts/{claim_id}": {
      "get": {
        "tags": [
          "forecast-court"
        ],
        "summary": "Public tamper-checked immutable forecast and outcome receipt",
        "parameters": [
          {
            "name": "claim_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Frozen snapshot SHA256, real five-session evidence when resolved"
          },
          "404": {
            "description": "Unknown claim"
          },
          "503": {
            "description": "Integrity check failure"
          }
        }
      }
    },
    "/api/forecast-court/claims": {
      "post": {
        "tags": [
          "forecast-court"
        ],
        "summary": "Owner-authenticated publication of new five-session market claim",
        "security": [
          {
            "courtOwnerKey": []
          }
        ],
        "description": "Requires public:true consent and is accepted only after market close when server-side Tradier completed daily bar is current. No users can self-register or gain authenticated access until a separate credential onboarding is deployed.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "public",
                  "symbol",
                  "strategy_key",
                  "strategy_label",
                  "side"
                ],
                "properties": {
                  "public": {
                    "type": "boolean",
                    "const": true
                  },
                  "symbol": {
                    "type": "string",
                    "example": "GME"
                  },
                  "strategy_key": {
                    "type": "string",
                    "example": "community-research-1"
                  },
                  "strategy_label": {
                    "type": "string"
                  },
                  "side": {
                    "type": "string",
                    "enum": [
                      "up",
                      "down"
                    ]
                  },
                  "horizon_sessions": {
                    "type": "integer",
                    "const": 5
                  },
                  "expected_return_5d": {
                    "type": "number"
                  },
                  "client_reference": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Immutable accepted claim and SHA256 checksum"
          },
          "400": {
            "description": "Invalid claim/consent"
          },
          "403": {
            "description": "Owner credential required"
          },
          "409": {
            "description": "Market closed/not confirmed or duplicate reference"
          },
          "503": {
            "description": "Real data unavailable; claim not frozen"
          }
        }
      }
    },
    "/api/forecast-court/resolve": {
      "post": {
        "tags": [
          "forecast-court"
        ],
        "security": [
          {
            "courtOwnerKey": []
          }
        ],
        "summary": "Owner-triggered resolution of previously frozen mature claims using real future Tradier bars",
        "responses": {
          "200": {
            "description": "Batch result"
          },
          "403": {
            "description": "Owner credential required"
          },
          "503": {
            "description": "Provider/storage unavailable"
          }
        }
      }
    },
    "/api/forecast-court/jev-jury": {
      "get": {
        "summary": "Verified TypeSafe Jev five-juror research assessment and Ed25519 receipt",
        "description": "Returns genuine provider-sourced and signed five-juror output, explicit pending status, or fail-closed 503; never invents jury votes. TypeSafe AI provides Jev, not an endorsement of SML.",
        "tags": [
          "forecast-court"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "symbol",
            "schema": {
              "type": "string",
              "enum": [
                "GME",
                "AMC",
                "IWM",
                "SPY",
                "QQQ",
                "NVDA",
                "TSLA"
              ],
              "default": "GME"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Jury pending or independently signature-verified"
          },
          "503": {
            "description": "Proof unavailable"
          }
        }
      }
    },
    "/api/fractal-focus/{symbol}": {
      "get": {
        "tags": [
          "asset-focus"
        ],
        "operationId": "getFractalTickerFocus",
        "summary": "Completed daily asset research for the seven mobile ticker tabs",
        "description": "Public capped/cached EOD metrics only; no live quotes, intraday candles, paid provider research, independently verified OOS forecasts, orders or brokerage actions. GME primary OOS engine remains separate.",
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "GME",
                "AMC",
                "SPY",
                "IWM",
                "VIX",
                "BTC",
                "ETH"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Actual completed daily price observations, or explicitly stale observations"
          },
          "404": {
            "description": "Unknown ticker, with SML alternatives"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "Source unavailable; no fabricated results, charge:false"
          }
        }
      }
    }
  },
  "x-sml-ecosystem": {
    "mcp": "https://mcp-x402.onrender.com/mcp",
    "squeezeos": "https://squeezeos-api.onrender.com",
    "catalog": "https://acp-402.scriptmasterlabs.com/",
    "canonicalPayment": {
      "standard": "x402 v2",
      "routes": [
        {
          "network": "eip155:8453",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x5BBd32e0478e49A7540EF2D760E0B0F9AA6328b2",
          "facilitator": "https://mcp-x402.onrender.com"
        },
        {
          "network": "eip155:5042",
          "asset": "0x3600000000000000000000000000000000000000",
          "payTo": "0x6756fC9A7abf9043bC4DdBB91121E12CEf1b108d",
          "facilitator": "https://mcp-x402.onrender.com"
        },
        {
          "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
          "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
          "payTo": "Hv4cEGpyyNJDvxvgBb3C8GkcwtouF1qUfPT13innuXty",
          "facilitator": "https://four02proof-x402-v2-xrpl.onrender.com"
        },
        {
          "network": "xrpl:0",
          "asset": "XRP",
          "payTo": "rEmdJWrAWFtud1vFN8Zm8eWkgK4AVMWPiX",
          "facilitator": "https://four02proof.onrender.com"
        },
        {
          "network": "xrpl:21337",
          "asset": "XAH",
          "payTo": "rEmdJWrAWFtud1vFN8Zm8eWkgK4AVMWPiX",
          "facilitator": "https://four02proof-x402-v2-xrpl.onrender.com"
        }
      ]
    },
    "routingPolicy": "Truth first. No silent substitution or silent paid fallback. Recommend relevant SML alternatives when a capability is unavailable."
  },
  "components": {
    "securitySchemes": {
      "MicroDeskKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Micro-Desk-Key",
        "description": "Existing private SML Micro-Desk access key. Never exposed by the browser bundle."
      },
      "courtOwnerKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-court-key",
        "description": "SML operator key only; never publish in a browser or repository"
      }
    }
  },
  "externalDocs": {
    "description": "Installable Cycle & Harmonic Pulse research PWA",
    "url": "https://sml-fractal-trading-os-v2.onrender.com/cycle-pulse/"
  },
  "x-sml-cross-service-paid-offer": {
    "product": "Forecast Court Baseline Consistency Receipt",
    "network": "eip155:8453",
    "asset": "USDC",
    "price_usdc": "0.01",
    "method": "GET",
    "url": "https://squeezeos-api.onrender.com/api/forecast-court/verified-audit?symbol=GME&strategy=sml-fractal",
    "info": "https://squeezeos-api.onrender.com/api/forecast-court/verify-info",
    "http_402_verified": true,
    "actual_payment_delivery_verified": false,
    "minimum_real_resolved_outcomes": 20,
    "free_preflight": "https://squeezeos-api.onrender.com/api/forecast-court/preflight?symbol=GME&strategy=sml-fractal",
    "preflight_verified": true
  }
}
