Docs · Model reference

student-loan-payoff

Verified · spec v1.0.0

Inputs

FieldTypeValid domain
loanBalancefloat1,000 – 200,000
interestRatefloat0.01 – 0.15
minimumPaymentfloat50 – 3,000
extraPaymentfloat0 – 2,000
investmentReturnfloat0.02 – 0.15
taxDeductionRatefloat0.1 – 0.37
  • investmentReturn must stay > 0 (NaN at 0)

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

Sentinel values

  • payoffMonthsAggressive = 600 loan not paid off within the 600-month cap
  • payoffMonthsMinimum = 600 loan not paid off within the 600-month cap

Responses annotate these in a sentinels array with a triggered flag per run.

Live example — generated from the real engine

Request
POST /api/v1/models/student-loan-payoff
{
  "loanBalance": 101000,
  "interestRate": 0.08,
  "minimumPayment": 1500,
  "extraPayment": 1000,
  "investmentReturn": 0.09,
  "taxDeductionRate": 0.24
}
Response (chart arrays compacted)
{
  "ok": true,
  "model": "student-loan-payoff",
  "specVersion": "1.0.0",
  "contractUrl": "/api/v1/models/student-loan-payoff",
  "specUrl": "/api/v1/models/student-loan-payoff/spec",
  "inputs": {
    "loanBalance": 101000,
    "interestRate": 0.08,
    "minimumPayment": 1500,
    "extraPayment": 1000,
    "investmentReturn": 0.09,
    "taxDeductionRate": 0.24
  },
  "outputs": {
    "payoffMonthsAggressive": 48,
    "payoffMonthsMinimum": 90,
    "totalInterestAggressive": 17067.488481140295,
    "totalInterestMinimum": 33506.70822249092,
    "interestSaved": 16439.219741350622,
    "investmentFVIfInvested": 57520.71110849479,
    "netBenefitPayoff": -41081.49136714417,
    "recommendation": "invest",
    "monthlyData": [
      {
        "month": 0,
        "balance": 101000,
        "investmentValue": 0
      },
      {
        "month": 1,
        "balance": 99173.33333333333,
        "investmentValue": 1000
      },
      "… 47 more"
    ]
  },
  "sentinels": [
    {
      "field": "payoffMonthsAggressive",
      "value": 600,
      "meaning": "loan not paid off within the 600-month cap",
      "triggered": false
    },
    {
      "field": "payoffMonthsMinimum",
      "value": 600,
      "meaning": "loan not paid off within the 600-month cap",
      "triggered": false
    }
  ],
  "assumptions": [
    "Implements model spec student-loan-payoff v1.0.0 (dual-implementation verified).",
    "investmentReturn must stay > 0 (NaN at 0)"
  ],
  "facts": [],
  "record": {
    "sha256": "d2fcc79aed69ea18a63078d405c262b218dbda9c76b5b90d83460887c962e4d0",
    "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.