← All APIs Math

Mortgage & Loan Amortization Calculator API

Exact monthly payment and full amortization schedule for any fixed-rate loan

Give this API a loan amount, an interest rate, and a repayment term, and it hands back the precise monthly payment plus a complete schedule showing — for every single month — how much goes to interest, how much reduces the balance, and what you still owe. You can also ask 'what if I pay an extra $300 a month?' or 'what if I make a $10,000 lump payment in month 24?' and it will tell you exactly how many months you save and how much interest you avoid. Every number is computed with banker's rounding and a pinned arithmetic rule so that two correct systems running the same inputs produce identical results, down to the cent. No rate lookups, no market data — you supply the rate, the API does the math.

POSThttps://mortgage-amortization.underscoredone.com/calculate
Pricing

$0.01 per request — pay via x402/USDC. No account needed.

How to call

POST to /calculate with principal (positive number), annual_rate_percent (0 or above), term_months (1 or above), and start_date (YYYY-MM-DD for the first payment). Optional: extra_monthly_payment (recurring extra principal each month), one_time_payments (list of objects with 'month' and 'amount' keys for lump-sum payments), summary_only (true to skip the row-by-row schedule array), and rounding (decimal places, default 2). The top-level scheduled_payment field is always the base principal-and-interest payment without extras. Use with_extra_payments block when extras are supplied. The schedule array reflects actual cash paid each month including extras. All dates are YYYY-MM-DD. Raises 400 for invalid inputs such as negative principal or zero term.

Input parameters
NameTypeRequiredDescription
principalnumberyesThe total amount borrowed, in dollars. Must be greater than zero.
annual_rate_percentnumberyesThe yearly interest rate as a plain percentage — enter 6.5 for 6.5%. Enter 0 for an interest-free loan. Must be zero or above.
term_monthsintegeryesHow many monthly payments the loan spans. A 30-year mortgage is 360; a 5-year car loan is 60. Must be at least 1.
start_datestringyesThe date of the very first payment, written as YYYY-MM-DD (for example, 2026-07-01).
extra_monthly_paymentnumbernoAn optional extra amount you put toward principal every single month, on top of the required payment. Defaults to 0.
one_time_paymentsarraynoAn optional list of one-time lump-sum principal payments. Each item needs a 'month' and an 'amount'.
summary_onlybooleannoSet to true if you only want the totals and scheduled payment — no row-by-row schedule.
roundingintegernoHow many decimal places to round every money value to. Default is 2 (cents). Valid range is 2 to 6.
Example requests
Typical input
{
  "principal": 400000,
  "annual_rate_percent": 6.5,
  "term_months": 360,
  "start_date": "2026-07-01",
  "extra_monthly_payment": 300,
  "one_time_payments": [
    {
      "month": 24,
      "amount": 10000
    }
  ],
  "summary_only": false,
  "rounding": 2
}
Zero or empty input
{
  "principal": 10000,
  "annual_rate_percent": 0,
  "term_months": 12,
  "start_date": "2026-01-01",
  "extra_monthly_payment": 0,
  "one_time_payments": [],
  "summary_only": true,
  "rounding": 2
}
Invalid input (400 error)
{
  "principal": -5000,
  "annual_rate_percent": 6.5,
  "term_months": 0,
  "start_date": "not-a-date"
}
Large input
{
  "principal": 2500000,
  "annual_rate_percent": 7.25,
  "term_months": 360,
  "start_date": "2025-01-01",
  "extra_monthly_payment": 1000,
  "one_time_payments": [
    {
      "month": 12,
      "amount": 50000
    },
    {
      "month": 60,
      "amount": 100000
    }
  ],
  "summary_only": false,
  "rounding": 2
}
Example response
{
  "api_version": "1.0.0",
  "inputs_echo": {
    "principal": 400000,
    "annual_rate_percent": 6.5,
    "term_months": 360,
    "start_date": "2026-07-01"
  },
  "rounding": {
    "mode": "half_even",
    "decimals": 2,
    "final_payment_adjusted": true
  },
  "scheduled_payment": 2528.27,
  "summary": {
    "total_paid": 910179.81,
    "total_interest": 510179.81,
    "final_payment": 2530.88,
    "payoff_date": "2056-06-01",
    "scheduled_term_months": 360
  },
  "with_extra_payments": null,
  "schedule": []
}
Error responses
StatusMeaning
400Bad request — your input failed validation or could not be processed. Check the detail field for specifics.
402Payment required. Send a signed USDC payment on Base Mainnet using the x402 protocol.
422Unprocessable — a required field is missing or the wrong type. Check the detail field for specifics.
Links