Skip to content

Mortgage · Calculation

FHA mortgage insurance schedule

Estimate upfront MIP and the annual premium on the scheduled loan balance, using the pinned FHA forward-mortgage schedule and entered financing assumptions.

Example result · upfrontMipRate: 0.0175 ratio See output

Cost per success
2 calculation credits
Production plans
Standard, Business, Scale, Enterprise
Plan allowances
Free sandbox
Not available

Integration example

Make a request

Use a production key scoped to fha-mortgage-insurance.

Keep the key on your server. A successful call uses 2 calculation credits.

Production request

Set HT_PRODUCTION_KEY on your server. Save as example.mjs and run node example.mjs with Node.js 18 or later.

import { randomUUID } from "node:crypto";

const key = process.env.HT_PRODUCTION_KEY;
if (!key) throw new Error("Set HT_PRODUCTION_KEY on your server.");
const endpoint = "https://calc.hasstechapi.com/v2/calc/fha-mortgage-insurance";
const input = {
  "baseLoanAmount": 289500,
  "ltv": 96.5,
  "loanTermYears": 30,
  "purchasePrice": 300000,
  "annualInterestRate": 6.5,
  "upfrontMipFinanced": true
};
const requestId = process.env.HT_REQUEST_ID || Date.now() + "." + randomUUID();
// Keep this ID to look up usage if the connection is interrupted.
console.error("Usage lookup ID:", requestId);

const response = await fetch(endpoint, {
  method: "POST",
  redirect: "error",
  headers: {
    "Authorization": "Bearer " + key,
    "Content-Type": "application/json",
    "Idempotency-Key": requestId
  },
  body: JSON.stringify(input)
});
if (!response.ok) {
  const problem = await response.json().catch(() => null);
  const code = problem?.error?.code || response.statusText;
  const delay = response.headers.get("retry-after");
  if (delay) console.error("Retry-After (seconds):", delay);
  console.error("HTTP " + response.status + " " + code + ". Usage lookup ID: " + requestId);
  if (Array.isArray(problem?.error?.details)) {
    for (const issue of problem.error.details) console.error("Input issue:", JSON.stringify(issue));
  }
  process.exitCode = 1;
} else {
  console.log(JSON.stringify(await response.json(), null, 2));
}
cURL (shell)

Set HT_PRODUCTION_KEY on your server. Run in a POSIX shell with cURL 7.76+ and Python 3.7+ to create a request ID.

(
  set -eu
  : "${HT_PRODUCTION_KEY:?Set HT_PRODUCTION_KEY on your server}"
  request_id="${HT_REQUEST_ID:-}"
  if [ -z "$request_id" ]; then
    request_id=$(python3 -c 'import time, uuid; print(str(time.time_ns() // 1000000) + "." + str(uuid.uuid4()))')
  fi
  printf 'Usage lookup ID: %s\n' "$request_id" >&2
  # On INVALID_INPUT, read error.details in the JSON response body.
  curl --disable --silent --show-error --fail-with-body --include \
    --request POST 'https://calc.hasstechapi.com/v2/calc/fha-mortgage-insurance' \
    --header "Authorization: Bearer $HT_PRODUCTION_KEY" \
    --header 'Content-Type: application/json' \
    --header "Idempotency-Key: $request_id" \
    --data-binary @- <<'HT_INPUT'
{
  "baseLoanAmount": 289500,
  "ltv": 96.5,
  "loanTermYears": 30,
  "purchasePrice": 300000,
  "annualInterestRate": 6.5,
  "upfrontMipFinanced": true
}
HT_INPUT
)
If your request fails
400 INVALID_INPUT

Read error.details when present. Node prints each issue. cURL returns the JSON body. Each path points into your request. An empty path refers to the whole body.

Check the accepted inputs for required fields, units and ranges. Send the corrected JSON as a new request.

401 or 403
Check that the server has the bearer key for the endpoint’s environment and that the key includes fha-mortgage-insurance.
429
Read the service error code, check your allowance, and wait for the Retry-After interval when supplied before trying again.
Lost response, 409 or 503
Open Request lookup, select the same environment and enter the printed usage lookup ID. A settled ID has already consumed credits. To retry the same calculation, set HT_REQUEST_ID to the original ID and reuse the same inputs. A settled request does not return its result again. Unset the variable for a new request, which can consume credits.

The usage lookup ID is the Idempotency-Key your server sends. The response’s x-request-id identifies the HTTP exchange for support.

Output

Example result

These values come from running this operation on the example inputs.

