Chat with agent

POST/agent/chat
RequiresBearerauthentication

Header parameters

Body parameters

messagestringrequired
contextstringoptional
session_idstringoptional
agent_idstringrequired
enhanced_reasoningbooleanoptionaldefault false
Returns  

Response fields

responsestringoptional
successbooleanoptional
messagestringoptional
session_idstringoptional
POSTRequest
# Get authentication token
PHENOML_TOKEN=$(curl -X POST "https://experiment.app.pheno.ml/v2/auth/token" \
  -u "$PHENOML_CLIENT_ID:$PHENOML_CLIENT_SECRET" \
  | jq -r '.access_token')

curl -X POST "https://experiment.app.pheno.ml/agent/chat" \
  -H "Authorization: Bearer $PHENOML_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "message": "What is the patient'\''s current condition?",
  "agent_id": "agent-123",
  "session_id": "session-abc123"
}'
200 OKExample Response
{
  "success": true,
  "message": "Response generated successfully",
  "response": "Based on the patient records, they have been diagnosed with Type 2 Diabetes Mellitus (ICD-10: E11.65) and Essential Hypertension (ICD-10: I10). Current medications include Metformin 500mg BID and Lisinopril 10mg daily. Most recent HbA1c was 7.2% on 2024-12-15.",
  "session_id": "session-abc123"
}