Endpoint
POST
/functions/v1/decode_sensoryInputs
- foodText, foodImage or foodVoice
- sensoryOutput for the requested sensory view
Returns
- 202 queued response with job_id and status_url
- Status response with result or error
- Per-food and/or whole-meal sensory interpretation
Request details
- Provide at least one of foodText, foodImage or foodVoice.
- sensoryOutput is optional and must be per_food, whole_meal or per_food_and_whole_meal when provided.
- foodImage and foodVoice must be base64 data URLs; text input is capped for concise meal descriptions.
Response details
- Poll GET /functions/v1/decode_sensory?job_id=... until status is completed or failed.
- The completed result follows the requested sensoryOutput mode.
- Queued or processing jobs return result: null and error: null.
Operational notes
- Requires x-api-key with the edge:decode_sensory scope.
- POST usage is counted and X-Usage-Count is returned.
- Unsupported fields are rejected, so keep request bodies limited to the documented fields.
Examples
Request JSON
{
"foodText": "Tomato soup with basil and olive oil",
"sensoryOutput": "per_food_and_whole_meal"
}Response JSON
{
"job_id": "49ad2c...",
"status": "queued",
"status_url": "https://tirqjzahcinadeulfylj.supabase.co/functions/v1/decode_sensory?job_id=49ad2c..."
}Code examples
curl -X POST 'https://tirqjzahcinadeulfylj.supabase.co/functions/v1/decode_sensory' \
-H 'x-api-key: $MYMOLECULES_API_KEY' \
-H 'Content-Type: application/json' \
--data '{ "foodText": "Tomato soup with basil and olive oil", "sensoryOutput": "per_food_and_whole_meal"}'