Longitudinal. Multimodal. Deterministic.
The only clinical AI that accumulates patient history — not just today's snapshot.
Contents
Quick Start Authentication Longitudinal Patient API NEW ECG Analysis NEW Longitudinal ECG History NEW Risk Score (single-call) Glucose Estimation Patient Report Usage Pricing Get API Key

Quick Start

Register → get a key → log patient vitals → fetch longitudinal score. Three calls, full clinical intelligence.

# Step 1 — log 3 days of vitals for a patient
curl -X POST https://agatsa-one-api-651017108992.asia-south1.run.app/v1/nera-api/patient/vitals/batch \
  -H "x-api-key: ak_your_key" -H "Content-Type: application/json" \
  -d '{
    "patientRef": "pt_001",
    "days": [
      {"date":"2026-06-25","hr":92,"hrv":24,"spo2":95,"systolic":142,"diastolic":92,"glucose":128,"sleepHrs":5.2},
      {"date":"2026-06-26","hr":87,"hrv":29,"spo2":96,"systolic":137,"diastolic":89,"glucose":118,"sleepHrs":6.1},
      {"date":"2026-06-27","hr":82,"hrv":35,"spo2":97,"systolic":131,"diastolic":86,"glucose":106,"sleepHrs":7.0}
    ]
  }'

# Step 2 — get longitudinal risk score from full patient history
curl https://agatsa-one-api-651017108992.asia-south1.run.app/v1/nera-api/patient/pt_001/score \
  -H "x-api-key: ak_your_key"

Authentication

Add x-api-key: ak_... to every request. Never expose your key in client-side code — proxy through your backend server.

Keys are stored as SHA-256 hashes. Save your key on registration — it cannot be retrieved later.

Longitudinal Patient API NEW

This is the core Nera differentiator. Log vitals over time per patient — Nera accumulates the history and computes a risk score grounded in the full longitudinal record. Impossible to replicate with a single AI call.

POST /v1/nera-api/patient/vitals/batch ⭐ Recommended
Batch-log up to 30 days of vitals for a patient in a single call. Uses upsert — safe to re-send the same date to update a reading. This counts as 1 API call regardless of how many days you send.

Request body

{
  "patientRef": "pt_001",          // your internal patient ID — string, max 100 chars
  "days": [
    {
      "date":      "2026-06-25",   // YYYY-MM-DD (required per day)
      "hr":        92,             // bpm (optional)
      "hrv":       24,             // ms RMSSD (optional)
      "spo2":      95,             // % (optional)
      "systolic":  142,            // mmHg (optional)
      "diastolic": 92,             // mmHg (optional)
      "glucose":   128,            // mg/dL fasting (optional)
      "hba1c":     6.4,            // % (optional)
      "bmi":       28.1,           // kg/m² (optional)
      "steps":     3800,           // steps/day (optional)
      "sleepHrs":  5.2,            // hours (optional)
      "age":       48,             // years — supply on first log (optional)
      "gender":    "M"             // M|F|O (optional)
    }
    // ... up to 30 days
  ]
}

Response

{
  "ok": true,
  "patientRef": "pt_001",
  "daysLogged": 3
}
POST /v1/nera-api/patient/vitals
Log a single day's reading. Same fields as batch, without the days array — pass fields directly with date.
GET /v1/nera-api/patient/:patientRef/score ⭐ Core endpoint
Compute a longitudinal risk score from the patient's full logged history. The score is a 3-day smoothed average of per-day scores, so it gets more reliable as you log more data. Returns a day-by-day trend, risk flags from the most recent readings, and a clinical narrative.

Request

GET /v1/nera-api/patient/pt_001/score
x-api-key: ak_your_key

Response

{
  "ok": true,
  "patientRef": "pt_001",
  "neraScore": 68,              // 0-100, smoothed across last 3 days
  "riskCategory": "moderate",  // low | moderate | high | critical
  "scoreTrend": "improving",   // improving | stable | declining
  "scoreDelta": 14,            // points gained/lost since Day 1
  "daysAnalysed": 7,
  "trend": [                   // one entry per logged day
    { "date": "2026-06-21", "score": 54, "riskCategory": "high" },
    { "date": "2026-06-22", "score": 58, "riskCategory": "moderate" },
    { "date": "2026-06-27", "score": 68, "riskCategory": "moderate" }
  ],
  "flags": [
    { "signal":"hrv", "label":"Heart Rate Variability", "value":24,
      "threshold":40, "unit":"ms", "severity":"high", "delta":16 }
  ],
  "narrative": {
    "summary": "Patient shows improving cardiovascular markers over 7 days...",
    "topRisk": "Heart Rate Variability remains persistently low at 24ms",
    "recommendations": ["Schedule HRV-focused intervention", "..."],
    "followUpPriority": "30_days"
  },
  "computedAt": "2026-06-27T10:00:00Z"
}
Returns 404 if no vitals have been logged for this patientRef yet. Call the batch endpoint first.

