Interested in joining a scientific study?Learn more

Core API

Decide API

Available

Decide evaluates explicit food, meal, drink or ingredient options using text, image or audio inputs and optional user context.

POST/functions/v1/decide

Inputs

  • inputs[] with type text, image or audio
  • Optional user_context such as diet, language or avoided foods

Returns

  • A concise answer_text recommendation
  • Completed status or validation errors

Request JSON

{
  "inputs": [
    {
      "type": "text",
      "label": "meal options",
      "data": "Option A: oatmeal with berries. Option B: croissant and jam."
    }
  ],
  "user_context": {
    "language": "en",
    "notes": "Prefer steady energy"
  }
}

Response JSON

{
  "status": "completed",
  "result": {
    "answer_text": "Choose option A. It is more likely to provide steady energy."
  },
  "error": null
}
curl -X POST 'https://tirqjzahcinadeulfylj.supabase.co/functions/v1/decide' \
  -H 'x-api-key: $MYMOLECULES_API_KEY' \
  -H 'Content-Type: application/json' \
  --data '{  "inputs": [    {      "type": "text",      "label": "meal options",      "data": "Option A: oatmeal with berries. Option B: croissant and jam."    }  ],  "user_context": {    "language": "en",    "notes": "Prefer steady energy"  }}'