Developer Documentation

API Reference

This page documents the core Rapid AI endpoints used by client apps, simulator workflows, and integrations.

Developer Access

Free and premium API key plans are available.

Usage Limit

1000 requests

Expiry Duration

30 days

Supported Endpoints

5

Premium Monthly

$5/month

25,000 requests/day

Premium Yearly

$60/year

25,000 requests/day

/telemetry/update/voice/query/api/v1/forecast/next/icu/summary/api/v1/alerts

Authentication

Using the x-api-key header

Protected endpoints require an API key in the x-api-key header. Requests without a valid key return 401 Unauthorized.

Header Example

x-api-key: YOUR_API_KEY

Quickstart cURL Example

curl -X POST http://localhost:4000/telemetry/update \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"patientId": "205",
"heartRate": 120,
"spo2": 85,
"temperature": 38.1,
"bloodPressure": "120/80"
}'
POST

/telemetry/update

Telemetry ingestion

Ingests a live telemetry snapshot, computes risk, updates patient state, and returns alert + forecast context.

Example Request

curl -X POST "http://localhost:4000/telemetry/update" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "patientId": "205",
    "heartRate": 120,
    "spo2": 85,
    "temperature": 38.1,
    "bloodPressure": "120/80"
  }'

Example Response

{
  "message": "Telemetry processed",
  "patient": {
    "patientId": "205",
    "heartRate": 118,
    "spo2": 88,
    "temperature": 38.1,
    "bloodPressure": "128/86",
    "riskScore": 72,
    "riskLevel": "CRITICAL",
    "predictedRiskNext5Minutes": "CRITICAL",
    "lastUpdated": "2026-04-11T11:24:08.000Z"
  },
  "alert": {
    "triggered": true,
    "severity": "critical",
    "message": "Critical deterioration detected for patient 205"
  },
  "forecast": {
    "predictedRiskLevel": "CRITICAL",
    "confidence": 0.82,
    "source": "model"
  }
}
POST

/voice/query

Voice queries

Accepts clinician text (or voice workflow payload), resolves intent, and returns a patient-aware response.

Example Request

curl -X POST "http://localhost:4000/voice/query" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "text": "Give me current status of patient 205",
    "language": "en",
    "userId": "doctor-101"
  }'

Example Response

{
  "intent": "patient_status",
  "language": "en",
  "responseText": "Patient 205 is currently critical with low oxygen saturation and elevated heart rate.",
  "patientId": "205",
  "riskLevel": "CRITICAL",
  "riskScore": 72,
  "audioBase64": null,
  "meta": {
    "source": "llm",
    "responseAt": "2026-04-11T11:26:33.000Z"
  }
}
POST

/api/v1/forecast/next

Forecast prediction

Returns short-horizon deterioration prediction from the analytics service for a patient telemetry snapshot.

Example Request

curl -X POST "http://localhost:8080/api/v1/forecast/next" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "patient_id": "205",
    "heart_rate": 118,
    "spo2": 88,
    "temperature": 38.1,
    "blood_pressure": "128/86"
  }'

Example Response

{
  "patient_id": "205",
  "predicted_risk_level": "CRITICAL",
  "predicted_risk_score": 78,
  "confidence": 0.84,
  "horizon_minutes": 5,
  "source": "xgboost"
}
GET

/icu/summary

ICU summary

Provides current ICU-wide patient distribution and latest patient snapshots.

Example Request

curl -X GET "http://localhost:4000/icu/summary" \
  -H "x-api-key: YOUR_API_KEY"

Example Response

{
  "totals": {
    "critical": 2,
    "moderate": 1,
    "warning": 2,
    "stable": 4,
    "totalPatients": 9
  },
  "patients": [
    {
      "patientId": "205",
      "riskLevel": "CRITICAL",
      "riskScore": 72,
      "predictedRiskNext5Minutes": "CRITICAL",
      "lastUpdated": "2026-04-11T11:24:08.000Z"
    }
  ]
}
GET

/api/v1/alerts

Alerts stream

Returns recent alert events from the analytics layer with timestamps, severity, and cooldown metadata.

Example Request

curl -X GET "http://localhost:8080/api/v1/alerts?limit=20" \
  -H "x-api-key: YOUR_API_KEY"

Example Response

{
  "alerts": [
    {
      "id": "a4a2378f-5f31-4db4-a0c6-9f2c4314db8d",
      "patient_id": "205",
      "alert_type": "critical_deterioration",
      "severity": "critical",
      "message": "SpO2 below threshold with high heart rate",
      "created_at": "2026-04-11T11:24:10.000Z",
      "duplicate_suppressed": false,
      "cooldown_remaining_seconds": 0
    }
  ],
  "count": 1
}