ECG Analysis NEW

A 4-stage pipeline — not just a vision model. Each ECG runs through the same digitizer that has processed 12M+ SanketLife ECGs before GPT-4o ever sees it.

Pipeline stages
1. Digitizer — extracts HR from RR intervals, SDNN, rhythm regularity, STEMI territory, ST elevation per-lead from the actual waveform (objective measurements).
2. Cardiac Score + Minnesota Codes — same rules engine used by the main Agatsa app.
3. GPT-4o — reads PR/QRS/QTc from the image using the measured numbers as ground truth. Narrates findings with real values, not guesses.
4. Longitudinal store — result saved per patientRef. Retrieve full ECG history + trend via GET /patient/:ref/ecg-history.
POST /v1/nera-api/ecg/analyze
Analyze an ECG image — phone photo of a paper report, digital strip, or a scanned PDF page. Returns objective waveform measurements + clinical interpretation. Response time ~4–8 seconds.

Request body — option A: image URL

{
  "imageUrl":   "https://your-cdn.com/patient-ecg.jpg",  // public URL
  "patientRef": "pt_001",
  "age":        48         // optional — improves interpretation
}

Request body — option B: base64

{
  "imageBase64": "iVBORw0KGgoAAAANS...",  // raw base64, no data: prefix, max 5MB
  "mimeType":    "image/jpeg",            // image/jpeg | image/png | image/webp
  "patientRef":  "pt_001",
  "age":         48
}

Response

{
  "ok": true,
  "patientRef": "pt_001",
  "pipeline": "digitizer+gpt4o",

  // Objective measurements from waveform digitizer
  "measured": {
    "hrFromRR":       78,     // HR derived from RR intervals — most accurate
    "sdnnMs":         42,     // HRV proxy (SDNN of NN intervals)
    "rhythmRegular":  true,   // false = irregular rhythm (AFib candidate)
    "possibleAfib":   false,  // RR irregularity test (CV > 0.20)
    "stemiDetected":  false,
    "stemiTerritory": null,   // anterior | inferior | lateral | posterior | null
    "signalQuality":  0.91,   // 0–1
    "peaksFound":     12
  },

  // Interval measurements from image (GPT-4o)
  "rhythm":         "sinus_rhythm",
  "hrEstimate":     78,
  "qtcMs":          418,
  "prMs":           154,
  "qrsMs":          86,
  "stemiSuspected": false,
  "stemiLocation":  null,
  "afibDetected":   false,
  "lbbbDetected":   false,
  "rbbbDetected":   false,
  "bradycardiaFlag":false,
  "tachycardiaFlag":false,

  // Computed from measured features
  "cardiacScore":   84,          // 0–100, same algorithm as main Agatsa app
  "minnesotaCodes": [],          // e.g. ["6-1 (1st-degree AV block)"]

  "findings": [
    "Normal sinus rhythm at 78 bpm (measured from RR intervals)",
    "QTc 418ms — within normal range",
    "Signal quality 91%"
  ],
  "interpretation": "ECG shows normal sinus rhythm at 78 bpm. QTc 418ms and PR 154ms are within normal limits...",
  "urgency":    "routine",       // routine | urgent | emergency
  "confidence": "high",
  "disclaimer": "ECG interpretation is AI-generated. Must be reviewed by a qualified cardiologist.",
  "analyzedAt": "2026-06-27T10:00:00Z"
}
When measured.stemiDetected: true or stemiSuspected: true, urgency will be emergency. The measured block reflects objective digitizer output; the top-level fields are GPT-4o's read of the image intervals. If patientRef is supplied, this analysis is automatically stored for longitudinal ECG tracking.

Longitudinal ECG History NEW

Every ECG analyzed with a patientRef is stored. Retrieve the full history and get trend analysis across visits — QTc progression, cardiac score trend, AFib episode count, STEMI history. The same longitudinal pattern as the Agatsa heritage report, but for your patient population.

