Customized Meal Plan AI
a page dedicated to information on using the Meal Plan Generation routes
Last updated
a page dedicated to information on using the Meal Plan Generation routes
Last updated
Flexible input: Accepts free-form text, structured JSON (stringified), or both.
Macro flexibility: You may provide specific macro targets, or the API can calculate reasonable targets based on user profile data.
Intelligent memory: Optionally include a list of previous meal names to avoid or prioritize.
Two-step process: Use the fast preview endpoint to iterate quickly, then promote an approved preview into a fully calculated meal plan.
All requests must include a valid Bearer token in the Authorization
header.
Refer to the for how to obtain and manage your tokens.
POST /v2/products/sdk/tools/generateMealPlan
Input
content
may contain natural language, structured data, or both. Include as much detail as you can.
Optionally include previous meal log info (names, preferences, etc).
Optional Query Params
model
: the model used to generate meal ideas (default recommended model)
model2
: the model used to refine and finalize individual days
Note: Using
gemini-2-5-pro
for both will improve results but increase cost.
Example: Python
As with all our API endpoints - if you have any further instructions or prompts you want to add as a system, you are free to add these in plain-language at the start, or and of your users input (preferably at the start). This can help guide us to tailore what we produce to your needs.
POST /v2/products/sdk/tools/generateMealPlanPreview
A faster endpoint (4–20 seconds typical) that returns only the daily meal names and a rejected: false
status. Useful for user-driven feedback loops.
Sample Output
Users can reject individual meals (rejected: true
) and resend the updated JSON to the same endpoint to regenerate only those items.
Once the preview is approved, send the entire preview JSON to the full generation endpoint to receive a fully calculated version.
Example: Python
Average generation time (full): 1.5–6 minutes, depending on prompt complexity and model
Average preview time: 4–20 seconds
You can prepend instructions (e.g., internal app logic or strict constraints) to the user prompt if needed — these will be incorporated into processing
Be specific about goals, diet types, allergies, meal preferences, and number of days
Include known liked/disliked recipes
Use preview route to rapidly iterate with users
Upgrade to advanced models only when necessary