{
  "openapi": "3.1.0",
  "info": {
    "title": "Real Return Engine \u2014 100-Year Cross-Asset Valuation, Adaptive Strategy & Retirement Survival API",
    "version": "3.0.6",
    "description": "Public read-only REST JSON API and Streamable HTTP Model Context Protocol (MCP) server for 2026 7-year expected real returns across Core-8 macro assets, 100-year (1928-2026) forecast accuracy backtests, 13 adaptive and guru portfolio audits, 10-year to indefinite safe withdrawal rate (SWR) & Frankenstein stress matrices, and <30ms custom portfolio simulations. External callers share a sliding-window rate limit of 30 requests per 60 seconds per IP across /api/v1/* and POST /mcp (HTTP 429 with Retry-After: 60 when exceeded); POST /mcp JSON-RPC 2.0 batches are capped at 3 items per request (HTTP 400 / JSON-RPC -32600 if exceeded). Non-commercial educational and research use per Terms of Use (https://www.realreturnengine.com/terms). Upstream historical international macro series incorporate the Jord\u00e0-Schularick-Taylor Macrohistory Database licensed under CC BY-NC-SA 4.0 (https://creativecommons.org/licenses/by-nc-sa/4.0/).",
    "contact": {
      "name": "Real Return Engine Research",
      "url": "https://www.realreturnengine.com"
    },
    "license": {
      "name": "Real Return Engine Terms of Use",
      "url": "https://www.realreturnengine.com/terms"
    }
  },
  "servers": [
    {
      "url": "https://www.realreturnengine.com",
      "description": "Production HTTPS Server"
    },
    {
      "url": "http://127.0.0.1:8789",
      "description": "Local Development Server"
    }
  ],
  "paths": {
    "/api/v1/forecast": {
      "get": {
        "operationId": "getCrossAsset7yForecast",
        "summary": "Get 2026 Core-8 7-Year Expected Real & Nominal Returns",
        "description": "Returns 2026 7-year expected annualized real (after-inflation) and nominal returns (%/yr), current spot real yields, Shiller CAPE ratios, gold spot-to-fair-anchor ratios, and ETF proxy tickers across all Core-8 Macro Assets (as of 2026-06, 3.32% assumed CPI inflation): International Equities (VXUS: +5.84% real under 18.90x Post-1990 CAPE norm / 19.91x Baa-adjusted | +3.83% real under 16.40x 100Y CAPE norm), 10Y US TIPS (TIP: +2.07% real, +2.20% spot real yield), IG Corporate Bonds (LQD: +1.94% real, +2.68% spot real yield), 10Y US Treasury (IEF: +0.78% real, +1.15% spot real yield), 20Y+ Long Treasury (TLT: +0.68% real, +1.63% spot real yield), US Cash 3M T-Bill (SHV: +0.47% real, +0.34% spot real yield), US S&P 500 (SPY: +0.40% real Post-1990 Baseline 39.84x -> 27.31x CAPE / 28.88x Baa-adjusted | -3.72% real 100-Year Baseline 39.84x -> 20.22x CAPE / 21.38x Baa-adjusted), and Gold (GLD: -4.73% real at $4,042.52/oz = 2.079x Ver A rate-adjusted +1.5% trend fair anchor $1,944.89/oz | -6.55% real under Ver B 0.0% flat Post-2002 plateau anchor $1,869.43/oz).",
        "responses": {
          "200": {
            "description": "Canonical 2026 Core-8 7-year expected return payload"
          },
          "429": {
            "description": "Rate limit exceeded (shared 30 requests per 60 seconds per external IP across /api/v1/* and POST /mcp).",
            "headers": {
              "Retry-After": {
                "description": "Number of seconds to wait before retrying (60).",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "rate_limited"
                    },
                    "error": {
                      "type": "string"
                    },
                    "retry_after_seconds": {
                      "type": "integer",
                      "example": 60
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/backtest": {
      "get": {
        "operationId": "get100yrBacktestSummary",
        "summary": "Get 100-Year Historical Forecast Accuracy Scorecard & Turning-Point Snapshots",
        "description": "Returns 100-year historical out-of-sample forecast accuracy metrics (1928-2026 evaluation window, Mean Absolute Error, RMSE, Pearson correlation r across 92 completed 7-year periods 1928-2019) plus historical market turning-point snapshots comparing expected vs. realized 7-year real returns at 1929 Great Crash Peak, 1966 Stagflation Peak, 1982 Interest Rate Peak, 2000 Dot-Com Peak, 2009 Financial Crisis Low, 2021 Bond Bubble Peak, and Live 2026.",
        "responses": {
          "200": {
            "description": "Canonical 100-year forecast backtest accuracy payload"
          },
          "429": {
            "description": "Rate limit exceeded (shared 30 requests per 60 seconds per external IP across /api/v1/* and POST /mcp).",
            "headers": {
              "Retry-After": {
                "description": "Number of seconds to wait before retrying (60).",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "rate_limited"
                    },
                    "error": {
                      "type": "string"
                    },
                    "retry_after_seconds": {
                      "type": "integer",
                      "example": 60
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/strategies": {
      "get": {
        "operationId": "getAdaptiveStrategyAndGuruAudit",
        "summary": "Get 100-Year Adaptive Portfolio, Guru In-Sample/Out-of-Sample Decay & 28-Spec Audit",
        "description": "Returns the 100-Year (1928-2026) audit across 13 portfolio strategies (100% US Equities +6.85%, 100% Global Stocks 65/35 +7.01%, 100% Global Value-Tilted Equities +7.23%, Classic US 60/40 +5.37%, Global Core-8 60/40 +5.56%, Ray Dalio All-Weather +3.75%, Harry Browne Permanent +3.48%, Meb Faber 10M SMA +5.54%, Dual-Haven 10M SMA +5.79%, Macro GTT +5.98%, Elm Wealth Dynamic +7.23%, 7-Year Valuation Tilt (Core-8) +7.04%, and Combined Valuation + Macro/Trend Rule +7.05%). Includes Decade-by-Decade real returns, Pre/Post-Publication Guru Decay, 28-Specification Parameter Matrix, Standalone Bond Trend & Rule Extensions, Working (1960) Monthly-Average vs. Point-in-Time Month-End (EOM) Total-Return 10M SMA Audit, and Ulcer Index Discomfort Scorecard.",
        "parameters": [
          {
            "name": "section",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "summary",
              "enum": [
                "summary",
                "all",
                "scorecard",
                "is_oos_guru_decay",
                "publication_decay",
                "ablation_ladder",
                "decades",
                "allweather_permanent_grids",
                "sensitivity_grids",
                "parameter_heatmap",
                "master_28_matrix",
                "extensions",
                "rule_extensions",
                "working_1960_eom",
                "discomfort_ulcer",
                "ulcer_discomfort"
              ],
              "description": "Section filter: 'summary' (default ~14 KB JSON data / ~30 KB full MCP JSON-RPC envelope with structuredContent), 'all' (full payload), 'scorecard', 'is_oos_guru_decay', 'ablation_ladder', 'decades', 'allweather_permanent_grids', 'sensitivity_grids', 'master_28_matrix', 'extensions', 'working_1960_eom', or 'discomfort_ulcer'."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Canonical 100-year strategy scorecard and robustness tables"
          },
          "429": {
            "description": "Rate limit exceeded (shared 30 requests per 60 seconds per external IP across /api/v1/* and POST /mcp).",
            "headers": {
              "Retry-After": {
                "description": "Number of seconds to wait before retrying (60).",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "rate_limited"
                    },
                    "error": {
                      "type": "string"
                    },
                    "retry_after_seconds": {
                      "type": "integer",
                      "example": 60
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/swr-stress": {
      "get": {
        "operationId": "getRetirementSwrAndSequenceStressMatrix",
        "summary": "Get 100-Year Safe Withdrawal Rate, Horizons (10Y-Indefinite), Cushions, GDP Escalation & 7-Mode Monte Carlo Matrix",
        "description": "Returns the 100-Year (1928-2026) retirement stress matrix: (1) Safe Withdrawal Rates across 10Y, 20Y, 30Y, 40Y, 50Y (FIRE), and Indefinite horizons with 0%, 25%, 50% terminal/pathwise, and 100% Real Principal Cushions; (2) CPI Inflation (+0% real) vs. Real Per-Capita GDP Standard-of-Living Escalation (+2.0%/yr real above CPI) vs. Singularity GDP (+4.0%/yr); (3) Starting Valuation Regimes & Long-Horizon Bond Drag Crossover; (4) Mid-Retirement Worst Balance Troughs; (5) 6 Synthetic Frankenstein / Perfect-Storm & AI Upside Stress Scenarios (1930s Equities + 1970s Bonds F2: 1.12% US 60/40 vs 4.06% Combined Valuation + Macro/Trend Rule); and (6) 7-Mode Monte Carlo Correlation, Non-Overlapping Block & Stationary AR(1) Cholesky Gaussian Copula Decomposition.",
        "parameters": [
          {
            "name": "section",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "summary",
              "enum": [
                "summary",
                "all",
                "horizons_cushions",
                "horizons_and_gdp",
                "drawdown_cushions",
                "gdp_escalation",
                "valuation_bond_drag",
                "troughs",
                "frankenstein_stress",
                "historical_crashes",
                "monte_carlo_correlations",
                "monte_carlo_7modes",
                "discomfort_ulcer"
              ],
              "description": "Section filter: 'summary' (default ~16 KB JSON data / ~34 KB full MCP JSON-RPC envelope with structuredContent), 'all' (full matrix), 'horizons_cushions', 'gdp_escalation', 'valuation_bond_drag', 'troughs', 'frankenstein_stress', 'monte_carlo_correlations', or 'discomfort_ulcer'."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Canonical 100-year safe withdrawal rate and stress test matrix"
          },
          "429": {
            "description": "Rate limit exceeded (shared 30 requests per 60 seconds per external IP across /api/v1/* and POST /mcp).",
            "headers": {
              "Retry-After": {
                "description": "Number of seconds to wait before retrying (60).",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "rate_limited"
                    },
                    "error": {
                      "type": "string"
                    },
                    "retry_after_seconds": {
                      "type": "integer",
                      "example": 60
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/retirement": {
      "get": {
        "operationId": "getRetirementSwrAlias",
        "summary": "Alias for GET /api/v1/swr-stress",
        "responses": {
          "200": {
            "description": "Canonical 100-year safe withdrawal rate and stress test matrix"
          },
          "429": {
            "description": "Rate limit exceeded (shared 30 requests per 60 seconds per external IP across /api/v1/* and POST /mcp).",
            "headers": {
              "Retry-After": {
                "description": "Number of seconds to wait before retrying (60).",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "rate_limited"
                    },
                    "error": {
                      "type": "string"
                    },
                    "retry_after_seconds": {
                      "type": "integer",
                      "example": 60
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/simulate": {
      "get": {
        "operationId": "simulateCustomPortfolioGet",
        "summary": "Simulate Custom Core-8 Portfolio 100-Year Backtest & SWR via Query Parameters",
        "parameters": [
          {
            "name": "w_spy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "description": "Weight in US Large-Cap Equities (SPY / S&P 500), e.g. 0.60 or 60."
            }
          },
          {
            "name": "w_vxus",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "description": "Weight in International Ex-US Equities (VXUS / VEA), e.g. 0.20 or 20."
            }
          },
          {
            "name": "w_ief",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "description": "Weight in US 10-Year Treasury Bonds (IEF), e.g. 0.40 or 40."
            }
          },
          {
            "name": "w_tlt",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "description": "Weight in US 20+ Year Long Treasury Bonds (TLT), e.g. 0.0."
            }
          },
          {
            "name": "w_tip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "description": "Weight in US 10-Year TIPS Inflation-Protected Bonds (TIP), e.g. 0.0."
            }
          },
          {
            "name": "w_lqd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "description": "Weight in US Investment-Grade Corporate Bonds (LQD), e.g. 0.0."
            }
          },
          {
            "name": "w_gld",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "description": "Weight in Gold (GLD), e.g. 0.0."
            }
          },
          {
            "name": "w_shv",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "description": "Weight in US 3-Month T-Bill Cash (SHV / BIL), e.g. 0.0."
            }
          },
          {
            "name": "overlay_mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "buy_and_hold",
              "enum": [
                "buy_and_hold",
                "single_bond_10m_sma",
                "naive_10m_sma",
                "dual_haven_10m_sma",
                "macro_gtt",
                "elm_val_mom",
                "valuation_tilt_7y",
                "combined_valuation_macro_trend",
                "two_key_hybrid"
              ],
              "description": "Portfolio management rule: 'buy_and_hold' (default static rebalanced), 'single_bond_10m_sma' (Faber 2007 10M SMA into 10Y bonds), 'dual_haven_10m_sma' (10M SMA with Bond/Cash Dual Safe Haven), 'macro_gtt' (UNRATE > 12M SMA recession gate + 10M SMA), 'elm_val_mom' (Elm Wealth 2012 3-asset valuation + momentum), 'valuation_tilt_7y' (7-Year Valuation Tilt Core-8), or 'combined_valuation_macro_trend' / 'two_key_hybrid' (Combined Valuation + Macro/Trend Rule \u2014 note: applying to custom weights produces a custom-weight simulation distinct from canonical Core-8 ret_m5_rre_twokey unless exact Core-8 33/27/10/14/16 weights are passed)."
            }
          },
          {
            "name": "horizon_years",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "string"
              ],
              "default": 30,
              "description": "Retirement withdrawal horizon in years (integer 5 to 60, or 'indefinite' for a perpetual principal-preserving endowment horizon). Default is 30."
            }
          },
          {
            "name": "principal_cushion_pct",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "default": 0.0,
              "description": "Required ending real principal cushion as % of starting principal (0 = depleting to $0, 25 = 25% cushion, 50 = 50% cushion, 100 = Indefinite/Perpetual 100% principal preserved). Default is 0."
            }
          },
          {
            "name": "real_spending_escalation_pct_yr",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "default": 0.0,
              "description": "Annual real spending & principal growth escalator above/below CPI inflation in %/yr (-5.0 to +6.0; e.g. -1.0 = -1%/yr spending smile decline, 0.0 = CPI inflation only default, 1.0 = Half-GDP, 2.0 = Real Per-Capita GDP '1900 to 2000 parity', 4.0 = Singularity GDP)."
            }
          },
          {
            "name": "withdrawal_rate_pct",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "default": 4.0,
              "description": "Target initial annual withdrawal rate in %/yr (default 4.0) used to evaluate historical survival odds and mid-retirement drawdown troughs."
            }
          },
          {
            "name": "withdrawal_timing",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "boy",
              "enum": [
                "boy",
                "eoy",
                "beginning_of_year",
                "end_of_year"
              ],
              "description": "Annual withdrawal timing convention: 'boy' / 'beginning_of_year' (default conservative annuity-due Z_0 = 1.0) or 'eoy' / 'end_of_year' (B_{t+1} = B_t * (1 + r_t) - W_t)."
            }
          },
          {
            "name": "start_year",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1928,
              "description": "Historical evaluation start year (1928 to 2026, default 1928)."
            }
          },
          {
            "name": "end_year",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 2026,
              "description": "Historical evaluation end year (1928 to 2026, default 2026)."
            }
          },
          {
            "name": "include_yearly_series",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": true,
              "description": "If true (default) during local loopback verification, includes the full 1928-2026 annual real return and wealth series; on public external API/MCP calls, raw 1928-2026 annual arrays are omitted ([]) and a summary yearly_series_note is returned."
            }
          },
          {
            "name": "simulation_mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "historical",
              "enum": [
                "historical",
                "mc_5b_2026",
                "mc_1_iid",
                "frankenstein_f2"
              ],
              "description": "Optional Chart 3 curve regime when include_chart3_curves=true: 'historical' (1928-2026 cohorts), 'mc_5b_2026' (2026 Valuation-Conditioned AR(1)+Cholesky Copula calibrated to 3,000-path MC-5B statistics), 'mc_1_iid' (Pure Random IID), or 'frankenstein_f2' (1930s Equities + 1970s Bonds)."
            }
          },
          {
            "name": "include_chart3_curves",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "description": "If true, attaches compact Year 0..H chart3_curves percentile real wealth paths ($100 start) and survival statistics aligned to 0.00 bps with backend 3,000-path MC-5B calibration."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Custom 100-year backtest and SWR simulation payload"
          },
          "400": {
            "description": "Validation error"
          },
          "429": {
            "description": "Rate limit exceeded (shared 30 requests per 60 seconds per external IP across /api/v1/* and POST /mcp).",
            "headers": {
              "Retry-After": {
                "description": "Number of seconds to wait before retrying (60).",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "rate_limited"
                    },
                    "error": {
                      "type": "string"
                    },
                    "retry_after_seconds": {
                      "type": "integer",
                      "example": 60
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "simulateCustomPortfolioPost",
        "summary": "Simulate Custom Core-8 Portfolio 100-Year Backtest & SWR via JSON Body",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "w_spy": {
                    "type": "number",
                    "description": "Weight in US Large-Cap Equities (SPY / S&P 500), e.g. 0.60 or 60."
                  },
                  "w_vxus": {
                    "type": "number",
                    "description": "Weight in International Ex-US Equities (VXUS / VEA), e.g. 0.20 or 20."
                  },
                  "w_ief": {
                    "type": "number",
                    "description": "Weight in US 10-Year Treasury Bonds (IEF), e.g. 0.40 or 40."
                  },
                  "w_tlt": {
                    "type": "number",
                    "description": "Weight in US 20+ Year Long Treasury Bonds (TLT), e.g. 0.0."
                  },
                  "w_tip": {
                    "type": "number",
                    "description": "Weight in US 10-Year TIPS Inflation-Protected Bonds (TIP), e.g. 0.0."
                  },
                  "w_lqd": {
                    "type": "number",
                    "description": "Weight in US Investment-Grade Corporate Bonds (LQD), e.g. 0.0."
                  },
                  "w_gld": {
                    "type": "number",
                    "description": "Weight in Gold (GLD), e.g. 0.0."
                  },
                  "w_shv": {
                    "type": "number",
                    "description": "Weight in US 3-Month T-Bill Cash (SHV / BIL), e.g. 0.0."
                  },
                  "overlay_mode": {
                    "type": "string",
                    "default": "buy_and_hold",
                    "enum": [
                      "buy_and_hold",
                      "single_bond_10m_sma",
                      "naive_10m_sma",
                      "dual_haven_10m_sma",
                      "macro_gtt",
                      "elm_val_mom",
                      "valuation_tilt_7y",
                      "combined_valuation_macro_trend",
                      "two_key_hybrid"
                    ],
                    "description": "Portfolio management rule: 'buy_and_hold' (default static rebalanced), 'single_bond_10m_sma' (Faber 2007 10M SMA into 10Y bonds), 'dual_haven_10m_sma' (10M SMA with Bond/Cash Dual Safe Haven), 'macro_gtt' (UNRATE > 12M SMA recession gate + 10M SMA), 'elm_val_mom' (Elm Wealth 2012 3-asset valuation + momentum), 'valuation_tilt_7y' (7-Year Valuation Tilt Core-8), or 'combined_valuation_macro_trend' / 'two_key_hybrid' (Combined Valuation + Macro/Trend Rule \u2014 note: applying to custom weights produces a custom-weight simulation distinct from canonical Core-8 ret_m5_rre_twokey unless exact Core-8 33/27/10/14/16 weights are passed)."
                  },
                  "horizon_years": {
                    "type": [
                      "integer",
                      "string"
                    ],
                    "default": 30,
                    "description": "Retirement withdrawal horizon in years (integer 5 to 60, or 'indefinite' for a perpetual principal-preserving endowment horizon). Default is 30."
                  },
                  "principal_cushion_pct": {
                    "type": "number",
                    "default": 0.0,
                    "description": "Required ending real principal cushion as % of starting principal (0 = depleting to $0, 25 = 25% cushion, 50 = 50% cushion, 100 = Indefinite/Perpetual 100% principal preserved). Default is 0."
                  },
                  "real_spending_escalation_pct_yr": {
                    "type": "number",
                    "default": 0.0,
                    "description": "Annual real spending & principal growth escalator above/below CPI inflation in %/yr (-5.0 to +6.0; e.g. -1.0 = -1%/yr spending smile decline, 0.0 = CPI inflation only default, 1.0 = Half-GDP, 2.0 = Real Per-Capita GDP '1900 to 2000 parity', 4.0 = Singularity GDP)."
                  },
                  "withdrawal_rate_pct": {
                    "type": "number",
                    "default": 4.0,
                    "description": "Target initial annual withdrawal rate in %/yr (default 4.0) used to evaluate historical survival odds and mid-retirement drawdown troughs."
                  },
                  "withdrawal_timing": {
                    "type": "string",
                    "default": "boy",
                    "enum": [
                      "boy",
                      "eoy",
                      "beginning_of_year",
                      "end_of_year"
                    ],
                    "description": "Annual withdrawal timing convention: 'boy' / 'beginning_of_year' (default conservative annuity-due Z_0 = 1.0) or 'eoy' / 'end_of_year' (B_{t+1} = B_t * (1 + r_t) - W_t)."
                  },
                  "start_year": {
                    "type": "integer",
                    "default": 1928,
                    "description": "Historical evaluation start year (1928 to 2026, default 1928)."
                  },
                  "end_year": {
                    "type": "integer",
                    "default": 2026,
                    "description": "Historical evaluation end year (1928 to 2026, default 2026)."
                  },
                  "include_yearly_series": {
                    "type": "boolean",
                    "default": true,
                    "description": "If true (default) during local loopback verification, includes the full 1928-2026 annual real return and wealth series; on public external API/MCP calls, raw 1928-2026 annual arrays are omitted ([]) and a summary yearly_series_note is returned."
                  },
                  "simulation_mode": {
                    "type": "string",
                    "default": "historical",
                    "enum": [
                      "historical",
                      "mc_5b_2026",
                      "mc_1_iid",
                      "frankenstein_f2"
                    ],
                    "description": "Optional Chart 3 curve regime when include_chart3_curves=true: 'historical' (1928-2026 cohorts), 'mc_5b_2026' (2026 Valuation-Conditioned AR(1)+Cholesky Copula calibrated to 3,000-path MC-5B statistics), 'mc_1_iid' (Pure Random IID), or 'frankenstein_f2' (1930s Equities + 1970s Bonds)."
                  },
                  "include_chart3_curves": {
                    "type": "boolean",
                    "default": false,
                    "description": "If true, attaches compact Year 0..H chart3_curves percentile real wealth paths ($100 start) and survival statistics aligned to 0.00 bps with backend 3,000-path MC-5B calibration."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Custom 100-year backtest and SWR simulation payload"
          },
          "400": {
            "description": "Validation error"
          },
          "429": {
            "description": "Rate limit exceeded (shared 30 requests per 60 seconds per external IP across /api/v1/* and POST /mcp).",
            "headers": {
              "Retry-After": {
                "description": "Number of seconds to wait before retrying (60).",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "rate_limited"
                    },
                    "error": {
                      "type": "string"
                    },
                    "retry_after_seconds": {
                      "type": "integer",
                      "example": 60
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/feedback": {
      "post": {
        "operationId": "submitFeatureOrAssetFeedback",
        "summary": "Submit Request for Uncovered Ticker/Feature & Receive Core-8 Proxy",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "requested_item": {
                    "type": "string",
                    "description": "The ticker, asset class, metric, or feature requested."
                  },
                  "user_context": {
                    "type": "string",
                    "description": "Brief summary of what the user is trying to compare or solve."
                  }
                },
                "required": [
                  "requested_item"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Feedback logged with closest Core-8 proxy"
          },
          "429": {
            "description": "Rate limit exceeded (shared 30 requests per 60 seconds per external IP across /api/v1/* and POST /mcp).",
            "headers": {
              "Retry-After": {
                "description": "Number of seconds to wait before retrying (60).",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "rate_limited"
                    },
                    "error": {
                      "type": "string"
                    },
                    "retry_after_seconds": {
                      "type": "integer",
                      "example": 60
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "get": {
        "operationId": "getMcpDiscoveryManifest",
        "summary": "Get Model Context Protocol (MCP) Server Discovery Manifest & Tool Schemas",
        "responses": {
          "200": {
            "description": "MCP Server manifest"
          }
        }
      },
      "post": {
        "operationId": "postMcpJsonRpc",
        "summary": "Streamable HTTP Model Context Protocol (JSON-RPC 2.0) Endpoint",
        "description": "Accepts single JSON-RPC 2.0 objects or JSON-RPC 2.0 batch arrays of up to 3 items per request (batches > 3 items return HTTP 400 with JSON-RPC error -32600). Subject to a shared external IP rate limit of 30 requests per 60 seconds (HTTP 429 with Retry-After: 60).",
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response"
          },
          "400": {
            "description": "Invalid JSON-RPC request or batch size exceeds maximum of 3 items (-32600)"
          },
          "429": {
            "description": "Rate limit exceeded (shared 30 requests per 60 seconds per external IP across /api/v1/* and POST /mcp).",
            "headers": {
              "Retry-After": {
                "description": "Number of seconds to wait before retrying (60).",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "rate_limited"
                    },
                    "error": {
                      "type": "string"
                    },
                    "retry_after_seconds": {
                      "type": "integer",
                      "example": 60
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}