Docs · Model reference

roth-vs-traditional

Verified · spec v1.0.1

Inputs

FieldTypeValid domain
annualContributionfloat1,000 – 30,500
currentAgeint18 – 65
retirementAgeint50 – 75
currentMarginalRatefloat0.1 – 0.37
retirementTaxRatefloat0.1 – 0.37
expectedReturnfloat0.02 – 0.12
  • retirementAge must exceed currentAge

All fields required. Out-of-domain values are rejected with per-field errors — never clamped. Unknown fields are rejected.

Live example — generated from the real engine

Request
POST /api/v1/models/roth-vs-traditional
{
  "annualContribution": 16000,
  "currentAge": 42,
  "retirementAge": 63,
  "currentMarginalRate": 0.24,
  "retirementTaxRate": 0.24,
  "expectedReturn": 0.07
}
Response (chart arrays compacted)
{
  "ok": true,
  "model": "roth-vs-traditional",
  "specVersion": "1.0.1",
  "contractUrl": "/api/v1/models/roth-vs-traditional",
  "specUrl": "/api/v1/models/roth-vs-traditional/spec",
  "inputs": {
    "annualContribution": 16000,
    "currentAge": 42,
    "retirementAge": 63,
    "currentMarginalRate": 0.24,
    "retirementTaxRate": 0.24,
    "expectedReturn": 0.07
  },
  "outputs": {
    "rothAfterTax": 595909.7881683031,
    "traditionalAfterTax": 595909.788168303,
    "breakEvenTaxRate": 0.24,
    "recommendation": "roth",
    "yearlyGrowth": [
      {
        "age": 42,
        "roth": 0,
        "traditional": 0
      },
      {
        "age": 43,
        "roth": 12160,
        "traditional": 16000
      },
      "… 20 more"
    ]
  },
  "sentinels": [],
  "assumptions": [
    "Implements model spec roth-vs-traditional v1.0.1 (dual-implementation verified).",
    "retirementAge must exceed currentAge"
  ],
  "facts": [],
  "record": {
    "sha256": "8ed0346c9a4310d2c1d3be4c2c4aa293967dd4995b6a5a82b5739d45fde89bce",
    "fields": [
      "model",
      "specVersion",
      "inputs",
      "outputs"
    ],
    "howToVerify": "Store this record with any advice or agent output built on these numbers. To verify later: build {model, specVersion, inputs, outputs} from the stored response, serialize as JSON with object keys sorted recursively (no whitespace), and SHA-256 it — a match proves the numbers came from this spec version with these inputs, unaltered."
  },
  "disclaimer": "Illustrative planning model, not financial advice. Outputs follow the published model spec exactly; read the spec for assumptions and exclusions before relying on any number."
}

This example is executed against the production engine when the page builds — it cannot drift from the API's real behavior.