API ReferenceapiaiPOST /v1/recommend

POST /v1/recommend

Service: ai · operationId: (none)

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "goal": {
      "type": "string",
      "minLength": 1
    },
    "patient_id": {
      "type": "string",
      "minLength": 1
    },
    "brand_id": {
      "type": "string",
      "minLength": 1
    },
    "biomarkers": {
      "type": "object",
      "additionalProperties": {
        "type": "number"
      }
    },
    "context": {
      "type": "object",
      "properties": {
        "conditions": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    }
  },
  "required": [
    "goal",
    "patient_id",
    "brand_id"
  ]
}

Responses

200 Narrated clinical recommendations

{
  "type": "object",
  "properties": {
    "recommendations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "peptide_id": {
            "type": "string",
            "minLength": 1,
            "description": "Legacy compatibility field carrying the clinical recommendation ID."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Human-readable recommendation title."
          },
          "reasoning": {
            "type": "string",
            "minLength": 1
          },
          "contraindications": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "peptide_id",
          "name",
          "reasoning",
          "contraindications"
        ]
      }
    }
  },
  "required": [
    "recommendations"
  ]
}

400 Invalid input

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

412 Clinical recommendation precondition failed

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

500 Recommendation client is not configured

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

502 Clinical or narration upstream error

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://ai.platform.loop.health/v1/recommend \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'