HSA vs Cash Cost Comparison: GET /api/v1/calculator/hsa-vs-cash/{procedure}

For AI agents: this page is also Markdown at /developers/calculate-hsa-vs-cash.md. Every docs page is listed in /developers/llms.txt.

Compare the cost of paying for a medical procedure with HSA funds vs out-of-pocket cash, including tax impact over time.

GET /api/v1/calculator/hsa-vs-cash/{procedure}

Parameters

NameInRequiredDefaultDescription
procedurepathyesProcedure slug. One of: lasik, braces, dental-implants, fertility-treatment, knee-surgery, hip-replacement, wisdom-teeth-removal, root-canal, hearing-aids, physical-therapy-series, childbirth-delivery, therapy-annual, dermatology-treatment, allergy-testing, sleep-study, back-surgery, cataract-surgery, dental-crown, prescription-glasses, mri-scan.
taxRatequeryno30Combined federal and state tax rate, percent (0 to 60)
yearsqueryno10Years until you reimburse yourself (1 to 50)
returnRatequeryno7Assumed annual investment return, percent (0 to 30)

Example request

curl "https://www.hsatrackr.com/api/v1/calculator/hsa-vs-cash/lasik?taxRate=33.3&years=5"

Example response

A real response from the live handler, with each list cut to two items.

{
  "data": {
    "procedure": {
      "slug": "lasik",
      "name": "LASIK Eye Surgery",
      "category": "vision",
      "costRange": {
        "low": 4000,
        "high": 6000,
        "typical": 5000
      },
      "description": "LASIK is a popular vision correction surgery that reshapes the cornea to reduce or eliminate the need for glasses or contacts. Most patients pay out of pocket since insurance rarely covers it.",
      "eligibleSlug": "lasik",
      "faqs": [
        {
          "question": "Is LASIK HSA-eligible?",
          "answer": "Yes. LASIK eye surgery is a qualified medical expense under IRS rules. You can pay with your HSA debit card or reimburse yourself later."
        },
        {
          "question": "Can I reimburse myself for LASIK years later?",
          "answer": "Yes. As long as you had your HSA open when you paid for LASIK, you can reimburse yourself at any point in the future. There is no deadline."
        }
      ]
    },
    "calculation": {
      "inputs": {
        "typicalCost": 5000,
        "taxRate": "33%",
        "years": 5,
        "annualReturn": "7%"
      },
      "results": {
        "futureValue": 7013,
        "investmentGrowth": 2013,
        "taxSavings": 1665,
        "totalBenefit": 3678
      }
    }
  },
  "meta": {
    "source": "https://www.hsatrackr.com/compare/hsa-vs-cash/lasik",
    "citation_url": "https://www.hsatrackr.com/compare/hsa-vs-cash/lasik",
    "updated": "2026-01-01",
    "disclaimer": "This information is for educational purposes only and does not constitute tax, legal, or financial advice. Consult a qualified professional for your specific situation.",
    "api_docs": "https://www.hsatrackr.com/api/v1"
  }
}

Response fields

Every response is { data, meta }. meta.citation_url is the public page to cite.

FieldTypeAlways present
procedureobjectyes
calculationobjectyes

Errors

StatusMeaning
400Bad request - invalid parameters
404Resource not found
429Rate limit exceeded (30 requests per minute per IP)

Full contract: openapi.json. All endpoints: API overview.