upfrontMipRate
0.0175 ratio
upfrontMipAmount
5066.25 USD
annualMipRate
0.0055 ratio
How to interpret this result
  • HT Calc policy snapshot 719df2c, November 2026. Program comparisons are planning estimates. A lender determines underwriting and eligibility.
  • Uses HUD Mortgagee Letter 2023-05 standard forward mortgage premiums, effective March 20, 2023. Excludes special and older refinance programs.
Full example response (JSON)
{
  "status": "available",
  "result": {
    "upfrontMipRate": 0.0175,
    "upfrontMipAmount": 5066.25,
    "annualMipRate": 0.0055,
    "monthlyMipAmount": 132.02,
    "mipDurationYears": "life",
    "totalMonthlyMipCost": 31243.68,
    "totalMipCost": 36309.93,
    "mipSchedule": [
      {
        "year": 1,
        "averageOutstandingBalance": 293074.62,
        "monthlyMipAmount": 132.02,
        "annualMipAmount": 1584.24
      },
      {
        "year": 2,
        "averageOutstandingBalance": 289682.26,
        "monthlyMipAmount": 130.49,
        "annualMipAmount": 1565.88
      },
      {
        "year": 3,
        "averageOutstandingBalance": 286062.72,
        "monthlyMipAmount": 128.86,
        "annualMipAmount": 1546.32
      },
      {
        "year": 4,
        "averageOutstandingBalance": 282200.76,
        "monthlyMipAmount": 127.12,
        "annualMipAmount": 1525.44
      },
      {
        "year": 5,
        "averageOutstandingBalance": 278080.18,
        "monthlyMipAmount": 125.26,
        "annualMipAmount": 1503.12
      },
      {
        "year": 6,
        "averageOutstandingBalance": 273683.63,
        "monthlyMipAmount": 123.28,
        "annualMipAmount": 1479.36
      },
      {
        "year": 7,
        "averageOutstandingBalance": 268992.61,
        "monthlyMipAmount": 121.17,
        "annualMipAmount": 1454.04
      },
      {
        "year": 8,
        "averageOutstandingBalance": 263987.44,
        "monthlyMipAmount": 118.91,
        "annualMipAmount": 1426.92
      },
      {
        "year": 9,
        "averageOutstandingBalance": 258647.07,
        "monthlyMipAmount": 116.51,
        "annualMipAmount": 1398.12
      },
      {
        "year": 10,
        "averageOutstandingBalance": 252949.04,
        "monthlyMipAmount": 113.94,
        "annualMipAmount": 1367.28
      },
      {
        "year": 11,
        "averageOutstandingBalance": 246869.41,
        "monthlyMipAmount": 111.2,
        "annualMipAmount": 1334.4
      },
      {
        "year": 12,
        "averageOutstandingBalance": 240382.61,
        "monthlyMipAmount": 108.28,
        "annualMipAmount": 1299.36
      },
      {
        "year": 13,
        "averageOutstandingBalance": 233461.4,
        "monthlyMipAmount": 105.16,
        "annualMipAmount": 1261.92
      },
      {
        "year": 14,
        "averageOutstandingBalance": 226076.65,
        "monthlyMipAmount": 101.84,
        "annualMipAmount": 1222.08
      },
      {
        "year": 15,
        "averageOutstandingBalance": 218197.32,
        "monthlyMipAmount": 98.29,
        "annualMipAmount": 1179.48
      },
      {
        "year": 16,
        "averageOutstandingBalance": 209790.29,
        "monthlyMipAmount": 94.5,
        "annualMipAmount": 1134
      },
      {
        "year": 17,
        "averageOutstandingBalance": 200820.26,
        "monthlyMipAmount": 90.46,
        "annualMipAmount": 1085.52
      },
      {
        "year": 18,
        "averageOutstandingBalance": 191249.46,
        "monthlyMipAmount": 86.15,
        "annualMipAmount": 1033.8
      },
      {
        "year": 19,
        "averageOutstandingBalance": 181037.7,
        "monthlyMipAmount": 81.55,
        "annualMipAmount": 978.6
      },
      {
        "year": 20,
        "averageOutstandingBalance": 170142.01,
        "monthlyMipAmount": 76.64,
        "annualMipAmount": 919.68
      },
      {
        "year": 21,
        "averageOutstandingBalance": 158516.63,
        "monthlyMipAmount": 71.4,
        "annualMipAmount": 856.8
      },
      {
        "year": 22,
        "averageOutstandingBalance": 146112.68,
        "monthlyMipAmount": 65.82,
        "annualMipAmount": 789.84
      },
      {
        "year": 23,
        "averageOutstandingBalance": 132878.01,
        "monthlyMipAmount": 59.86,
        "annualMipAmount": 718.32
      },
      {
        "year": 24,
        "averageOutstandingBalance": 118757,
        "monthlyMipAmount": 53.49,
        "annualMipAmount": 641.88
      },
      {
        "year": 25,
        "averageOutstandingBalance": 103690.28,
        "monthlyMipAmount": 46.71,
        "annualMipAmount": 560.52
      },
      {
        "year": 26,
        "averageOutstandingBalance": 87614.52,
        "monthlyMipAmount": 39.47,
        "annualMipAmount": 473.64
      },
      {
        "year": 27,
        "averageOutstandingBalance": 70462.13,
        "monthlyMipAmount": 31.74,
        "annualMipAmount": 380.88
      },
      {
        "year": 28,
        "averageOutstandingBalance": 52161.01,
        "monthlyMipAmount": 23.5,
        "annualMipAmount": 282
      },
      {
        "year": 29,
        "averageOutstandingBalance": 32634.22,
        "monthlyMipAmount": 14.7,
        "annualMipAmount": 176.4
      },
      {
        "year": 30,
        "averageOutstandingBalance": 11799.68,
        "monthlyMipAmount": 5.32,
        "annualMipAmount": 63.84
      }
    ],
    "upfrontMipFinanced": true,
    "conformingLoanLimit": 832750,
    "highBalanceMipThreshold": 726200,
    "program": "FHA"
  },
  "formulaVersion": "fha-mortgage-insurance-htcalc-719df2c0e105",
  "units": {
    "upfrontMipRate": "ratio",
    "annualMipRate": "ratio",
    "upfrontMipAmount": "USD",
    "monthlyMipAmount": "USD/month",
    "totalMipCost": "USD"
  },
  "assumptions": [
    "HT Calc policy snapshot 719df2c, November 2026. Program comparisons are planning estimates. A lender determines underwriting and eligibility.",
    "Uses HUD Mortgagee Letter 2023-05 standard forward mortgage premiums, effective March 20, 2023. Excludes special and older refinance programs."
  ],
  "warnings": [],
  "creditCost": 2
}

