Inspiration: Medical billing fraud and errors cost Everyone over $100 billion every year. Yet the average patient receives a dense, jargon-filled bill with Current Procedural Terminology (CPT) codes they've never heard of — and no way to know if they're being overcharged. I wanted to build a tool that puts the power back in the patient's hands. The idea was simple: what if anyone could upload their hospital bill and instantly know if they were being ripped off?
What It Does: MedAudit AI is a full-stack AI-powered medical bill auditor. You upload a Portable Document Format (PDF) bill and within seconds the system: Extracts every procedure code and charge using a multi-engine parser Benchmarks each charge against real Centers for Medicare & Medicaid Services (CMS) rates Detects upcoding, duplicate billing, National Correct Coding Initiative (NCCI) unbundling violations, and medical necessity issues using GPT-4.1-mini Calculates your estimated overcharge with a confidence score per issue Generates a ready-to-send dispute and appeal letter automatically
How We Built It: Backend — FastAPI + Python A 3-engine PDF extraction pipeline: pdfplumber → PyMuPDF → OCR fallback Feeding into a 5-strategy CPT extractor:
Strategy Handles: S1 — Structured table date + CPT + desc + ICD-10 + units + $amount S2 — CPT label CPT 99285: ... Charge: $1850 S3 — Tab-separated pdfplumber table rows S4 — Multiline Procedure Code: on one line, amount on next S5 — Broadest fallback Any 5-digit code near any dollar amount Each CPT code is benchmarked against a CMS rate database, then passed to GPT-4.1-mini with Retrieval-Augmented Generation (RAG) for deep semantic audit analysis.
Frontend — React + Tailwind CSS + Framer Motion
A dark-themed dashboard with animated stat cards, circular score rings, a tabbed Issues/Pricing/Appeal interface, and a patient/provider info bar parsed directly from the bill.
Challenges We Ran Into: PDF format chaos — Every hospital formats bills differently. Multiline formats, inline CPT labels, tab-separated tables, and scanned images all needed separate handling strategies
Fake CPT codes from totals — Total Charges: $10780.00 was being parsed as CPT code 10780. Fixed with a blocked-number set scanning all total/subtotal lines before finalizing extraction
Patient name parsing — Patient Name: James R. Hartwell Account #: RGH-2026-88341 all on one line caused the regex to grab Account as part of the name. Fixed with a lookahead stopping at billing keywords
AI confidence calibration — Getting GPT-4.1-mini to produce consistent, meaningful confidence scores required explicit scoring rubrics and structured output schemas in the prompt
Accomplishments That We're Proud Of: Built a parser that handles 6 completely different bill formats with zero manual configuration The system correctly flagged $38,571 in total overcharges across all 6 test bills CPT 93306 (echocardiogram) billed at $4,200 vs CMS rate of $685 — detected and flagged automatically A fully generated, personalized appeal letter ready to send to the insurance company — in under 10 seconds Clean, production-quality UI that non-technical users can navigate instantly
What We Learned: Real-world document parsing is far messier than structured data — defensive, layered extraction with multiple fallback strategies is essential The gap between CMS benchmark rates and what hospitals actually bill is staggering — and it's not an edge case, it's routine Prompt engineering for structured JSON output requires explicit schemas, scoring rubrics, and few-shot examples to be reliable Building for real patients means the UI must be as polished as the backend — confusion at the results screen is as bad as a wrong answer
What's Next for MedAudit AI: Explanation of Benefits (EOB) support — audit insurance payment decisions, not just bills Insurance-specific benchmarks — Medicare vs Medicaid vs private payer rate adjustments Multi-bill comparison — track overcharges across multiple visits over time HIPAA-compliant cloud storage — secure bill history and audit trail per patient Mobile app — photograph a physical bill and get an instant audit on the spot Real-time denial prediction — flag claims likely to be denied before submission
Log in or sign up for Devpost to join the conversation.