GET /v1/nera-api/patient/:ref/ecg-history ⭐ Longitudinal
Return all stored ECG analyses for a patient plus computed trends. Detects progressive QTc prolongation (silent cardiac risk), recurrent AFib, and STEMI history. Clinically equivalent to a longitudinal ECG review across visits.

Example request

curl https://agatsa-one-api-651017108992.asia-south1.run.app/v1/nera-api/patient/pt_001/ecg-history \
  -H "x-api-key: ak_your_key"

Response

{
  "ok": true,
  "patientRef": "pt_001",

  // Trend summary across all visits
  "trend": {
    "visits": 4,
    "cardiacScore": {
      "current": 76,
      "first":   84,
      "trend":   "declining"    // improving | declining | stable
    },
    "qtcMs": {
      "current":   448,
      "first":     418,
      "deltaMs":   30,          // ms change since first visit
      "direction": "prolonging", // prolonging | shortening | stable
      "alert":     true          // true if any visit QTc > 460ms
    },
    "hrBpm": { "current": 82, "trend": "stable" },
    "afibEpisodes":  1,
    "stemiEpisodes": 0,
    "urgentVisits":  1,
    "clinicalFlag":  "QTC_PROLONGED"
    // clinicalFlag: STEMI_HISTORY | RECURRENT_AFIB | QTC_PROLONGED | null
  },

  // Full visit-by-visit list (oldest → newest)
  "analyses": [
    {
      "id":            "a1b2c3...",
      "analyzedAt":    "2026-05-10T09:22:00Z",
      "hr":            78,
      "qtcMs":         418,
      "prMs":          154,
      "qrsMs":         86,
      "sdnnMs":        42,
      "cardiacScore":  84,
      "rhythmRegular": true,
      "afib":          false,
      "stemi":         false,
      "stemiTerritory":null,
      "urgency":       "routine",
      "minnesotaCodes":[],
      "interpretation":{ "summary": "...", "rhythm": "sinus_rhythm", "findings": ["..."] }
    },
    {
      "id":            "d4e5f6...",
      "analyzedAt":    "2026-06-27T11:05:00Z",
      "hr":            82,
      "qtcMs":         448,
      "prMs":          168,
      "qrsMs":         90,
      "sdnnMs":        31,
      "cardiacScore":  76,
      "rhythmRegular": false,
      "afib":          true,
      "stemi":         false,
      "stemiTerritory":null,
      "urgency":       "urgent",
      "minnesotaCodes":["8-3 (Possible Atrial Fibrillation — RR irregularity)"],
      "interpretation":{ "summary": "...", "rhythm": "atrial_fibrillation", "findings": ["..."] }
    }
  ]
}
QTc alert: qtcMs.alert: true means at least one visit recorded QTc > 460ms — the threshold for drug-induced QT prolongation risk. Progressive QTc prolongation (rising deltaMs across visits) is a silent cardiac risk indicator.

clinicalFlag values:
STEMI_HISTORY — one or more visits with STEMI detected (highest priority)
RECURRENT_AFIB — AFib detected in ≥ 2 visits
QTC_PROLONGED — any visit QTc > 460ms
null — no critical flags

Risk Score — Single Call

Point-in-time score from a single set of vitals. Use this for quick triage or when you don't yet have longitudinal history. For ongoing monitoring, use the longitudinal patient API instead — it produces more accurate results.

POST /v1/nera-api/vitals/risk-score
Compute a 0–100 Nera Score from a single snapshot of vitals. Returns severity-ranked flags and a clinical narrative. No patient history required.

Request body

{
  "hr":         88,      // bpm (optional)
  "hrv":        32,      // ms RMSSD (optional)
  "spo2":       96,      // % (optional)
  "systolic":   138,     // mmHg (optional)
  "diastolic":  88,      // mmHg (optional)
  "glucose":    112,     // mg/dL fasting (optional)
  "hba1c":      6.1,     // % (optional)
  "bmi":        27.4,    // kg/m² (optional)
  "age":        48,      // years (optional)
  "gender":     "M",     // M|F|O (optional)
  "patientRef": "pt_001"
}

Response

{
  "ok": true,
  "patientRef": "pt_001",
  "neraScore": 62,
  "riskCategory": "moderate",
  "flags": [
    { "signal":"bp_sys", "label":"Systolic BP", "value":138, "threshold":130, "unit":"mmHg", "severity":"moderate", "delta":8 }
  ],
  "narrative": {
    "summary": "...",
    "topRisk": "...",
    "recommendations": ["..."],
    "followUpPriority": "30_days"
  },
  "computedAt": "2026-06-27T10:00:00Z"
}

