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"
Add x-api-key: ak_... to every request. Never expose your key in client-side code — proxy through your backend server.
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.
{
"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
]
}
{
"ok": true,
"patientRef": "pt_001",
"daysLogged": 3
}
days array — pass fields directly with date.GET /v1/nera-api/patient/pt_001/score x-api-key: ak_your_key
{
"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"
}
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.
patientRef. Retrieve full ECG history + trend via GET /patient/:ref/ecg-history.
{
"imageUrl": "https://your-cdn.com/patient-ecg.jpg", // public URL
"patientRef": "pt_001",
"age": 48 // optional — improves interpretation
}
{
"imageBase64": "iVBORw0KGgoAAAANS...", // raw base64, no data: prefix, max 5MB
"mimeType": "image/jpeg", // image/jpeg | image/png | image/webp
"patientRef": "pt_001",
"age": 48
}
{
"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"
}
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.
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.
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"
{
"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": ["..."] }
}
]
}
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.
STEMI_HISTORY — one or more visits with STEMI detected (highest priority)RECURRENT_AFIB — AFib detected in ≥ 2 visitsQTC_PROLONGED — any visit QTc > 460msnull — no critical flags
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.
{
"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"
}
{
"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"
}
{
"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"
}
{
"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."
}
{
"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
]
}
{
"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"
}
{
"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 }
]
}
| Status | Error | Meaning |
|---|---|---|
| 401 | Missing / invalid x-api-key | Check your key header |
| 402 | QuotaExceeded | Monthly limit reached — upgrade tier |
| 404 | NoData | No vitals logged for this patientRef yet |
| 422 | Validation error | Check request body fields and types |
| 503 | AI service unavailable | Retry in a moment |
| Tier | Calls/month | Price | Best for |
|---|---|---|---|
| Sandbox | 200 | Free | Integration & testing |
| Growth | 5,000 | ₹24,999/mo | Clinics, telehealth startups |
| Enterprise | Unlimited | Custom | Hospital chains, HIS vendors |
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
https://agatsa-one-api-651017108992.asia-south1.run.app · info@neraai.co