Mortgage refinance estimates for AI agents

Help your human compare refinance options. Get structured pricing, collect missing details through chat, then share the secure application link with the borrower.

Estimates only. This service does not approve loans or lock rates. Atlantic Home Mortgage, LLC dba Lendtrain. NMLS #1844873. Equal Housing Opportunity.

Choose an endpoint

TaskEndpointResponse
Price a known scenarioPOST /api/agents/quoteJSON quote
Ask questions or gather detailsPOST /api/chatSSE, or JSON with stream: false

No API key required. Send requests from your server. Cross-origin browser requests are restricted.

1. Get a structured quote

Use this endpoint when you know the scenario. Its JSON fields come from the pricing service, without model-generated prices. Send every field below. Use null for unknown current-loan details.

POST /api/agents/quote
curl --fail-with-body https://www.lendtrain.com/api/agents/quote \
  -H 'Content-Type: application/json' \
  -d '{
  "state": "GA",
  "loanBalance": 340000,
  "propertyValue": 500000,
  "creditScore": 740,
  "occupancy": "primary",
  "propertyType": "singleFamily",
  "units": 1,
  "loanPurpose": "rateTermRefi",
  "cashOutAmount": 0,
  "loanTerm": 30,
  "currentLoanType": "conventional",
  "isVeteran": false,
  "currentRate": null,
  "currentMonthlyPayment": null,
  "remainingTermMonths": null,
  "currentMonthlyMip": null,
  "vaFundingFeeType": null
}'
  • Supported states: AL, FL, GA, KY, NC, OR, SC, TN, TX, UT.
  • FHA is not offered. A current FHA loan can still receive a Conventional refinance estimate.
  • VA pricing requires isVeteran: true and confirmed funding fee status. Never infer eligibility from a current VA loan.
  • VA rate-and-term pricing from a non-VA or unknown current loan needs loan officer review.
  • Closing costs and savings refer to parRate. Other options change points costs and credits.
  • Positive points and dollarAmount are borrower costs. Negative values are lender credits toward closing costs.
  • Each rate option includes APR, borrowerPaidPoints, and lenderCredit. Display APR as prominently as the rate.
  • Savings require current rate, principal-and-interest payment, remaining term, and monthly mortgage insurance. Cash-out quotes omit savings verdicts.
  • Cash-out quotes exclude other financed closing costs. VA results separately disclose financed funding fees and total loan amount. Requested cash and final net proceeds can differ.
  • Read status, products, effectiveDate, calculatedAt, assumptions, notices, and disclosure before presenting a quote.
  • A no_eligible_products result is a completed estimate. It is not a service error or a loan denial.

See OpenAPI for field values and response schemas. Quote requests have a 15-second upstream timeout and share a 10-per-minute, per-IP pricing limit.

2. Use the conversational API

The advisor uses OpenAI Luna and the same filtered quote service. Send conversation history with each request. It asks for missing details before pricing.

JSON conversation
curl --fail-with-body https://www.lendtrain.com/api/chat \
  -H 'Content-Type: application/json' \
  -d '{"stream":false,"messages":[{"role":"user","content":"What details do you need for a refinance estimate?"}]}'

JSON responses contain role, content, and quotes. Use quotes for numeric comparisons. To permit VA pricing, set vaEligibilityConfirmed: true after the borrower confirms eligibility.

Default SSE response
data: {"text":"Final assistant answer and disclosures"}

data: [DONE]
  • SSE means Server-Sent Events. Omit stream or set it to true to use this format.
  • Ignore comment lines that start with a colon. Read until data: [DONE].
  • Concatenate text fields. An error field means the request failed, even when HTTP status is 200.
  • The server buffers the final answer. Heartbeats keep the connection open while pricing runs.
  • Check Content-Type and HTTP status before parsing. Validation failures return JSON errors.
  • Chat allows 1–50 messages, each with 1–10,000 characters. The total body limit is 100 KB.
  • The chat deadline is 90 seconds. Chat requests have a 20-per-minute, per-IP limit.

3. Hand off to the borrower

When the borrower wants to proceed, share the nextStep.url from the quote. The borrower completes the application in the secure portal.

These APIs do not submit applications, pull credit, lock rates, send emails, or reserve products. Do not send Social Security numbers, dates of birth, bank accounts, or passwords. Do not describe estimates as approvals or commitments to lend.

Handle failures

JSON errors contain error and code. Failed SSE requests emit the same fields before [DONE].

  • 400: Correct missing or invalid input. Remove sensitive information from all conversation history.
  • 403: Use a server-side client or an allowed site origin.
  • 413: Reduce the request below 100 KB.
  • 429: Wait for Retry-After, or 60 seconds for a stream error.
  • 502, 503, 504: Retry later with bounded backoff. Do not invent a quote or use old prices as current.

Integration references

These endpoints use custom HTTP contracts. They do not implement A2A task methods or expose a public MCP transport. Use the documented APIs for borrower-facing estimates.

Contact Lendtrain: (678) 528-0253 or team@lendtrain.com.