Inspiration

An uninsured ER visit in California can mean a five figure bill. Most people pay what they can, or the bill goes to collections and follows them for years.

What they usually don't know is that California law may already make that bill discounted, or even free. Uninsured patients at or below 400% of the federal poverty line qualify for discounted payment. Since January 2025, hospitals can't count your savings, can't set deadlines for applying, and can't report hospital debt to credit bureaus.

The information to check a bill is all public. It just sits in hospital price files up to 90 MB and in long policy PDFs that no patient will read. Many of these patients speak Spanish at home, and often a kid ends up translating the bill at the kitchen table. I wanted that family to be able to check the bill from a phone in a few minutes.

What it does

Recount checks a hospital bill against the hospital's own prices and California law, then writes the letters to fix it. One step per screen, in English or Spanish.

  1. Reads the bill. Take a photo or upload a PDF, up to 6 pages. Claude reads every line. Azure AI Document Intelligence reads the charges a second time, and code compares the two. A single reader sometimes "fixes" a line so the total adds up, which would hide a real billing error. When the two reads disagree, the app asks you: "We read $X. A second look read $Y. Which is on your bill?"
  2. Finds your hospital among all 470 in California's state registry. If the name isn't clear, you pick it. It never guesses silently.
  3. Checks every charge against the hospital's own published prices, for 340 of 470 hospitals. It catches lines billed twice and charges above the hospital's own list price. Each finding shows what you could save and links to the source.
  4. Checks if the law covers you. Three questions: household size, income and insurance. Rules in code decide, never the AI, and every answer shows the rule behind it.
  5. Quotes your hospital's own policy when it conflicts with state law, right in your letter.
  6. Writes your letters. Claude drafts a financial assistance request and a billing dispute. Then code checks every dollar amount in them against the bill. You read, edit and approve. Recount never sends anything for you.
  7. Stays with you after. A checklist for calling billing, a check-in date, and a complaint to the state if the hospital says no.

Lupa, the in-app helper, answers questions about your own bill in plain English or Spanish, like "Why do I owe $0?" or "Is this collection letter real?". It can quote a hospital's own policy, and it only talks about your bill.

You always know who did what. Each bill lists the steps done by fixed rules and every AI call made for it. AI reads and writes. It never decides who qualifies, computes a dollar amount, or sends anything.

It works on the web, Android and iPhone, with large text and high contrast modes, and no account needed.

The hospital audit

Checking one bill wasn't enough. I wanted to know whether the hospitals themselves follow the law.

I read the financial assistance policies of all 470 California hospitals on file with the state, 2,333 documents in total, against six rules from the 2025 law changes. Pattern rules found 997 suspicious sentences. Claude reviewed each one against the law's own text and had to quote the exact words its verdict rests on, or the flag was dropped. A second review then argued the hospital's side, and when the two disagreed, the milder verdict won.

Result Hospitals
Plain conflict with state law 14
Likely conflict 47
Worth asking about 192

One example: PIH Health Whittier's policy says to "consider individual or family net worth including all liquid and non-liquid assets owned", allows credit reporting after 180 days, and allows a lien on a qualifying patient's home. California bans all three.

The second review also cleared flags it couldn't stand behind, including one at San Francisco's public hospital. I'd rather miss a problem than accuse a hospital wrongly. These are my readings of public documents, not legal findings.

How I built it

  • Claude is the main model. It reads bill photos into a strict schema with structured outputs, writes the letters from a fixed set of facts, powers Lupa, and did both reviews in the audit.
  • Microsoft Azure runs four services in production.
    • Azure AI Content Safety checks every chat message and every reply before it is shown, so harmful content never reaches a patient. Signs of self-harm get 988 and 911 instead of a refusal, and a patient describing an injury is never blocked.
    • Azure AI Document Intelligence reads the charges a second time so the two reads can be compared.
    • Azure AI Search holds the 997 audit sentences with vector and keyword search, so Lupa can quote a hospital's own policy.
    • Azure OpenAI (gpt-4.1-mini) is the backup model if Claude is down.
  • Apify. I built and published an Actor, Hospital Price & Charity Care Finder. It finds a hospital's price file, streams files over 90 MB, and returns the price for each billing code. It also reads income limits out of charity care policies, with the sentence each one came from. I ran it on all 470 California hospitals and kept a file only when it clearly belongs to that hospital. That gave price checks for 336 hospitals beyond San Francisco.
  • Convex runs the backend. The bill photo goes to file storage, a scheduled action runs every check, and each step is written to a table the phone subscribes to, so the patient watches every check finish live instead of staring at a spinner. Optional accounts use Convex Auth.
  • Next.js for the web app, Expo for the Android and iPhone app on the same backend, Python for the crawl and audit, and Rust for a price file audit.
  • One model layer. Every AI call goes through one file that logs the task, model and time, and can switch providers per task without touching the app.

Testing

Real patient bills can't be shared, so I generated test bills priced from real hospital charges, planted errors in them, and rendered them as scans, phone photos and PDFs.

  • On 30 bills, Claude read 181 of 181 lines right, and the checks caught 24 of 24 planted errors with no false alarms.
  • Azure gpt-4.1-mini read 95.6% of lines and caught 18 of 24, so Claude stays the reader and gpt-4.1-mini is the backup.
  • On 50 harder bills, crumpled, folded, blurred, dim and marked with pen and coffee, Claude read 98% of lines right. That test found three real bugs, now fixed.

Checking one bill end to end costs about 10 cents.

Challenges

  • Messy data. Hospital price files are huge, come in three formats, and hide behind CDN links. Charity care PDFs mix current limits with old ones, so a simple search picks up the wrong number.
  • Not accusing anyone wrongly. Many policy sentences mention deadlines or credit reporting while following the law. A hospital is flagged only if a reviewer can quote the words that break the rule.
  • Spanish without breaking the letters. The patient reads everything in Spanish, but the billing office reads English. Letters stay in English, with a Spanish copy for the patient.
  • Doing it solo in one weekend: web app, phone app, backend, Apify Actor, a statewide audit and an eval set.

What I'm proud of

Every finding points to a line on the bill and a published price or a quoted sentence. Nothing on screen is a model's unsupported claim. Eligibility and price checks are plain rules anyone can test. And it's live today, so anyone can check their own bill.

What I learned

The law is more generous than most patients think. The hard part is the paperwork. AI works best on the messy parts, reading photos and writing plain letters, and code should handle everything that has a right answer.

What's next

  • Testing with real patients and the people who help them, like financial counselors and legal aid
  • Reading the 7 hospitals that only filed scanned policies
  • Computing the Medicare payment cap from CMS fee schedules
  • ER physician bills, which follow different rules
  • Chinese and Tagalog after Spanish

The full writeup, eval and audit method are in the GitHub repo.

Thanks

Thanks to Daniel Lui, Cal Hacks mentor, for the advice on reimbursement and HL7, and for backing my use of HCAI's official data.

Built With

Share this project:

Updates

Submission history