# 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](https://www.hsatrackr.com/developers/calculate-hsa-vs-cash.md). Every docs page is listed in [/developers/llms.txt](https://www.hsatrackr.com/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.

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

## Parameters

| Name | In | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `procedure` | path | yes |  | Procedure 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. |
| `taxRate` | query | no | `30` | Combined federal and state tax rate, percent (0 to 60) |
| `years` | query | no | `10` | Years until you reimburse yourself (1 to 50) |
| `returnRate` | query | no | `7` | Assumed annual investment return, percent (0 to 30) |

## Example request

```bash
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.

```json
{
  "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.

| Field | Type | Always present |
| --- | --- | --- |
| `procedure` | object | yes |
| `calculation` | object | yes |

## Errors

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

Full contract: [openapi.json](https://www.hsatrackr.com/openapi.json). All endpoints: [API overview](https://www.hsatrackr.com/developers).