Glucose Estimation

POST /v1/nera-api/glucose/estimate
Estimate glucose range from a PPG wearable index. Cross-references three signals (PPG index + HR + HRV) simultaneously — activity-corrected and stress-corrected. Calibrated on 12M paired glucometer readings.

Request body

{
  "wellnessIndex": 48,    // 0-100 PPG index from any wearable (required)
  "hr":            88,    // bpm — improves accuracy (optional)
  "hrv":           32,    // ms — improves accuracy (optional)
  "patientRef":    "pt_001"
}

Response

{
  "ok": true,
  "patientRef": "pt_001",
  "glucoseEstimateMgdl": { "lo": 104, "hi": 126 },
  "zone":       "borderline",  // hypoglycemic | normal | borderline | elevated | hyperglycemic
  "confidence": "medium",      // low | medium — depends on optional fields provided
  "disclaimer": "Estimated range only — confirm with glucometer for clinical decisions."
}

Patient Report

POST /v1/nera-api/report/generate
Generate a longitudinal clinical narrative from up to 30 days of daily vitals. Returns trend analysis across all signals, the single most clinically significant pattern, recommendations, and follow-up priority. ~2–4 second response.

Request body

{
  "patientRef": "pt_001",
  "age": 48, "gender": "M",
  "days": [
    { "date":"2026-06-21", "hrAvg":84, "hrvAvg":34, "spo2Avg":97, "steps":4200, "sleepHrs":6.5, "glucose":108 },
    { "date":"2026-06-27", "hrAvg":88, "hrvAvg":30, "spo2Avg":96, "steps":3800, "sleepHrs":5.9, "glucose":115 }
    // ... up to 30 days
  ]
}

Response

{
  "ok": true,
  "patientRef": "pt_001",
  "daysAnalysed": 7,
  "report": {
    "headline": "HRV declined 18% mid-week correlating with nights below 6h sleep",
    "weeklyNarrative": "...",
    "trends": { "hr":"stable", "hrv":"declining", "sleep":"declining", "steps":"stable" },
    "keyInsight": "...",
    "recommendations": ["..."],
    "riskFlags": ["Persistently low HRV below 30ms on 4 of 7 days"],
    "followUpRecommended": true
  },
  "generatedAt": "2026-06-27T10:00:00Z"
}

Usage

GET /v1/nera-api/usage
Returns your current month's call counts by endpoint, quota remaining, and tier info.

Response

{
  "ok": true,
  "orgName": "Acme Health",
  "tier": "sandbox",
  "keyPrefix": "ak_3cdf10",
  "currentMonth": { "total": 24, "limit": 200, "remaining": 176 },
  "byEndpoint": [
    { "endpoint": "/v1/nera-api/patient/vitals/batch",    "count": 12 },
    { "endpoint": "/v1/nera-api/patient/score",           "count": 8 },
    { "endpoint": "/v1/nera-api/ecg/analyze",             "count": 4 },
    { "endpoint": "/v1/nera-api/patient/ecg-history",     "count": 2 }
  ]
}

Error codes

StatusErrorMeaning
401Missing / invalid x-api-keyCheck your key header
402QuotaExceededMonthly limit reached — upgrade tier
404NoDataNo vitals logged for this patientRef yet
422Validation errorCheck request body fields and types
503AI service unavailableRetry in a moment

Pricing

TierCalls/monthPriceBest for
Sandbox200FreeIntegration & testing
5,000₹24,999/moClinics, telehealth startups
EnterpriseUnlimitedCustomHospital chains, HIS vendors

Get Your API Key

curl -X POST https://agatsa-one-api-651017108992.asia-south1.run.app/v1/nera-api/developer/register \
  -H "Content-Type: application/json" \
  -d '{"email":"you@hospital.com","orgName":"Apollo Delhi","useCase":"ECG risk triage"}'

Key is returned immediately. Save it — it won't be shown again.
To upgrade to Growth, email info@neraai.co

Nera AI
All AI output is generated by Nera AI models trained on clinical data. Results must be reviewed by a qualified clinician before any clinical decision. Not a substitute for professional medical judgment.
Base URL: https://agatsa-one-api-651017108992.asia-south1.run.app  ·  info@neraai.co