Calculate loan payments and total interest (without letting an LLM do the math)

Amortization is a formula, not a judgment call. When customers see a monthly payment, it has to be exact to the cent and the same every time, whichever model or code path produced it. Calling an API gives you that.

Prefer video? · 0:59

Loan payments and total interest in one call

Monthly payment, total interest and the first and last payment split for any amount, rate and term.

Make the request

Send your API key in the x-api-key header. Free accounts include 1,000 calls a month.

curl "https://apistack.online/api/finance/loan-calculator/v1/payment?principal=350000&rate=6.5&term=30" \
  -H "x-api-key: $APISTACK_API_KEY"
200 OK · response
{
  "success": true,
  "calculator": "loan-payment",
  "loanDetails": {
    "principal": 350000,
    "annualRate": 6.5,
    "termYears": 30,
    "loanType": "personal"
  },
  "paymentCalculation": {
    "monthlyPayment": 2212.24,
    "totalAmount": 796405.71,
    "totalInterest": 446405.71,
    "totalPrincipal": 350000,
    "interestPercentage": 56.05,
    "firstPayment": {
      "total": 2212.24,
      "principal": 316.4,
      "interest": 1895.83
    },
    "finalPayment": {
      "total": 2212.24,
      "principal": 2188.27,
      "interest": 23.97
    }
  }
}

Response abridged: some fields (timestamps, metadata) omitted.

Parameters

principal is the loan amount, rate the annual interest rate in percent (6.5 means 6.5%), and term the length in years. For home loans with taxes, insurance and HOA fees, use the Mortgage Calculator API instead.

In an AI assistant

Connect the APIStack MCP server and tell the model to use tools for calculations. In our test, an OpenAI agent asked about this loan called the API and answered with exactly these figures.

Give it to your AI agent

The same API is available as an MCP tool. Add APIStack to Claude, Cursor, VS Code or any MCP client:

{
  "mcpServers": {
    "apistack": {
      "url": "https://apistack.online/api/mcp/connect",
      "headers": { "x-api-key": "YOUR_API_KEY" }
    }
  }
}

Then ask: “What is the monthly payment on a $350,000 loan at 6.5% for 30 years, and how much interest is paid in total?” See MCP setup for every client.

Related guides