Interested in joining a scientific study?Learn more

Core API

Draft API

Available

Draft takes an existing recipe or meal idea and creates controlled substitutions or edits while respecting preferences, restrictions and sensory goals.

POST/functions/v1/draft

Inputs

  • input_mode structured or unstructured
  • request_text or edit_instructions
  • Recipe title, ingredients and steps

Returns

  • Recipe diffs and substitutions
  • Warnings and validation feedback
  • Async job status when queued

Request JSON

{
  "input_mode": "unstructured",
  "request_text": "Make this tomato pasta higher protein and lactose-free.",
  "recipe_title": "Tomato pasta",
  "ingredients": ["pasta", "tomato sauce", "parmesan"],
  "steps": ["Cook pasta", "Warm sauce", "Serve with parmesan"],
  "language": "en"
}

Response JSON

{
  "job_id": "f13e52...",
  "status": "queued",
  "status_url": "https://tirqjzahcinadeulfylj.supabase.co/functions/v1/draft?job_id=f13e52..."
}
curl -X POST 'https://tirqjzahcinadeulfylj.supabase.co/functions/v1/draft' \
  -H 'x-api-key: $MYMOLECULES_API_KEY' \
  -H 'Content-Type: application/json' \
  --data '{  "input_mode": "unstructured",  "request_text": "Make this tomato pasta higher protein and lactose-free.",  "recipe_title": "Tomato pasta",  "ingredients": ["pasta", "tomato sauce", "parmesan"],  "steps": ["Cook pasta", "Warm sauce", "Serve with parmesan"],  "language": "en"}'