MicroAI Paygate
An x402-style payment gateway for AI requests. Sign EIP-712, get a signed receipt, verify the signature client-side.
Search drugs, HCPCS codes, and NDCs to see billing units, CMS NDC–HCPCS crosswalks, and Medicare Part B payment limits — every value traced to its CMS or FDA source.
FinanceTypeScript · ShellGitHub @milotic3005-designOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
S code and J code for Yak HIC
Taken from the repository README
Loading the full README.
Read the full README ↗Drug coding and reimbursement intelligence, simplified.
CodeRx lets pharmacists, infusion centers, coders, billers, revenue-cycle, and prior-authorization teams search a brand or generic drug name, HCPCS code (J, Q, C, A, P, S, NOC), NDC in any common format, or manufacturer and see the coding, package, billing-unit, and Medicare Part B reimbursement data that public CMS and FDA files support — with the source file, publication date, effective period, and import date on every section.
This application provides informational coding and reimbursement reference data. It does not constitute legal, clinical, coding, or billing advice. Codes, payment amounts, payer rules, and coverage policies can change. Verify all information with current CMS publications, the applicable payer, and your organization’s compliance policies before submitting a claim.
N4…), prefix, ingredient, manufacturer, abbreviation expansion (IVIG, MTX…), and typo tolerance — every hit explains why it matched.N4 NDC segment with unit qualifier and quantity), a vial optimizer (least-waste vial mix and whole-vial dose-rounding options within a threshold you set), and a printable worksheet with no patient fields./tools): a chargemaster & formulary audit (terminated codes, NDCs missing from the CMS crosswalk, mismatched code–NDC pairs, FDA listing problems, payment limits, MUEs; CSV export), a margin analyzer (your acquisition cost vs. the Part B payment net of sequestration — costs never leave the browser), a biosimilar comparator, and what changed this quarter (payment-limit movers, new/terminated drug codes, crosswalk changes, a personal watchlist).data, meta.pagination, meta.match, meta.provenance, error).| Source | Publisher | Cadence | In CodeRx |
|---|---|---|---|
| HCPCS Level II quarterly file + NOC code list | CMS | Quarterly | 2023-Q1 → 2026-Q4 in production (all quarterly files CMS still posts) |
| Medicare Part B drug payment limit (ASP) files + “Not payable” list | CMS | Quarterly + revisions | 2021-Q1 → 2026-Q4 in production |
| NDC–HCPCS crosswalks (ASP, OPPS, AWP, PrEP, NOC) | CMS | Quarterly + revisions | 2021-Q1 → 2026-Q4 in production |
| NDC Directory (finished drugs) + excluded listings | FDA | Daily | Clinician-administered Rx + every CMS-crosswalked NDC |
| Purple Book (licensed biologics) | FDA | Monthly | Latest month |
| NCCI Medically Unlikely Edits — practitioner, outpatient hospital, DME supplier | CMS | Quarterly | Current quarter; HCPCS Level II rows only (CPT rows dropped) |
| Drug Products in the Medicaid Drug Rebate Program (data.medicaid.gov) | CMS | Quarterly | Newest quarter for indexed NDCs (unit type, units per package, COD status, termination); the ~330 MB file is streamed and filtered |
| Apple Health (Medicaid) Home Infusion Therapy/Parenteral Nutrition fee schedule | Washington State Health Care Authority | As published (effective-date releases) | Effective 2026-07-01; HCPCS Level II rows only, maximum allowable fee per payment area |
Not ingested: CMS OPPS Addendum B (distributed under the AMA CPT license), Medicare Coverage Database content such as covered diagnosis lists (its API requires accepting AMA/ADA/AHA terms limited to personal use, so CodeRx links to it instead), AWP/WAC, commercial payer rates, and all CPT/CDT content. Full catalog with URLs, formats, fields, licensing, and limitations: docs/02-data-sources.md.
Local full load (2026-10-14): 8,770 HCPCS codes (1,322 terminated), 2,306 drugs, 14,795 NDC packages, 668 manufacturers, 9,144 official NDC→HCPCS links, 99 biosimilar→reference links.
DATABASE_URL), embedded PGlite (real Postgres in WASM) for local development and tests. pg_trgm powers fuzzy search.src/ingest): manifest + landing-page discovery → download (timeout, size cap, SHA-256) → ZIP CRC-32 verification → parsers (fixed-width, CSV, TSV, XLSX) → validation → single-transaction load → derived tables (drugs, manufacturers, relationships, search index) → import report. Failures roll back and are recorded.src/proxy.ts, timing-safe admin/cron tokens, no PHI fields.Details: docs/03-architecture.md (requirements, user stories, sitemap, routes, components, schema, search, ingestion, refresh, API contracts, security, testing, deployment) and docs/04-methodology.md.
Requirements: Node.js ≥ 22 (tested on 24), npm.
npm install
npm run ingest -- --source all
npm run dev
The ingest command downloads the CMS and FDA files (about 60 MB, cached in .cache/sources), loads them into a local PGlite database in .data/pglite, and builds the search index (≈25 s on a laptop). Open http://localhost:3000.
| Command | Purpose |
|---|---|
npm run dev / build / start | Next.js development server, production build, production server |
npm run lint · npm run typecheck | ESLint (flat config) · tsc --noEmit |
npm test | Unit + integration tests (Vitest) |
npm run test:unit · npm run test:integration | One project at a time |
npm run test:e2e | Playwright end-to-end, accessibility (axe), and responsive tests |
npm run db:generate · npm run db:migrate | Create / apply SQL migrations in drizzle/ |
npm run ingest -- --source <key|all> [--quarters 8] [--force] [--no-discover] | Import data |
npm run ingest:discover | List the newest releases on the CMS/FDA pages |
npm run ingest -- --derive-only | Rebuild derived tables and the search index |
npm run fixtures -- <raw-dir> | Regenerate real-data test fixtures from original downloads |
npm run audit | npm audit --omit=dev |
Source keys: cms_hcpcs, cms_payment_limits, cms_ndc_hcpcs, fda_ndc, fda_ndc_excluded, fda_purple_book.
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Production | PostgreSQL connection string (Neon pooled URL recommended). Unset locally → PGlite. |
CODERX_ADMIN_TOKEN | Optional | ≥ 32-char secret enabling POST /api/admin/import. Unset → endpoint returns 404. |
CRON_SECRET | Production | Secret Vercel Cron sends to /api/cron/refresh. |
CODERX_FDA_REFRESH_DAYS | Optional | Minimum days between FDA NDC imports (default 7). |
CODERX_MIN_PERIOD | Optional | Earliest CMS quarter to import, YYYY-Qn (default 2021-Q1). Failed releases older than it are purged on refresh. |
NEXT_PUBLIC_SITE_URL | Optional | Canonical base URL (defaults to the Vercel production domain). |
CODERX_PGLITE_DIR | Local only | PGlite data directory (default .data/pglite; memory:// for tests). |
CODERX_DB_POOL_MAX | Optional | Pool size per instance (default 5). |
See .env.example.
All endpoints return { data, meta, error }. Read endpoints are CDN-cacheable (s-maxage=300) and rate limited per IP.
| Endpoint | Description |
|---|---|
GET /api/search?q= | Ranked results; filters kind, family, status, manufacturer, form, route, brand, biosimilar, payment, noc, effectiveOn; sort, page, pageSize |
GET /api/suggest?q= | Grouped type-ahead suggestions |
GET /api/hcpcs/{code} | Code detail with history, payments, crosswalk, provenance |
GET /api/drugs/{slug} | Drug detail with products, packages, codes, biosimilars |
GET /api/ndc/{ndc} | NDC detail (any unambiguous format) |
GET /api/manufacturers/{id|slug} | Labeler with drugs and codes |
GET /api/sources | Every imported release with checksum and dates |
GET /api/health | Database connectivity and data freshness |
GET /feeds/changes?codes= | RSS 2.0 feed of the latest two quarters' changes; codes (comma-separated HCPCS) filters to a watchlist |
POST /api/audit | Batch check of up to 500 {"hcpcs","ndc"} items against CMS/FDA data (codes and NDCs only; rate limited to 30/min per IP) |
POST /api/admin/import | Authorization: Bearer $CODERX_ADMIN_TOKEN; body {"source":"all","force":false,"latestOnly":true} |
Example:
curl -s "https://<your-domain>/api/search?q=0006-3026-02" | jq '.data.hits[0]'
npm test
npm run test:e2e
Fixtures in tests/fixtures are unmodified excerpts of the real files; see tests/fixtures/PROVENANCE.md. More in docs/06-testing.md.
coderxnsl, region iad1, Neon Postgres). The earlier addresses coderx-omega.vercel.app and coderx-milotic3005-8754s-projects.vercel.app redirect here (308, set in vercel.json).BASE_URL=https://… npm run test:e2e:prodcreate_git_project), framework Next.js, region iad1. vercel.json sets the build command (npm run vercel-build = migrations + next build) and a daily cron.DATABASE_URL.CRON_SECRET and CODERX_ADMIN_TOKEN (sensitive) in Project → Settings → Environment Variables.for s in cms_hcpcs cms_payment_limits cms_ndc_hcpcs fda_ndc fda_ndc_excluded fda_purple_book; do
curl -sS -X POST "https://<your-domain>/api/admin/import" \
-H "Authorization: Bearer $CODERX_ADMIN_TOKEN" -H "Content-Type: application/json" \
-d "{\"source\":\"$s\",\"latestOnly\":false}" | jq '.data.outcomes | map({sourceKey, period, status, reason})'
done
Alternatively run npm run ingest -- --source all locally with DATABASE_URL set to the Neon connection string.
7. Smoke test /api/health, a search, a detail page, and the mobile layout.
Operations, refresh schedule, rollback, and manual review: docs/05-operations.md.
npm audit --omit=dev: 0 vulnerabilities in runtime dependencies. Development-only findings remain in tooling transitive dependencies (braces via eslint-config-next → fast-glob; esbuild ≤ 0.24.2 bundled by drizzle-kit); neither is shipped to or executed by the deployed app. The unmaintained npm xlsx package was deliberately avoided (CodeRx ships a small CRC-checked XLSX reader).
CODERX_MIN_PERIOD); older CMS postings use unsupported formats.Code © the CodeRx authors. Data: CMS and FDA (public domain U.S. Government works) and the Washington State Health Care Authority (state government publication). CPT® is a registered trademark of the American Medical Association; no CPT content is included. CodeRx is not affiliated with or endorsed by CMS, FDA, Medicare, or any payer.