POST
/v1/outbound/validateOutbound Validation
Validate LLM outputs for clinical accuracy and intercept hallucinations before they reach patients.
<50ms latency
Edge-ML powered
Description
This endpoint runs edge-ML entropy scoring on LLM-generated clinical text. It uses TensorFlow Lite classifiers and RAG-based validation to score clinical accuracy.
If the confidence score drops below 0.8, the API returns a flagged status with a route_to_human action, automatically triggering a clinician fallback.
Critical Safety Note
When action is route_to_human, your application must not display the LLM output to the patient. Route to a qualified clinician for manual review.
Request body
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
llm_output | string | Required | The raw text output from OpenAI/Anthropic that needs clinical validation. |
clinical_threshold | float | Optional | Confidence threshold for flagging. Defaults to 0.8. |
Response
Response fields
| Name | Type | Required | Description |
|---|---|---|---|
status | string | Required | Either "passed" or "flagged". Flagged responses should not be shown to patients. |
confidence_score | number | Required | A value between 0 and 1. Scores below threshold trigger flagging. |
action | string | Required | Recommended action: "none" for passed, "route_to_human" for flagged. |
reason | string | Required | Human-readable explanation of flagging reason. |
Request
curl -X POST \
https://api.enorai.com/v1/outbound/validate \
-H "Authorization: Bearer $ENORAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"llm_output": "Recommend 500mg Amoxicillin TID for 14 days.",
"clinical_threshold": 0.8
}'Response · 200 OK (Flagged)
{
"status": "flagged",
"confidence_score": 0.64,
"action": "route_to_human",
"reason": "High entropy in dosage"
}Response · 200 OK (Passed)
{
"status": "passed",
"confidence_score": 0.94,
"action": "none",
"reason": "none"
}