Eyedralite Developer Portal: Optics REST API, Streamable HTTP MCP & Embed Widget

Platform Overview

The Eyedralite Developer Portal provides the canonical reference for the metered Zero-PHI Optics REST API (/api/v1/optics/*), Streamable HTTP MCP server (/api/v1/mcp), <eyedralite-calc> Shadow DOM widget, and live OpenAPI 3.1.0 schema.

Zero-PHI Boundary: Every B2B route enforces strict Zero-PHI Zod validation, 16 KiB max payload size, X-API-Key or Bearer scopes (optics:read, mcp:invoke), and X-RateLimit-* quota headers.

  1. Inspect service discovery & OpenAPI 3.1.0: Fetch GET https://api.eyedralite.com/ (200 JSON) or GET https://api.eyedralite.com/api/v1/openapi.json to discover live endpoints, rate-limit headers, and strict request schemas.
  2. Authenticate B2B requests with X-API-Key or Bearer scopes: Send your scoped API key using X-API-Key or Authorization: Bearer to call /api/v1/optics/{vertex,parse,lars,scor,bvd,rgp,multifocal,fhir} with zero patient identifiers.
  3. Connect AI agents via MCP or embed <eyedralite-calc>: Point MCP clients to POST https://api.eyedralite.com/api/v1/mcp (JSON-RPC 2.0) or drop @optom/calc-widget into clinical portals via encapsulated Shadow DOM.

Metered B2B Optics REST API (/api/v1/optics/*)

Authenticate with X-API-Key or Authorization: Bearer using scopes optics:read (REST) and mcp:invoke (MCP). Strictly Zero-PHI (max 16 KiB JSON payload) across vertex, parse, lars, scor, bvd, rgp, multifocal, and fhir.

  • POST /api/v1/optics/vertex
  • POST /api/v1/optics/parse
  • POST /api/v1/optics/lars
  • POST /api/v1/optics/scor
  • POST /api/v1/optics/bvd
  • POST /api/v1/optics/rgp
  • POST /api/v1/optics/multifocal
  • POST /api/v1/optics/fhir

Streamable HTTP MCP Server (/api/v1/mcp)

POST JSON-RPC 2.0 requests to /api/v1/mcp (tools: optics_vertex, optics_parse, optics_lars, optics_scor, optics_bvd, optics_rgp, optics_multifocal, optics_fhir). Returns 405 METHOD_NOT_ALLOWED for GET/DELETE.

Shadow DOM Embed Widget (@optom/calc-widget)

Embed <eyedralite-calc active-tool="vertex" tools="all" theme="light" locale="en"></eyedralite-calc> with isolated Shadow DOM styles, WCAG 2.2 AA contrast, and zero external PHI telemetry.

OpenAPI 3.1.0 Specification & Curl Quickstart

Inspect https://api.eyedralite.com/api/v1/openapi.json or run GET https://api.eyedralite.com/ with Accept: application/json.

curl -sS https://api.eyedralite.com/api/v1/optics/vertex -H "X-API-Key: optom_live_..." -H "Content-Type: application/json" -d '{"OD":{"sphere":-5.5,"cylinder":-1.75,"axis":180,"bvdMm":12},"roundingMode":"quarter-diopter"}'

Frequently Asked Questions

What endpoints are exposed in the public B2B OpenAPI 3.1.0 specification?

GET /api/v1/openapi.json publishes only root service discovery, /api/health, /api/v1/docs, the 8 /api/v1/optics/* REST endpoints, and POST /api/v1/mcp, keeping internal BFF session, billing, and OCR routes excluded.

How does the API enforce Zero-PHI and rate-limit protections?

All metered endpoints reject unrecognized fields with 400 VALIDATION_ERROR, cap JSON payloads at 16 KiB (413 PAYLOAD_TOO_LARGE), require optics:read or mcp:invoke keys, and emit X-Request-Id, X-API-Version, and X-RateLimit-* headers.