Request contract

Accepted inputs

Fields for this example. Expand the schema for all supported combinations and limits.

FieldType, units and limits

baseLoanAmountRequired
number

Positive US dollars

Min 0.01 · Max 1000000000
ltvRequired
number

Base loan-to-value in percent

Min 0.01 · Max 100
loanTermYearsRequired
integer

Whole years

Min 1 · Max 30
purchasePriceRequired
number

Positive US dollars

Min 0.01 · Max 1000000000
annualInterestRateRequired
number

Annual note rate in percent; 6 means 6%

Min 0 · Max 50
upfrontMipFinancedRequired
boolean
Example request body (JSON)
{
  "baseLoanAmount": 289500,
  "ltv": 96.5,
  "loanTermYears": 30,
  "purchasePrice": 300000,
  "annualInterestRate": 6.5,
  "upfrontMipFinanced": true
}
Full JSON schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "baseLoanAmount": {
      "type": "number",
      "minimum": 0.01,
      "maximum": 1000000000,
      "description": "Positive US dollars"
    },
    "ltv": {
      "type": "number",
      "minimum": 0.01,
      "maximum": 100,
      "description": "Base loan-to-value in percent"
    },
    "loanTermYears": {
      "type": "integer",
      "minimum": 1,
      "maximum": 30,
      "description": "Whole years"
    },
    "purchasePrice": {
      "type": "number",
      "minimum": 0.01,
      "maximum": 1000000000,
      "description": "Positive US dollars"
    },
    "annualInterestRate": {
      "type": "number",
      "minimum": 0,
      "maximum": 50,
      "description": "Annual note rate in percent; 6 means 6%"
    },
    "upfrontMipFinanced": {
      "type": "boolean"
    }
  },
  "required": [
    "baseLoanAmount",
    "ltv",
    "loanTermYears",
    "purchasePrice",
    "annualInterestRate",
    "upfrontMipFinanced"
  ]
}

Production endpoint: POST https://calc.hasstechapi.com/v2/calc/fha-mortgage-insurance
Formula: fha-mortgage-insurance-htcalc-719df2c0e105

Method and sources

Forward FHA regular-MIP scenario using the source-pinned schedule and explicit financing treatment; older streamlines and special program exemptions are outside scope.

Reviewed .