every model spec’d & versioned · harness ✓ greenchangelog →

Docs · Model reference

loan-comparison

Verified · spec v1.0.0

Inputs

FieldTypeValid domain
loanAmountfloat1,000 – 2,000,000
annualRateAfloat0 – 0.3
termMonthsAint6 – 480
feesAfloat0 – 20,000
annualRateBfloat0 – 0.3
termMonthsBint6 – 480
feesBfloat0 – 20,000
  • Costs are lifetime nominal dollars (interest + fees), undiscounted. Comparing offers with different terms ignores time value and payment duration — a longer loan's lower nominal total can still be worse in present-value terms.

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/loan-comparison
{
  "loanAmount": 1001000,
  "annualRateA": 0.15,
  "termMonthsA": 243,
  "feesA": 10000,
  "annualRateB": 0.15,
  "termMonthsB": 243,
  "feesB": 10000
}
Response (chart arrays compacted)
{
  "ok": true,
  "model": "loan-comparison",
  "specVersion": "1.0.0",
  "contractUrl": "/api/v1/models/loan-comparison",
  "specUrl": "/api/v1/models/loan-comparison/spec",
  "inputs": {
    "loanAmount": 1001000,
    "annualRateA": 0.15,
    "termMonthsA": 243,
    "feesA": 10000,
    "annualRateB": 0.15,
    "termMonthsB": 243,
    "feesB": 10000
  },
  "outputs": {
    "monthlyPaymentA": 13155.350016081906,
    "monthlyPaymentB": 13155.350016081906,
    "totalInterestA": 2195750.053907903,
    "totalInterestB": 2195750.053907903,
    "totalCostA": 2205750.053907903,
    "totalCostB": 2205750.053907903,
    "monthlyDelta": 0,
    "cheaperOption": "tie",
    "lifetimeSavings": 0
  },
  "sentinels": [],
  "assumptions": [
    "Implements model spec loan-comparison v1.0.0 (dual-implementation verified).",
    "Costs are lifetime nominal dollars (interest + fees), undiscounted. Comparing offers with different terms ignores time value and payment duration — a longer loan's lower nominal total can still be worse in present-value terms."
  ],
  "facts": [],
  "record": {
    "sha256": "fe6f88e94227f796b3a94b7f04e6c9962cee2decefe6f5604464a3cab7ac6b60",
    "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.