{
  "openapi": "3.1.0",
  "info": {
    "title": "FlashAlpha Historical API",
    "version": "1.0.0",
    "summary": "Point-in-time replay of FlashAlpha's core analytics endpoints. Identical response shapes to the live API with a required at= parameter. Alpha tier.",
    "description": "Point-in-time replay across 52 routes. This spec documents the core analytics subset (exposure GEX/DEX/VEX/CHEX, levels, summary, narrative, 0DTE, max pain, volatility, VRP, surface, stock/option quotes, stock summary). The full options flow suite also replays - raw options and stock trade tape (per-minute signed volume), flow analytics, and the intraday OI simulator at /v1/flow/* - documented at https://flashalpha.com/articles/historical-options-flow-replay-trade-tape-oi-simulator; only earnings, screener and structures are live-only. Coverage: 204 symbols, 54 with 8+ years of minute-level history, the deepest (SPY, QQQ, MSFT, NVDA, TSLA and others) from 2017-01-03 at 1-minute resolution (80+ billion option rows); per-symbol first dates vary (SPXW 2018-05-16, META 2021-07-13, SPX 2022-01-05), so query GET /v1/tickers rather than assuming. Other symbols backfill on demand (~48h). All endpoints require Alpha-tier API key; historical requests share the live daily quota bucket.\n\n**Note on response shapes:** most historical responses match the live API shape exactly so the same SDK code works against both with a base-URL swap. Response shapes match live for the same analytic (`OptionQuoteResponse` array, `MaxPainResponse` keyed `max_pain_by_expiration`, `StockSummaryResponse` macro objects `{value, change, change_pct}`); historical adds `archive_as_of`. One naming quirk: `exposure.hedging_estimate.dealer_shares` in the stock summary is `dealer_shares_to_trade` on the standalone `/v1/exposure/summary` endpoint. Treat the schemas in this file as authoritative for historical.\n\n**About the `examples` blocks:** operations with examples reference a real captured response under `https://flashalpha.com/docs/samples/historical-*.json`, fetched live from `historical.flashalpha.com` and frozen at `at=2024-08-05T10:30:00` (the August 2024 carry-unwind / VIX spike). They are NOT illustrative or fabricated - every numeric value is what the API actually returned for that timestamp. Treat them as authoritative for the SHAPE of a response and as a reproducible point fixture for tests, but obviously not as predictions of current market state.\n\nFor the live API spec, see https://flashalpha.com/docs/api.md.\n\nFull human-readable spec: https://flashalpha.com/docs/historical.md.\n\nTrader-context and research-pack additions are documented with x-release-status=requires-historical-api-release. Their local production-data validation does not establish deployed availability; original publication/OI revisions are not fully verified. Research packs are retrospective strategy-family model simulations.",
    "contact": {
      "name": "FlashAlpha",
      "url": "https://flashalpha.com",
      "email": "hello@flashalpha.com"
    },
    "license": {
      "name": "FlashAlpha Terms of Service",
      "url": "https://flashalpha.com/terms"
    }
  },
  "servers": [
    {
      "url": "https://historical.flashalpha.com",
      "description": "Historical (point-in-time replay). Alpha tier. Pair with live host https://lab.flashalpha.com for real-time."
    }
  ],
  "externalDocs": {
    "description": "Historical API documentation (Markdown spec)",
    "url": "https://flashalpha.com/docs/historical.md"
  },
  "tags": [
    {
      "name": "Coverage",
      "description": "Symbol inventory and date-range coverage."
    },
    {
      "name": "Exposure",
      "description": "Historical dealer-positioning analytics: GEX, DEX, VEX, CHEX, levels, summary, narrative, 0DTE."
    },
    {
      "name": "Max Pain",
      "description": "Historical max pain, pain curve, dealer alignment, pin probability."
    },
    {
      "name": "Volatility",
      "description": "Historical realized vol, IV term structure, skew, IV-RV spreads, VRP, IV surface."
    },
    {
      "name": "Market Data",
      "description": "Historical stock and option quotes with greeks."
    },
    {
      "name": "Stock Summary",
      "description": "Composite point-in-time snapshot: price, IV, exposure, macro."
    },
    {
      "name": "Historical research and trader context",
      "description": "Alpha/Enterprise additions requiring the corresponding Historical API release."
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Alpha-tier API key. Same key works against both lab.flashalpha.com (live) and historical.flashalpha.com (replay)."
      },
      "ApiKeyQuery": {
        "type": "apiKey",
        "in": "query",
        "name": "apiKey",
        "description": "Alternate transport: API key as query parameter. Header is preferred."
      }
    },
    "parameters": {
      "PathSymbol": {
        "name": "symbol",
        "in": "path",
        "required": true,
        "description": "Underlying ticker (e.g. SPY, QQQ, SPX, AAPL).",
        "schema": {
          "type": "string",
          "example": "SPY"
        }
      },
      "PathTicker": {
        "name": "ticker",
        "in": "path",
        "required": true,
        "description": "Underlying ticker.",
        "schema": {
          "type": "string",
          "example": "SPY"
        }
      },
      "QueryAt": {
        "name": "at",
        "in": "query",
        "required": true,
        "description": "Point-in-time timestamp. Naive `YYYY-MM-DDTHH:mm:ss` uses Eastern wall time; an explicit UTC offset or Z is converted to Eastern. Date-only `YYYY-MM-DD` defaults to 16:00 ET, except exposure routes which use 15:55 ET to retain same-day Greeks. Use the same explicit timestamp to compare routes and specify a session time on early-close days. Bounded by per-symbol coverage.",
        "schema": {
          "type": "string",
          "examples": [
            "2024-08-05T10:30:00",
            "2020-03-16T15:30:00",
            "2024-08-05"
          ]
        }
      },
      "QueryExposureAt": {
        "name": "at",
        "in": "query",
        "required": true,
        "description": "Exposure replay timestamp. Date-only `YYYY-MM-DD` anchors at 15:55 ET to retain same-day Greeks. Naive timestamps use Eastern wall time; an explicit UTC offset or Z is converted to Eastern. Explicit timestamps are preserved; use a time before the actual close on early-close days.",
        "schema": {
          "type": "string",
          "examples": [
            "2026-10-12",
            "2026-10-12T15:55:00",
            "2026-10-12T19:55:00Z"
          ]
        }
      },
      "QueryExpiration": {
        "name": "expiration",
        "in": "query",
        "required": false,
        "description": "Filter to a single option expiration (`YYYY-MM-DD`). Omit for full chain. Used by /v1/exposure/gex,dex,vex,chex,levels and /v1/maxpain.",
        "schema": {
          "type": "string",
          "format": "date"
        }
      },
      "QueryExpiry": {
        "name": "expiry",
        "in": "query",
        "required": false,
        "description": "Filter the option chain to a single expiration (`YYYY-MM-DD`). Used by /v1/optionquote (note: the spelling is `expiry`, not `expiration`, on this endpoint - this matches the SDK's `option_quote(..., expiry=...)` argument).",
        "schema": {
          "type": "string",
          "format": "date"
        }
      },
      "QueryMinOi": {
        "name": "min_oi",
        "in": "query",
        "required": false,
        "description": "Minimum open interest threshold per strike.",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        }
      },
      "QueryStrike": {
        "name": "strike",
        "in": "query",
        "required": false,
        "description": "Filter to a specific strike price.",
        "schema": {
          "type": "number"
        }
      },
      "QueryOptionType": {
        "name": "type",
        "in": "query",
        "required": false,
        "description": "Filter to call or put.",
        "schema": {
          "type": "string",
          "enum": [
            "C",
            "P"
          ]
        }
      },
      "QueryResearchAt": {
        "name": "at",
        "in": "query",
        "required": false,
        "description": "Optional historical availability cutoff. Publication, definition and data cutoffs must all be no later than it. Date-only requests anchor at 16:00 ET; naive timestamps use Eastern wall time, and an explicit offset or Z is converted to Eastern. Omit only for explicit retrospective discovery.",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing or invalid API key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "TierRestricted": {
        "description": "API key valid but tier below Alpha. Historical replay requires Alpha plan.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Daily request quota exceeded (shared with live host).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "OutOfRange": {
        "description": "`at` parameter outside coverage window for symbol, or symbol not backfilled.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "example": "tier_restricted"
          },
          "message": {
            "type": "string",
            "example": "Historical replay requires Alpha plan."
          }
        }
      },
      "Coverage": {
        "type": "object",
        "description": "Coverage inventory for one or more symbols. See sample: /docs/samples/historical-coverage.json.",
        "properties": {
          "count": {
            "type": "integer"
          },
          "tickers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "symbol": {
                  "type": "string"
                },
                "coverage": {
                  "type": "object",
                  "properties": {
                    "first": {
                      "type": "string",
                      "format": "date"
                    },
                    "last": {
                      "type": "string",
                      "format": "date"
                    },
                    "total_days": {
                      "type": "integer"
                    },
                    "healthy_days": {
                      "type": "integer"
                    }
                  }
                },
                "tables": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer"
                  }
                },
                "gaps": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer"
                  }
                },
                "updated_at": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "GexResponse": {
        "type": "object",
        "description": "Historical gamma exposure by strike. Real capture (frozen at at=2024-08-05T10:30:00): /docs/samples/historical-gex.json.",
        "properties": {
          "symbol": {
            "type": "string"
          },
          "underlying_price": {
            "type": "number"
          },
          "as_of": {
            "type": "string",
            "description": "Resolved at-timestamp (ET wall-clock)."
          },
          "as_of_requested": {
            "type": "string",
            "description": "Echo of the at parameter exactly as supplied (only present on historical responses)."
          },
          "gamma_flip": {
            "type": "number"
          },
          "net_gex": {
            "type": "number"
          },
          "net_gex_label": {
            "type": "string",
            "enum": [
              "positive",
              "negative"
            ]
          },
          "strikes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "strike": {
                  "type": "number"
                },
                "call_gex": {
                  "type": "number"
                },
                "put_gex": {
                  "type": "number"
                },
                "net_gex": {
                  "type": "number"
                },
                "call_oi": {
                  "type": "integer"
                },
                "put_oi": {
                  "type": "integer"
                },
                "call_volume": {
                  "type": "integer"
                },
                "put_volume": {
                  "type": "integer"
                },
                "call_oi_change": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Day-over-day OI change. Null on historical (T-1 OI not always backfilled)."
                },
                "put_oi_change": {
                  "type": [
                    "integer",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "VrpResponse": {
        "type": "object",
        "description": "Historical VRP dashboard with leak-free percentile/z-score. Note: percentile, z_score, and vrp_regime can be null when the at-timestamp falls inside the percentile lookback window (history_days=0). strategy_scores and net_harvest_score are also nullable depending on regime. Real capture (frozen at at=2024-08-05T10:30:00): /docs/samples/historical-vrp.json.",
        "properties": {
          "symbol": {
            "type": "string"
          },
          "underlying_price": {
            "type": "number"
          },
          "as_of": {
            "type": "string"
          },
          "market_open": {
            "type": "boolean"
          },
          "vrp": {
            "type": "object",
            "properties": {
              "atm_iv": {
                "type": "number"
              },
              "rv_5d": {
                "type": "number"
              },
              "rv_10d": {
                "type": "number"
              },
              "rv_20d": {
                "type": "number"
              },
              "rv_30d": {
                "type": "number"
              },
              "vrp_5d": {
                "type": "number"
              },
              "vrp_10d": {
                "type": "number"
              },
              "vrp_20d": {
                "type": "number"
              },
              "vrp_30d": {
                "type": "number"
              },
              "z_score": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Null when history_days==0 (insufficient prior data)."
              },
              "percentile": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "history_days": {
                "type": "integer"
              }
            }
          },
          "variance_risk_premium": {
            "type": "number"
          },
          "convexity_premium": {
            "type": "number"
          },
          "fair_vol": {
            "type": "number"
          },
          "directional": {
            "type": "object",
            "properties": {
              "put_wing_iv_25d": {
                "type": "number"
              },
              "call_wing_iv_25d": {
                "type": "number"
              },
              "downside_rv_20d": {
                "type": "number"
              },
              "upside_rv_20d": {
                "type": "number"
              },
              "downside_vrp": {
                "type": "number"
              },
              "upside_vrp": {
                "type": "number"
              }
            }
          },
          "term_vrp": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "dte": {
                  "type": "integer"
                },
                "iv": {
                  "type": "number"
                },
                "rv": {
                  "type": "number"
                },
                "vrp": {
                  "type": "number"
                }
              }
            }
          },
          "gex_conditioned": {
            "type": "object"
          },
          "vanna_conditioned": {
            "type": "object"
          },
          "regime": {
            "type": "object",
            "properties": {
              "gamma": {
                "type": "string"
              },
              "vrp_regime": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "net_gex": {
                "type": "number"
              },
              "gamma_flip": {
                "type": "number"
              }
            }
          },
          "strategy_scores": {
            "type": [
              "object",
              "null"
            ]
          },
          "net_harvest_score": {
            "type": [
              "number",
              "null"
            ]
          },
          "dealer_flow_risk": {
            "type": "number"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "macro": {
            "type": "object",
            "description": "VRP-endpoint macro block uses scalar values (different from stock-summary macro which wraps each in {value,change,change_pct}).",
            "properties": {
              "vix": {
                "type": "number"
              },
              "vix_3m": {
                "type": "number"
              },
              "vix_term_slope": {
                "type": "number"
              },
              "dgs10": {
                "type": "number"
              },
              "hy_spread": {
                "type": "number"
              }
            }
          }
        }
      },
      "MaxPainResponse": {
        "type": "object",
        "description": "Historical max pain with pain curve, OI distribution, dealer alignment, expected move, pin probability. Real capture (frozen at at=2024-08-05T10:30:00): /docs/samples/historical-max-pain.json.",
        "properties": {
          "symbol": {
            "type": "string"
          },
          "underlying_price": {
            "type": "number"
          },
          "as_of": {
            "type": "string"
          },
          "max_pain_strike": {
            "type": "number"
          },
          "distance": {
            "type": "object",
            "properties": {
              "absolute": {
                "type": "number"
              },
              "percent": {
                "type": "number"
              },
              "direction": {
                "type": "string",
                "enum": [
                  "above",
                  "below"
                ]
              }
            }
          },
          "signal": {
            "type": "string",
            "enum": [
              "neutral",
              "bullish",
              "bearish"
            ],
            "description": "Position of spot relative to the max-pain strike (NOT a directional trade recommendation). bullish = spot above max-pain, bearish = below, neutral = within ~0.5% of max-pain."
          },
          "expiration": {
            "type": "string",
            "format": "date"
          },
          "put_call_oi_ratio": {
            "type": "number"
          },
          "pain_curve": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "strike": {
                  "type": "number"
                },
                "call_pain": {
                  "type": "number"
                },
                "put_pain": {
                  "type": "number"
                },
                "total_pain": {
                  "type": "number"
                }
              }
            }
          },
          "oi_by_strike": {
            "type": "array",
            "description": "Per-strike OI distribution at the at-timestamp.",
            "items": {
              "type": "object",
              "properties": {
                "strike": {
                  "type": "number"
                },
                "call_oi": {
                  "type": "integer"
                },
                "put_oi": {
                  "type": "integer"
                },
                "total_oi": {
                  "type": "integer"
                }
              }
            }
          },
          "max_pain_by_expiration": {
            "type": "array",
            "description": "Max-pain strike per expiry, keyed `max_pain_by_expiration` as on the live endpoint.",
            "items": {
              "type": "object",
              "properties": {
                "expiration": {
                  "type": "string",
                  "format": "date"
                },
                "max_pain_strike": {
                  "type": "number"
                },
                "dte": {
                  "type": "integer"
                },
                "total_oi": {
                  "type": "integer"
                }
              }
            }
          },
          "dealer_alignment": {
            "type": "object",
            "properties": {
              "alignment": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "gamma_flip": {
                "type": "number"
              },
              "call_wall": {
                "type": "number"
              },
              "put_wall": {
                "type": "number"
              }
            }
          },
          "regime": {
            "type": "string"
          },
          "expected_move": {
            "type": "object"
          },
          "pin_probability": {
            "type": "number"
          }
        }
      },
      "ExposureSummaryResponse": {
        "type": "object",
        "description": "Historical full-Greek exposure summary with regime + dealer hedging. Real capture (frozen at at=2024-08-05T10:30:00): /docs/samples/historical-exposure-summary.json. Note: this endpoint's hedging_estimate uses field name `dealer_shares_to_trade` (the embedded `exposure.hedging_estimate` inside stock-summary uses `dealer_shares` - different field name for the same concept).",
        "properties": {
          "symbol": {
            "type": "string"
          },
          "underlying_price": {
            "type": "number"
          },
          "as_of": {
            "type": "string"
          },
          "gamma_flip": {
            "type": "number"
          },
          "regime": {
            "type": "string"
          },
          "exposures": {
            "type": "object",
            "properties": {
              "net_gex": {
                "type": "number"
              },
              "net_dex": {
                "type": "number"
              },
              "net_vex": {
                "type": "number"
              },
              "net_chex": {
                "type": "number"
              }
            }
          },
          "interpretation": {
            "type": "object",
            "properties": {
              "gamma": {
                "type": "string"
              },
              "vanna": {
                "type": "string"
              },
              "charm": {
                "type": "string"
              }
            }
          },
          "hedging_estimate": {
            "type": "object",
            "properties": {
              "spot_down_1pct": {
                "type": "object",
                "properties": {
                  "dealer_shares_to_trade": {
                    "type": "integer"
                  },
                  "direction": {
                    "type": "string",
                    "enum": [
                      "buy",
                      "sell"
                    ]
                  },
                  "notional_usd": {
                    "type": "integer"
                  }
                }
              },
              "spot_up_1pct": {
                "type": "object",
                "properties": {
                  "dealer_shares_to_trade": {
                    "type": "integer"
                  },
                  "direction": {
                    "type": "string",
                    "enum": [
                      "buy",
                      "sell"
                    ]
                  },
                  "notional_usd": {
                    "type": "integer"
                  }
                }
              }
            }
          },
          "zero_dte": {
            "type": "object",
            "properties": {
              "net_gex": {
                "type": "number"
              },
              "pct_of_total_gex": {
                "type": "number"
              },
              "expiration": {
                "type": "string",
                "format": "date"
              }
            }
          }
        }
      },
      "OptionQuoteResponse": {
        "type": "array",
        "description": "Historical option chain. Returns an array of contracts with the same fields as the live endpoint: `implied_vol`, `iv_bid`/`iv_ask`, `open_interest`, `bidSize`/`askSize`, `delta`/`gamma`/`theta`/`vega`, `vanna`/`charm`/`rho`, `svi_vol`/`svi_vol_gated`, `volume`. In replay, `volume` is 0 on this route and `svi_vol` is null; per-print volume is served on the trade tape routes and SVI parameters on /v1/adv_volatility. Real capture (frozen at at=2024-08-05T10:30:00): /docs/samples/historical-optionquote.json.",
        "items": {
          "type": "object",
          "properties": {
            "root": {
              "type": "string",
              "description": "Underlying root symbol"
            },
            "type": {
              "type": "string",
              "enum": [
                "C",
                "P"
              ]
            },
            "expiry": {
              "type": "string",
              "format": "date"
            },
            "strike": {
              "type": "number"
            },
            "bid": {
              "type": "number"
            },
            "ask": {
              "type": "number"
            },
            "mid": {
              "type": "number"
            },
            "bidSize": {
              "type": "integer"
            },
            "askSize": {
              "type": "integer"
            },
            "lastUpdate": {
              "type": "string"
            },
            "implied_vol": {
              "type": "number",
              "description": "Mid-IV (not the live endpoint's iv field)."
            },
            "iv_bid": {
              "type": [
                "number",
                "null"
              ]
            },
            "iv_ask": {
              "type": [
                "number",
                "null"
              ]
            },
            "delta": {
              "type": "number"
            },
            "gamma": {
              "type": "number"
            },
            "theta": {
              "type": "number"
            },
            "vega": {
              "type": "number"
            },
            "rho": {
              "type": "number"
            },
            "vanna": {
              "type": "number"
            },
            "charm": {
              "type": "number"
            },
            "svi_vol": {
              "type": [
                "number",
                "null"
              ],
              "description": "SVI-smoothed IV. Null when svi_vol_gated indicates the value is not exposed (see svi_vol_gated)."
            },
            "svi_vol_gated": {
              "type": [
                "string",
                "null"
              ],
              "description": "Reason svi_vol is null when applicable, e.g. `backtest_mode`."
            },
            "open_interest": {
              "type": "integer"
            },
            "volume": {
              "type": "integer"
            }
          }
        }
      },
      "StockSummaryResponse": {
        "type": "object",
        "description": "Historical composite snapshot: price, IV term structure + skew, options flow, exposure (including a nested hedging_estimate using `dealer_shares` - different from the standalone exposure-summary endpoint which uses `dealer_shares_to_trade`), top strikes, macro. Macro entries are nested objects {value, change, change_pct} (different from VRP-endpoint macro which is flat scalars). Real capture (frozen at at=2024-08-05T10:30:00): /docs/samples/historical-stock-summary.json.",
        "properties": {
          "symbol": {
            "type": "string"
          },
          "as_of": {
            "type": "string"
          },
          "market_open": {
            "type": "boolean"
          },
          "price": {
            "type": "object",
            "properties": {
              "bid": {
                "type": "number"
              },
              "ask": {
                "type": "number"
              },
              "mid": {
                "type": "number"
              },
              "last": {
                "type": "number"
              },
              "last_update": {
                "type": "string"
              }
            }
          },
          "volatility": {
            "type": "object",
            "properties": {
              "atm_iv": {
                "type": "number"
              },
              "hv_20": {
                "type": "number"
              },
              "hv_60": {
                "type": "number"
              },
              "vrp": {
                "type": "number"
              },
              "skew_25d": {
                "type": "object",
                "properties": {
                  "expiry": {
                    "type": "string",
                    "format": "date"
                  },
                  "days_to_expiry": {
                    "type": "integer"
                  },
                  "put_25d_iv": {
                    "type": "number"
                  },
                  "atm_iv": {
                    "type": "number"
                  },
                  "call_25d_iv": {
                    "type": "number"
                  },
                  "skew_25d": {
                    "type": "number"
                  },
                  "smile_ratio": {
                    "type": "number"
                  }
                }
              },
              "iv_term_structure": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "expiry": {
                      "type": "string",
                      "format": "date"
                    },
                    "iv": {
                      "type": "number"
                    },
                    "days_to_expiry": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "options_flow": {
            "type": "object",
            "properties": {
              "total_call_oi": {
                "type": "integer"
              },
              "total_put_oi": {
                "type": "integer"
              },
              "total_call_volume": {
                "type": "integer"
              },
              "total_put_volume": {
                "type": "integer"
              },
              "pc_ratio_oi": {
                "type": "number"
              },
              "pc_ratio_volume": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "active_expirations": {
                "type": "integer"
              }
            }
          },
          "exposure": {
            "type": "object",
            "properties": {
              "net_gex": {
                "type": "number"
              },
              "net_dex": {
                "type": "number"
              },
              "net_vex": {
                "type": "number"
              },
              "net_chex": {
                "type": "number"
              },
              "gamma_flip": {
                "type": "number"
              },
              "call_wall": {
                "type": "number"
              },
              "put_wall": {
                "type": "number"
              },
              "max_pain": {
                "type": "number"
              },
              "highest_oi_strike": {
                "type": "number"
              },
              "regime": {
                "type": "string"
              },
              "interpretation": {
                "type": "object"
              },
              "hedging_estimate": {
                "type": "object",
                "description": "Stock-summary exposure block uses `dealer_shares` (the standalone /v1/exposure/summary uses `dealer_shares_to_trade`).",
                "properties": {
                  "spot_down_1pct": {
                    "type": "object",
                    "properties": {
                      "dealer_shares": {
                        "type": "integer"
                      },
                      "direction": {
                        "type": "string",
                        "enum": [
                          "buy",
                          "sell"
                        ]
                      },
                      "notional_usd": {
                        "type": "integer"
                      }
                    }
                  },
                  "spot_up_1pct": {
                    "type": "object",
                    "properties": {
                      "dealer_shares": {
                        "type": "integer"
                      },
                      "direction": {
                        "type": "string",
                        "enum": [
                          "buy",
                          "sell"
                        ]
                      },
                      "notional_usd": {
                        "type": "integer"
                      }
                    }
                  }
                }
              },
              "zero_dte": {
                "type": "object",
                "properties": {
                  "net_gex": {
                    "type": "number"
                  },
                  "pct_of_total": {
                    "type": "number"
                  },
                  "expiration": {
                    "type": "string",
                    "format": "date"
                  }
                }
              },
              "top_strikes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "strike": {
                      "type": "number"
                    },
                    "net_gex": {
                      "type": "number"
                    },
                    "call_oi": {
                      "type": "integer"
                    },
                    "put_oi": {
                      "type": "integer"
                    },
                    "total_oi": {
                      "type": "integer"
                    }
                  }
                }
              },
              "oi_weighted_dte": {
                "type": "number"
              }
            }
          },
          "macro": {
            "type": "object",
            "description": "Each scalar series is wrapped in a {value, change, change_pct} object. vix_term_structure has its own structure ({levels: {...}, near_slope_pct, structure}). vix_futures and fear_and_greed may be null.",
            "properties": {
              "vix": {
                "$ref": "#/components/schemas/MacroSeries"
              },
              "vvix": {
                "$ref": "#/components/schemas/MacroSeries"
              },
              "skew": {
                "$ref": "#/components/schemas/MacroSeries"
              },
              "spx": {
                "$ref": "#/components/schemas/MacroSeries"
              },
              "move": {
                "$ref": "#/components/schemas/MacroSeries"
              },
              "vix_term_structure": {
                "type": "object",
                "properties": {
                  "levels": {
                    "type": "object",
                    "properties": {
                      "vix9d": {
                        "type": "number"
                      },
                      "vix": {
                        "type": "number"
                      },
                      "vix3m": {
                        "type": "number"
                      },
                      "vix6m": {
                        "type": "number"
                      }
                    }
                  },
                  "near_slope_pct": {
                    "type": "number"
                  },
                  "structure": {
                    "type": "string",
                    "enum": [
                      "contango",
                      "backwardation"
                    ]
                  }
                }
              },
              "vix_futures": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "fear_and_greed": {
                "type": [
                  "object",
                  "null"
                ]
              }
            }
          }
        }
      },
      "MacroSeries": {
        "type": "object",
        "properties": {
          "value": {
            "type": "number"
          },
          "change": {
            "type": "number"
          },
          "change_pct": {
            "type": "number"
          }
        }
      }
    }
  },
  "security": [
    {
      "ApiKeyHeader": []
    },
    {
      "ApiKeyQuery": []
    }
  ],
  "paths": {
    "/v1/tickers": {
      "get": {
        "tags": [
          "Coverage"
        ],
        "summary": "Coverage inventory: which symbols are backfilled and through what date.",
        "description": "Returns the symbol-by-symbol coverage map. No `at` parameter. Use this to discover whether a symbol/date is in scope before issuing replay calls.",
        "operationId": "getHistoricalCoverage",
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "required": false,
            "description": "Filter to a single ticker; returns the single object instead of the list. 404 `no_coverage` if the symbol has never been backfilled.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Coverage inventory.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Coverage"
                },
                "examples": {
                  "coverage": {
                    "summary": "Coverage inventory at the most recent backfill point",
                    "externalValue": "https://flashalpha.com/docs/samples/historical-coverage.json"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          }
        }
      }
    },
    "/v1/exposure/gex/{symbol}": {
      "get": {
        "tags": [
          "Exposure"
        ],
        "summary": "Historical gamma exposure by strike at a specific point in time.",
        "description": "Same response shape as live `/v1/exposure/gex/{symbol}`. Returns per-strike call/put gamma exposure, OI, volume, gamma flip, and net GEX as they stood at `at`.",
        "operationId": "getHistoricalGex",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          },
          {
            "$ref": "#/components/parameters/QueryExpiration"
          },
          {
            "$ref": "#/components/parameters/QueryMinOi"
          }
        ],
        "responses": {
          "200": {
            "description": "Historical GEX response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GexResponse"
                },
                "examples": {
                  "spy-2024-08-05": {
                    "summary": "SPY GEX at 2024-08-05T10:30:00 ET (carry-unwind / vol spike)",
                    "externalValue": "https://flashalpha.com/docs/samples/historical-gex.json"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          },
          "404": {
            "$ref": "#/components/responses/OutOfRange"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/exposure/dex/{symbol}": {
      "get": {
        "tags": [
          "Exposure"
        ],
        "summary": "Historical delta exposure by strike.",
        "operationId": "getHistoricalDex",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          },
          {
            "$ref": "#/components/parameters/QueryExpiration"
          },
          {
            "$ref": "#/components/parameters/QueryMinOi"
          }
        ],
        "responses": {
          "200": {
            "description": "Historical DEX response (same shape as live DEX)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          }
        }
      }
    },
    "/v1/exposure/vex/{symbol}": {
      "get": {
        "tags": [
          "Exposure"
        ],
        "summary": "Historical vanna exposure by strike.",
        "operationId": "getHistoricalVex",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          },
          {
            "$ref": "#/components/parameters/QueryExpiration"
          },
          {
            "$ref": "#/components/parameters/QueryMinOi"
          }
        ],
        "responses": {
          "200": {
            "description": "Historical VEX response (same shape as live VEX)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          }
        }
      }
    },
    "/v1/exposure/chex/{symbol}": {
      "get": {
        "tags": [
          "Exposure"
        ],
        "summary": "Historical charm exposure by strike.",
        "operationId": "getHistoricalChex",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          },
          {
            "$ref": "#/components/parameters/QueryExpiration"
          },
          {
            "$ref": "#/components/parameters/QueryMinOi"
          }
        ],
        "responses": {
          "200": {
            "description": "Historical CHEX response (same shape as live CHEX)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          }
        }
      }
    },
    "/v1/exposure/levels/{symbol}": {
      "get": {
        "tags": [
          "Exposure"
        ],
        "summary": "Historical key levels: gamma flip, call wall, put wall, highest-OI strike, 0DTE magnet.",
        "operationId": "getHistoricalLevels",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          }
        ],
        "responses": {
          "200": {
            "description": "Historical levels response (same shape as live levels)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          }
        }
      }
    },
    "/v1/exposure/summary/{symbol}": {
      "get": {
        "tags": [
          "Exposure"
        ],
        "summary": "Historical full exposure summary with regime + dealer hedging.",
        "operationId": "getHistoricalExposureSummary",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          }
        ],
        "responses": {
          "200": {
            "description": "Historical exposure summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExposureSummaryResponse"
                },
                "examples": {
                  "spy-2024-08-05": {
                    "summary": "SPY exposure summary at 2024-08-05T10:30:00 ET",
                    "externalValue": "https://flashalpha.com/docs/samples/historical-exposure-summary.json"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          }
        }
      }
    },
    "/v1/exposure/narrative/{symbol}": {
      "get": {
        "tags": [
          "Exposure"
        ],
        "summary": "Historical verbal narrative analysis (LLM-generated against the at-time exposure state).",
        "operationId": "getHistoricalNarrative",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          }
        ],
        "responses": {
          "200": {
            "description": "Historical narrative response (same shape as live narrative)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          }
        }
      }
    },
    "/v1/exposure/zero-dte/{symbol}": {
      "get": {
        "tags": [
          "Exposure"
        ],
        "summary": "Historical 0DTE analytics: pin risk, expected move, gamma acceleration at the at-minute.",
        "operationId": "getHistoricalZeroDte",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          }
        ],
        "responses": {
          "200": {
            "description": "Historical 0DTE response (same shape as live zero-dte)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          }
        }
      }
    },
    "/v1/maxpain/{symbol}": {
      "get": {
        "tags": [
          "Max Pain"
        ],
        "summary": "Historical max pain with pain curve, dealer alignment, pin probability.",
        "operationId": "getHistoricalMaxPain",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          },
          {
            "$ref": "#/components/parameters/QueryExpiration"
          }
        ],
        "responses": {
          "200": {
            "description": "Historical max pain response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MaxPainResponse"
                },
                "examples": {
                  "spy-2024-08-05": {
                    "summary": "SPY max pain at 2024-08-05T10:30:00 ET",
                    "externalValue": "https://flashalpha.com/docs/samples/historical-max-pain.json"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          }
        }
      }
    },
    "/v1/volatility/{symbol}": {
      "get": {
        "tags": [
          "Volatility"
        ],
        "summary": "Historical realized vol, IV term structure, skew, IV-RV spreads.",
        "operationId": "getHistoricalVolatility",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          }
        ],
        "responses": {
          "200": {
            "description": "Historical volatility response (same shape as live volatility)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          }
        }
      }
    },
    "/v1/vrp/{symbol}": {
      "get": {
        "tags": [
          "Volatility"
        ],
        "summary": "Historical VRP dashboard with leak-free percentile and z-score.",
        "description": "Returns variance-risk-premium analytics with leak-free percentile and z-score (date-bounded in SQL - backtest at time t only sees data strictly before t).",
        "operationId": "getHistoricalVrp",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          }
        ],
        "responses": {
          "200": {
            "description": "Historical VRP response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VrpResponse"
                },
                "examples": {
                  "spy-2024-08-05": {
                    "summary": "SPY VRP at 2024-08-05T10:30:00 ET",
                    "externalValue": "https://flashalpha.com/docs/samples/historical-vrp.json"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          }
        }
      }
    },
    "/v1/surface/{symbol}": {
      "get": {
        "tags": [
          "Volatility"
        ],
        "summary": "Historical implied volatility surface grid (50x50, SVI-smoothed).",
        "operationId": "getHistoricalSurface",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          }
        ],
        "responses": {
          "200": {
            "description": "Historical IV surface response (same shape as live surface)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          }
        }
      }
    },
    "/v1/adv_volatility/{symbol}": {
      "get": {
        "tags": [
          "Volatility"
        ],
        "summary": "Historical advanced volatility: per-expiry SVI parameters, forward prices, total variance surface, butterfly/calendar arbitrage flags, variance swap fair values, and greeks surfaces (vanna/charm/volga/speed).",
        "description": "Same response shape as live `/v1/adv_volatility/{symbol}`. Note: SVI fits are stamped end-of-day in the pipeline, so intraday `at=` returns the most recent EOD SVI parameters, not a fresh intraday calibration. Call `at=YYYY-MM-DD` to get the EOD snapshot for a specific date.",
        "operationId": "getHistoricalAdvVolatility",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          }
        ],
        "responses": {
          "200": {
            "description": "Historical advanced-volatility response. Top-level keys: symbol, underlying_price, as_of, market_open, svi_parameters[] (one entry per expiry), forward_prices, total_variance_surface, arbitrage_flags, variance_swap_fair_values, greeks_surfaces."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          }
        }
      }
    },
    "/v1/volatility/forecast/{symbol}": {
      "get": {
        "tags": [
          "Volatility"
        ],
        "summary": "Historical volatility forecasts: EWMA, HAR-RV, GARCH(1,1) and the realized-variance models as of the last completed session.",
        "description": "Same response shape as live `/v1/volatility/forecast/{symbol}`, except that `realized_models.computed_at` is omitted. Forecasts use data through the close of the last session completed at `at`, with no look-ahead. Call it once per session to build a forecast series.",
        "operationId": "getHistoricalVolatilityForecast",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          },
          {
            "name": "dist",
            "in": "query",
            "required": false,
            "description": "GARCH innovation distribution.",
            "schema": {
              "type": "string",
              "enum": [
                "student_t",
                "gaussian"
              ],
              "default": "student_t"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Historical volatility forecasts. Top-level keys: symbol, as_of, ewma, har_rv, garch, realized_models (as_of_session, observations, iv30, target, models[])."
          },
          "400": {
            "description": "`invalid_at` or `invalid_symbol`."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          },
          "404": {
            "description": "`insufficient_history`: fewer than 30 archived sessions before that date."
          },
          "429": {
            "description": "`busy`: forecasts are being fitted for other requests; retry shortly."
          }
        }
      }
    },
    "/v1/stockquote/{ticker}": {
      "get": {
        "tags": [
          "Market Data"
        ],
        "summary": "Historical stock quote (bid/ask/mid/last) at the at-minute.",
        "operationId": "getHistoricalStockQuote",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathTicker"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          }
        ],
        "responses": {
          "200": {
            "description": "Historical stock-quote response."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          }
        }
      }
    },
    "/v1/optionquote/{symbol}": {
      "get": {
        "tags": [
          "Market Data"
        ],
        "summary": "Historical option chain with BSM greeks, IV, OI, plus svi_vol.",
        "operationId": "getHistoricalOptionQuote",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          },
          {
            "$ref": "#/components/parameters/QueryExpiry"
          },
          {
            "$ref": "#/components/parameters/QueryStrike"
          },
          {
            "$ref": "#/components/parameters/QueryOptionType"
          }
        ],
        "responses": {
          "200": {
            "description": "Historical option-quote response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OptionQuoteResponse"
                },
                "examples": {
                  "spy-2024-08-09-expiry": {
                    "summary": "SPY 2024-08-09 expiry chain at 2024-08-05T10:30:00 ET",
                    "externalValue": "https://flashalpha.com/docs/samples/historical-optionquote.json"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          }
        }
      }
    },
    "/v1/stock/{symbol}/prices": {
      "get": {
        "tags": [
          "Price History"
        ],
        "summary": "Daily OHLC bars (rolling, most-recent N trading days). Backs live /v1/volatility/realized and /forecast. Does NOT take at=.",
        "operationId": "getHistoricalStockPrices",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Number of most-recent trading days to return (default 600, clamped 1-2000). Returns a rolling window up to now, not a point-in-time snapshot, so it takes days instead of at.",
            "schema": {
              "type": "integer",
              "default": 600,
              "minimum": 1,
              "maximum": 2000
            }
          },
          {
            "name": "adjusted",
            "in": "query",
            "required": false,
            "description": "true returns split-adjusted bars: every bar before a split has its open, high, low and close divided by the split ratio, so the whole series is on the basis of the latest bar. false (the default) returns bars as traded.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Daily OHLC bars, oldest-first, with coverage window.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "symbol": {
                      "type": "string"
                    },
                    "bars": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string",
                            "format": "date"
                          },
                          "open": {
                            "type": "number"
                          },
                          "high": {
                            "type": "number"
                          },
                          "low": {
                            "type": "number"
                          },
                          "close": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "coverage": {
                      "type": "object",
                      "properties": {
                        "first": {
                          "type": "string",
                          "format": "date"
                        },
                        "last": {
                          "type": "string",
                          "format": "date"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "aapl-prices": {
                    "summary": "AAPL daily OHLC, most-recent 500 trading days",
                    "externalValue": "https://flashalpha.com/docs/samples/historical-stock-prices.json"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          },
          "404": {
            "description": "no_coverage - the symbol has no bars in the archive."
          }
        }
      }
    },
    "/v1/stock/{symbol}/summary": {
      "get": {
        "tags": [
          "Stock Summary"
        ],
        "summary": "Historical comprehensive stock snapshot: price, IV, exposure, macro at the at-minute.",
        "operationId": "getHistoricalStockSummary",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          }
        ],
        "responses": {
          "200": {
            "description": "Historical stock-summary response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockSummaryResponse"
                },
                "examples": {
                  "spy-2024-08-05": {
                    "summary": "SPY stock summary at 2024-08-05T10:30:00 ET",
                    "externalValue": "https://flashalpha.com/docs/samples/historical-stock-summary.json"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TierRestricted"
          }
        }
      }
    },
    "/v1/exposure/expiry-impact/{symbol}": {
      "get": {
        "tags": [
          "Historical research and trader context"
        ],
        "operationId": "getHistoricalExpiryImpact",
        "summary": "Historical expiry removal sensitivity",
        "description": "SPY/QQQ only. Current minus excluded equals remaining with spot and Greeks fixed. GEX USD delta notional per 1% move; calls positive, puts negative. Gross shares use gross magnitude; this is not a future forecast.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryExposureAt"
          },
          {
            "name": "expiry",
            "in": "query",
            "required": false,
            "description": "yyyy-MM-dd",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SPY/QQQ only. Current minus excluded equals remaining with spot and Greeks fixed. GEX USD delta notional per 1% move; calls positive, puts negative. Gross shares use gross magnitude; this is not a future forecast."
          },
          "400": {
            "description": "Invalid parameters"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Alpha or Enterprise required"
          },
          "404": {
            "description": "Archive data or requested resource unavailable"
          },
          "422": {
            "description": "Unsupported symbol"
          },
          "503": {
            "description": "Invalid spot or required archived OI unavailable"
          }
        },
        "x-release-status": "requires-historical-api-release"
      }
    },
    "/v1/exposure/strike-dependency/{symbol}": {
      "get": {
        "tags": [
          "Historical research and trader context"
        ],
        "operationId": "getHistoricalStrikeDependency",
        "summary": "Historical exact-strike expiry dependency",
        "description": "SPY/QQQ only. Requires an exact positive observed strike. Returns by-expiry gross shares and dominant maturity.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "name": "strike",
            "in": "query",
            "required": true,
            "description": "Exact positive strike observed in the archived chain; no nearest-strike rounding.",
            "schema": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          },
          {
            "$ref": "#/components/parameters/QueryExposureAt"
          }
        ],
        "responses": {
          "200": {
            "description": "SPY/QQQ only. Requires an exact positive observed strike. Returns by-expiry gross shares and dominant maturity."
          },
          "400": {
            "description": "Invalid parameters"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Alpha or Enterprise required"
          },
          "404": {
            "description": "Archive data or requested resource unavailable"
          },
          "422": {
            "description": "Unsupported symbol"
          },
          "503": {
            "description": "Invalid spot or required archived OI unavailable"
          }
        },
        "x-release-status": "requires-historical-api-release"
      }
    },
    "/v1/exposure/term-structure/{symbol}": {
      "get": {
        "tags": [
          "Exposure"
        ],
        "operationId": "getHistoricalExposureTermStructure",
        "summary": "Historical exposure term structure",
        "description": "This base route is already live. Only the new gamma_concentration field requires the corresponding Historical API release. Concentration is supported for SPY/QQQ; unsupported or unavailable concentration carries its own status. Date-only at remains 15:55 ET.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryExposureAt"
          }
        ],
        "responses": {
          "200": {
            "description": "Existing exposure term structure; gamma_concentration is an additive field requiring the corresponding Historical API release.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "gamma_concentration": {
                      "type": "object",
                      "description": "SPY/QQQ concentration and reconstruction metadata; unsupported or unavailable inputs carry an explicit status.",
                      "x-release-status": "requires-historical-api-release"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Alpha or Enterprise required"
          },
          "404": {
            "description": "Archive data or requested resource unavailable"
          }
        }
      }
    },
    "/v1/strategies/yield-enhancement/{symbol}": {
      "get": {
        "tags": [
          "Historical research and trader context"
        ],
        "operationId": "getHistoricalYieldEnhancement",
        "summary": "Historical income selection and cash diagnostics",
        "description": "Standard equity options. SPY/QQQ validated. Omitted expiry preserves full-chain nearest-absolute-target-delta selection; an explicit expiry restricts maturity. Quote diagnostics and roll context use the picked expiry, strike and right. Monthly research rules are a separate strategy. Bid diagnostics, caller-supplied fees/basis and mid-ranked legacy fields are distinct. Other equities lack a historical earnings calendar and default to insufficient-data selection when exclusion is requested. metrics.research uses the replay cutoff and separate retrospective discovery.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          },
          {
            "name": "expiry",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "structure",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string",
              "enum": [
                "covered_call",
                "cash_secured_put"
              ],
              "default": "covered_call"
            }
          },
          {
            "name": "targetDelta",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 1,
              "default": 0.25
            }
          },
          {
            "name": "minOpenInterest",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 250
            }
          },
          {
            "name": "excludeEarningsBeforeExpiry",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "stockCostBasis",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          },
          {
            "name": "feesPerContract",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "number",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Standard equity options. SPY/QQQ validated. Omitted expiry preserves full-chain nearest-absolute-target-delta selection; an explicit expiry restricts maturity. Quote diagnostics and roll context use the picked expiry, strike and right. Monthly research rules are a separate strategy. Bid diagnostics, caller-supplied fees/basis and mid-ranked legacy fields are distinct. Other equities lack a historical earnings calendar and default to insufficient-data selection when exclusion is requested. metrics.research uses the replay cutoff and separate retrospective discovery."
          },
          "400": {
            "description": "Invalid parameters"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Alpha or Enterprise required"
          },
          "404": {
            "description": "Archive data or requested resource unavailable"
          },
          "422": {
            "description": "Unsupported contract"
          },
          "503": {
            "description": "Invalid spot"
          }
        },
        "x-release-status": "requires-historical-api-release"
      }
    },
    "/v1/strategies/sell-window/{symbol}": {
      "get": {
        "tags": [
          "Historical research and trader context"
        ],
        "operationId": "getHistoricalSellWindow",
        "summary": "Replay sell-window: sell or skip per expiry, plus suggested positions",
        "description": "SPY, QQQ and IWM. Set at to 09:35 ET on a session for the backtest's entry strikes. Alpha plan.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSymbol"
          },
          {
            "$ref": "#/components/parameters/QueryAt"
          }
        ],
        "responses": {
          "200": {
            "description": "Standard equity options. SPY/QQQ validated. Omitted expiry preserves full-chain nearest-absolute-target-delta selection; an explicit expiry restricts maturity. Quote diagnostics and roll context use the picked expiry, strike and right. Monthly research rules are a separate strategy. Bid diagnostics, caller-supplied fees/basis and mid-ranked legacy fields are distinct. Other equities lack a historical earnings calendar and default to insufficient-data selection when exclusion is requested. metrics.research uses the replay cutoff and separate retrospective discovery."
          },
          "400": {
            "description": "Invalid parameters"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Alpha or Enterprise required"
          },
          "404": {
            "description": "Archive data or requested resource unavailable"
          },
          "422": {
            "description": "Unsupported contract"
          },
          "503": {
            "description": "Invalid spot"
          }
        }
      }
    },
    "/v1/research/packs": {
      "get": {
        "tags": [
          "Historical research and trader context"
        ],
        "operationId": "listHistoricalResearchPacks",
        "summary": "Discover offline retrospective research",
        "description": "Returns evidence_mode, as_of_utc, count and packs. Optional at gates publication, definition and data cutoffs; no at is explicit retrospective discovery.",
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "strategy",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/QueryResearchAt"
          }
        ],
        "responses": {
          "200": {
            "description": "Returns evidence_mode, as_of_utc, count and packs. Optional at gates publication, definition and data cutoffs; no at is explicit retrospective discovery."
          },
          "400": {
            "description": "Invalid parameters"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Alpha or Enterprise required"
          },
          "404": {
            "description": "Archive data or requested resource unavailable"
          }
        },
        "x-release-status": "requires-historical-api-release"
      }
    },
    "/v1/research/packs/{packId}": {
      "get": {
        "tags": [
          "Historical research and trader context"
        ],
        "operationId": "getHistoricalResearchPack",
        "summary": "Read immutable pack manifest",
        "description": "Schema v1 manifest: pack_id, published_at_utc, definition_frozen_at_utc, data_cutoff_utc, symbols, strategies, applicability, summary and allowlisted artifacts with name, media_type, sha256 and bytes.",
        "parameters": [
          {
            "name": "packId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/QueryResearchAt"
          }
        ],
        "responses": {
          "200": {
            "description": "Schema v1 manifest: pack_id, published_at_utc, definition_frozen_at_utc, data_cutoff_utc, symbols, strategies, applicability, summary and allowlisted artifacts with name, media_type, sha256 and bytes."
          },
          "400": {
            "description": "Invalid parameters"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Alpha or Enterprise required"
          },
          "404": {
            "description": "Archive data or requested resource unavailable"
          }
        },
        "x-release-status": "requires-historical-api-release"
      }
    },
    "/v1/research/packs/{packId}/artifacts/{name}": {
      "get": {
        "tags": [
          "Historical research and trader context"
        ],
        "operationId": "downloadHistoricalResearchArtifact",
        "summary": "Download SHA-verified research artifact",
        "description": "Attachment with SHA-256 ETag and nosniff. Only manifest-listed artifacts are served. Historical cutoffs also gate downloads.",
        "parameters": [
          {
            "name": "packId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/QueryResearchAt"
          }
        ],
        "responses": {
          "200": {
            "description": "Attachment with SHA-256 ETag and nosniff. Only manifest-listed artifacts are served. Historical cutoffs also gate downloads."
          },
          "400": {
            "description": "Invalid parameters"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Alpha or Enterprise required"
          },
          "404": {
            "description": "Archive data or requested resource unavailable"
          },
          "503": {
            "description": "Artifact byte-length or SHA-256 mismatch"
          }
        },
        "x-release-status": "requires-historical-api-release"
      }
    }
  }
}
