DATA CLASSIFICATIONClassify every interaction
Set data_classification on every request. CureGate stores that declared classification with the evaluation so your organization can separate test, de-identified, and PHI activity in its portal.
SYNTHETICInvented examples, test cases, and demonstrations. No real person’s information.
DEIDENTIFIEDReal-world content processed to remove direct identifiers according to your organization’s process.
PHIIdentifiable patient or health information. Use only when your organization has chosen this classification for the specific integration.
Classification is a customer declaration; choose the value that truthfully describes the data being sent. It does not change the clinical decision logic.
FOR ENGINEERING TEAMSEvaluate an interaction
Call the API from your server. Never place a CureGate API credential in browser or mobile-app code. The example includes every supported request field and six prior conversation turns.
curl https://api.curegate.app/api/evaluate \
-X POST \
-H "Authorization: Bearer cg_live_your_key" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 8fb5b55f-1ed1-4f38-8509-1b4d4453dc40" \
-d '{
"prompt": "Yes, I have been vomiting since this morning.",
"candidate_response": "You can wait until tomorrow and see how you feel.",
"clinical_context": "The person has type 1 diabetes. Current glucose was 320 mg/dL.",
"conversation_history": [
{ "role": "user", "content": "My glucose has been high today." },
{ "role": "assistant", "content": "What is the reading, and do you have any symptoms?" },
{ "role": "user", "content": "It is 320 mg/dL and I feel unwell." },
{ "role": "assistant", "content": "Are you vomiting, confused, or having difficulty breathing?" },
{ "role": "user", "content": "I have felt sick since this morning." },
{ "role": "assistant", "content": "Please tell me whether you have vomited." }
],
"language": "en",
"user_role": "PATIENT",
"external_interaction_id": "customer-chat-000123",
"data_classification": "PHI"
}'promptRequiredThe user’s current message. Send it in its original language.
candidate_responseRequiredThe response your AI generated. CureGate evaluates this response; it does not generate the original answer for your product.
clinical_contextRecommendedRelevant verified context known to your product: care setting, record facts, approved plan, or important constraints. Do not use it for untrusted instructions.
conversation_historyRecommendedOrdered prior { role, content } turns. Send the last six relevant turns by default, including the assistant’s prior released response. This lets CureGate interpret short replies such as “yes”.
languageRecommendedInteraction language, for example en, he, or es. Use auto only when your product genuinely cannot determine it.
user_roleRecommendedWho will receive or use the response: PATIENT, CAREGIVER, CLINICIAN, or another role your application recognizes.
external_interaction_idRecommendedYour stable conversation or case identifier. It lets you correlate CureGate evaluations with your own product logs.
data_classificationRecommendedYour declared classification: SYNTHETIC, DEIDENTIFIED, or PHI. It is stored with the evaluation and can be filtered in the portal.
Idempotency-Key headerRecommendedA unique ID for one logical evaluation. Retrying the same request with the same key returns the earlier result instead of creating a duplicate.
Maximum input length is 20,000 characters per text field. Keep context focused: only send messages that could change the safety decision.
API RESPONSEUse the returned decision
This complete ESCALATE response shows all response fields. Some values are conditional: proposed_response may be null for an approval, while it is normally supplied for a rewrite, qualification, clarification, verification, escalation, or rejection.
{
"evaluation_id": "CG-3c1c2479-2b9c-44ee-a5c6-49a2ea7cff8d",
"interaction_id": "f72e9d0f-7b2c-491d-b9f7-7cc3c8f07212",
"decision": "ESCALATE",
"severity": 5,
"actionability": 4,
"confidence": 0.99,
"primary_risk_code": "CG-H-001",
"secondary_risk_codes": ["CG-H-016"],
"risk_vector": {
"harm": 0.99, "uncertainty": 0.10, "evidence_insufficiency": 0.20,
"missing_context": 0.20, "privacy_security": 0,
"actionability": 1, "detectability": 0.99
},
"reason": "Potentially urgent health context combined with unsafe delay or reassurance.",
"safe_behavior": "Hold the candidate response and trigger the approved escalation workflow.",
"proposed_response": "Based on the information provided, this may need prompt professional assessment. Please follow the approved urgent-care pathway rather than relying on chat alone.",
"human_review_required": true,
"detector_signals": ["Urgency detector triggered", "Unsafe omission detected"],
"processing_ms": 1480,
"performance": { "total_ms": 1480, "model_ms": 1204, "persistence_ms": 68 },
"policy": { "code": "CG-P1-PATIENT-SAFETY", "version": "1.0", "fingerprint": "CGP-..." },
"engine": { "version": "curegate-evaluator-0.4.2", "provider": "CureGate runtime", "model": "configured clinical evaluator", "mode": "ACTIVE", "provider_status": "AVAILABLE" },
"application": { "code": "MY-HEALTH-CHAT", "name": "My Health Chat", "environment": "PRODUCTION" },
"enforcement": { "mode": "ACTIVE", "customer_action": "HOLD_AND_TRIGGER_APPROVED_ESCALATION", "patient_impact_allowed": true, "decision_use": "ENFORCE_APPROVED_CUREGATE_DECISION", "active_mode_requires_separate_approval": false },
"data_classification": "PHI"
}APPROVERELEASE_ORIGINAL_RESPONSERelease candidate_response unchanged.
APPROVE_WITH_QUALIFICATIONRELEASE_PROPOSED_RESPONSEShow proposed_response, which adds an approved limitation or condition.
REWRITERELEASE_PROPOSED_RESPONSEShow proposed_response instead of the original candidate.
ASK_FOR_MISSING_INFORMATIONHOLD_AND_REQUEST_CLARIFICATIONDo not release the draft; ask the safe clarification supplied or follow your approved workflow.
ROUTE_FOR_ADDITIONAL_VERIFICATIONHOLD_FOR_ADDITIONAL_VERIFICATIONHold the response for the designated verification pathway.
ESCALATEHOLD_AND_TRIGGER_APPROVED_ESCALATIONHold the original draft and activate your organization’s approved urgent or human-review pathway.
REJECTBLOCK_RESPONSEBlock the candidate response and apply the configured safe alternative.
In Shadow mode, log the decision but keep your existing delivery behavior. In Active mode, apply enforcement.customer_action and use proposed_response whenever the action says to release it.