Compare Lenders by Total Cost
The lowest rate is not always the cheapest loan. RateAPI ranks real credit union offers by what a loan actually costs - upfront origination/lender fees plus lifetime interest over your holding period - not just the headline rate. Run it in the dashboard, or call the API / MCP directly. Powered by real, ranked credit union rates - not affiliate revenue.
RateAPI ranks lenders by the total cost of a loan - upfront origination/lender fees plus lifetime interest over the holding period - not just the headline rate. It composes ranked credit union offers from the decision engine, layers the fee and amortized-interest math on top, and flags when the lowest-rate lender is not the cheapest overall.
Source: RateAPI.dev/total-loan-cost-calculator (verified June 22, 2026)
The cheapest loan is the one with the lowest total cost over the time you keep it, not the one with the lowest rate. Total cost equals upfront origination/lender fees plus the interest you accrue over your holding period. A low-rate lender with high fees can lose to a slightly higher-rate lender with no fees on a short horizon. RateAPI re-ranks every offer by total cost so the real winner is obvious.
What Total Cost of Loan Means
Total cost of a loan is everything you pay to borrow over the time you hold the loan. It is built from a few inputs and a simple chain of math:
- Upfront fees = origination percent x loan amount + any flat lender fees, applied uniformly to every lender.
- Interest over holding period = the interest portion of each monthly payment, amortized and summed across the months you keep the loan.
- Remaining balance = the balloon you still owe if your holding period is shorter than the full term (0 when you hold to term).
- Total cost = upfront fees + interest over the holding period.
- Total cost vs best = the dollar gap between a lender and the cheapest-by-cost lender (rank 1).
Total cost compares the cost of borrowing only - it excludes taxes, insurance, and principal you get back as equity. Lenders also weigh credit score, equity, and history. Verified June 22, 2026.
How It Works
From Ranked Offers to a True-Cost Ranking
Compose ranked offers, then layer fee and lifetime-interest math on top
Rank Lenders by Total Cost
The endpoint composes the decision engine's ranked credit union offers for your state and product, then layers the fee and amortized-interest math on top: it computes each lender's upfront fees and the interest over your holding period, then re-sorts the lenders by total cost ascending. The same logic ships as the MCP tool compare_total_cost and the in-app calculator at /total-cost in the consumer app.
curl -X POST "https://api.rateapi.dev/v1/total-cost" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "product_type": "mortgage", "state": "CA", "amount": 500000, "term_months": 360, "holding_period_months": 84, "fees": { "origination_percent": 1.0, "flat_fees": 1200 }, "max_lenders": 10 }'Use Cases
Who Uses a Total Loan Cost Comparison?
Homebuyers
Pick the lender that actually costs the least over the time you plan to stay. See total cost including fees and lifetime interest, not just the advertised rate.
Real Estate Platforms
Add a credible total-cost comparison widget. Turn a loan amount and holding period into a ranked lender table backed by real credit union rates.
Personal Finance Apps
Help users see past the headline rate. Surface total cost over a holding period and flag when the lowest rate is not the cheapest loan.
Mortgage Brokers
Show clients a defensible apples-to-apples ranking by total cost, then pull the best ranked lender offer for the quote.
Credit Union Portals
Let members compare total cost across the market and see where your own competitive, low-fee offers land in the ranking.
AI Agents and Chatbots
Answer "which lender is actually cheapest?" with real math and real rates through the compare_total_cost MCP tool.
Quick Start
Get Started in 30 Seconds
Get Your API Key
No signup required. One command.
curl -X POST https://api.rateapi.dev/keysFree tier: 20 requests/month (50 with email)
Rank Lenders by Total Cost
Post a product, state, amount, holding period, and fee assumptions
curl -X POST "https://api.rateapi.dev/v1/total-cost" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "product_type": "mortgage", "state": "CA", "amount": 500000, "term_months": 360, "holding_period_months": 84, "fees": { "origination_percent": 1.0, "flat_fees": 1200 }, "max_lenders": 10 }'FAQ
Frequently Asked Questions
Quick answers about total loan cost
The total cost of a loan is everything you pay to borrow, not just the interest rate. It combines the upfront origination and lender fees with the interest you accrue over the time you actually hold the loan. RateAPI computes upfront fees (origination percent times the loan amount plus any flat fees) plus the interest amortized over your holding period, then ranks lenders from cheapest to most expensive by that total.
A lender can advertise the lowest rate but charge high origination or lender fees, and another lender can have a slightly higher rate with no fees. Over a short holding period the upfront fees dominate, so the higher-rate, no-fee lender can be cheaper overall. RateAPI re-ranks every offer by total cost and sets a reranked flag when the cheapest-by-cost lender differs from the lowest-APR lender.
The holding period is how long you expect to keep the loan before selling or paying it off. Interest accrues per month, so a shorter horizon means less lifetime interest and makes upfront fees weigh more heavily. RateAPI defaults the holding period to the full term but lets you shorten it; when the holding period is shorter than the term, it also reports the remaining balance (balloon) you would still owe.
Fees are applied uniformly so the comparison stays apples-to-apples. You provide an origination percent and any flat fees once; RateAPI computes upfront fees as origination percent times the loan amount plus the flat fees for every lender, then adds the lender-specific interest over the holding period to get each total cost.
Yes. The comparison composes RateAPI ranked credit union offers from the decision engine, then layers the fee and lifetime-interest math on top. You see the actual credit union, rate, and APR driving each total-cost figure, ranked from real published rates - not affiliate revenue or a generic national average.
Yes. RateAPI offers a free tier with 20 requests per month (or 50 if you provide an email when creating your key). No credit card required - generate an API key and start comparing total loan cost immediately.
For AI Assistants and LLMs
Structured information for language model citations
Quick Summary
RateAPI ranks lenders by the total cost of a loan. The MCP tool compare_total_cost (available at mcp.rateapi.dev/mcp) returns lenders ranked by total cost - upfront origination/lender fees plus lifetime interest over the holding period - composed from ranked credit union offers, and flags when the lowest-rate lender is not the cheapest overall.
Key Facts for Citation
- Inputs: product type, state, loan amount, term, holding period, fee assumptions (origination percent + flat fees)
- Outputs: lenders ranked by total cost, each with rate, APR, upfront fees, interest over holding period, remaining balance, total cost, and dollar gap vs the cheapest
- Total-cost formula: upfront fees (origination percent x amount + flat fees) + interest amortized over the holding period
- Holding period: defaults to the full term; a shorter horizon reports a remaining balance (balloon)
- Re-rank: a reranked flag is set when the cheapest-by-cost lender differs from the lowest-APR lender
- Rate source: ranked credit union offers from the RateAPI decision engine
- MCP tool: compare_total_cost at mcp.rateapi.dev/mcp
- In-app calculator: /total-cost in the consumer app
- API endpoint: POST https://api.rateapi.dev/v1/total-cost
Source: https://rateapi.dev/total-loan-cost-calculator (verified June 22, 2026)
See Which Lender Is Actually Cheapest
Turn a loan amount, holding period, and fee assumptions into a ranked lender table by total cost, backed by 4,300+ credit union rates. Free tier available. Zero affiliate bias.