{
 "openapi": "3.1.0",
 "info": {
  "title": "Biomiv BioAI API",
  "version": "1.0.0",
  "description": "Biomiv is the health research site of Cymetica Biosciences. Its AI agent, BioAI, answers a health condition, symptom or goal with a diet engineered for it by the BIOMIC-42 algorithm, research cards with citations, and live clinical trials. Free. No account and no key. Research information, not medical advice: a doctor or pharmacist should be asked before changing any medicine, supplement or diet.",
  "contact": {
   "email": "contact@biomiv.com"
  },
  "termsOfService": "https://biomiv.com/terms"
 },
 "servers": [
  {
   "url": "https://biomiv.com"
  }
 ],
 "paths": {
  "/ask": {
   "get": {
    "summary": "BioAI's answer as a page of text any AI can open (add `format=json` for JSON).",
    "operationId": "get_ask",
    "responses": {
     "200": {
      "description": "OK"
     },
     "429": {
      "description": "Too many requests: try again in a minute."
     }
    },
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "description": "the condition, symptom or goal",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/api/v1/healthspan/discover": {
   "post": {
    "summary": "A conversation turn with BioAI: send `{\"messages\": [\"...\"]}`.",
    "operationId": "post_api_v1_healthspan_discover",
    "responses": {
     "200": {
      "description": "OK"
     },
     "429": {
      "description": "Too many requests: try again in a minute."
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "messages"
        ],
        "properties": {
         "messages": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "the conversation so far, the person's turns, oldest first"
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/healthspan/score": {
   "get": {
    "summary": "The engineered diet for a condition, with its 0-100 score, recipes and citations.",
    "operationId": "get_api_v1_healthspan_score",
    "responses": {
     "200": {
      "description": "OK"
     },
     "429": {
      "description": "Too many requests: try again in a minute."
     }
    },
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "description": "the condition or symptom",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/api/v1/healthspan/score/recipe": {
   "get": {
    "summary": "One recipe written for the ingredients of that diet. Add n=1 to 12 for further recipes: each number is a different set of the diet's foods and a different kind of dish.",
    "operationId": "get_api_v1_healthspan_score_recipe",
    "responses": {
     "200": {
      "description": "OK"
     },
     "429": {
      "description": "Too many requests: try again in a minute."
     }
    },
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "description": "the condition or symptom",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/api/v1/healthspan/discover/cards": {
   "get": {
    "summary": "Research cards with citations, and repurposed drug candidates.",
    "operationId": "get_api_v1_healthspan_discover_cards",
    "responses": {
     "200": {
      "description": "OK"
     },
     "429": {
      "description": "Too many requests: try again in a minute."
     }
    },
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "description": "the condition or symptom",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/api/v1/healthspan/discover/trials": {
   "get": {
    "summary": "Clinical trials, read live from the public registry.",
    "operationId": "get_api_v1_healthspan_discover_trials",
    "responses": {
     "200": {
      "description": "OK"
     },
     "429": {
      "description": "Too many requests: try again in a minute."
     }
    },
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "description": "the condition",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/api/v1/healthspan/discover/meter": {
   "get": {
    "summary": "The healthspan meter: years of life associated with the diet.",
    "operationId": "get_api_v1_healthspan_discover_meter",
    "responses": {
     "200": {
      "description": "OK"
     },
     "429": {
      "description": "Too many requests: try again in a minute."
     }
    },
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "description": "the condition or symptom",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/api/v1/healthspan/discover/molecular": {
   "get": {
    "summary": "The molecular view: a compound, a protein and a structure.",
    "operationId": "get_api_v1_healthspan_discover_molecular",
    "responses": {
     "200": {
      "description": "OK"
     },
     "429": {
      "description": "Too many requests: try again in a minute."
     }
    },
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "description": "the condition or symptom",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/api/v1/healthspan/discover/studies": {
   "get": {
    "summary": "The papers behind a count: title, journal, year and link per id.",
    "operationId": "get_api_v1_healthspan_discover_studies",
    "responses": {
     "200": {
      "description": "OK"
     },
     "429": {
      "description": "Too many requests: try again in a minute."
     }
    },
    "parameters": [
     {
      "name": "ids",
      "in": "query",
      "required": true,
      "description": "paper ids, comma separated",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/api/v1/healthspan/discover/levels": {
   "get": {
    "summary": "The kind of study each paper is (review of studies, human randomised, human, animal, lab).",
    "operationId": "get_api_v1_healthspan_discover_levels",
    "responses": {
     "200": {
      "description": "OK"
     },
     "429": {
      "description": "Too many requests: try again in a minute."
     }
    },
    "parameters": [
     {
      "name": "ids",
      "in": "query",
      "required": true,
      "description": "paper ids, comma separated",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/api/v1/healthspan/traffic": {
   "get": {
    "summary": "Traffic on biomiv.com, daily totals only.",
    "operationId": "get_api_v1_healthspan_traffic",
    "responses": {
     "200": {
      "description": "OK"
     },
     "429": {
      "description": "Too many requests: try again in a minute."
     }
    },
    "parameters": [
     {
      "name": "days",
      "in": "query",
      "required": false,
      "description": "7, 14, 30 or 90",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  }
 },
 "externalDocs": {
  "description": "For AI agents",
  "url": "https://biomiv.com/ai-agents"
 }
}