curl --request POST \
--url https://api.example.com/api/generateSubstitutions \
--header 'Content-Type: application/json' \
--data '
{
"ingredientName": "<string>",
"ingredientAmount": "<string>",
"recipeTitle": "<string>",
"cuisine": [
{}
],
"ingredients": [
{}
],
"instructions": [
{}
]
}
'{
"success": true,
"data": {
"substitutions": [
{
"name": "<string>",
"description": "<string>"
}
]
},
"error": "<string>",
"details": "<string>"
}Generate context-aware ingredient substitutions using AI based on the full recipe
curl --request POST \
--url https://api.example.com/api/generateSubstitutions \
--header 'Content-Type: application/json' \
--data '
{
"ingredientName": "<string>",
"ingredientAmount": "<string>",
"recipeTitle": "<string>",
"cuisine": [
{}
],
"ingredients": [
{}
],
"instructions": [
{}
]
}
'{
"success": true,
"data": {
"substitutions": [
{
"name": "<string>",
"description": "<string>"
}
]
},
"error": "<string>",
"details": "<string>"
}/api/generateSubstitutions endpoint generates intelligent, context-aware ingredient substitutions. It analyzes the full recipe context (ingredients, instructions, cuisine) to suggest practical substitutions that work specifically for the recipe at hand.
Unlike generic substitution lists, this endpoint considers:
"heavy cream", "gochujang", "parmesan cheese""1/2 cup", "2 tablespoons""Gochujang Pasta"["Korean", "Italian Fusion"]Show Ingredients Array Structure
[
{
"groupName": "For the sauce",
"ingredients": [
{
"amount": "2",
"units": "tablespoons",
"ingredient": "gochujang"
}
]
}
]
["Heat butter in a pan", "Add gochujang and cream"]true for successful responsesShow Substitution Data Structure
curl -X POST https://your-domain.com/api/generateSubstitutions \
-H "Content-Type: application/json" \
-d '{
"ingredientName": "gochujang",
"ingredientAmount": "2 tablespoons",
"recipeTitle": "Gochujang Pasta",
"cuisine": ["Korean", "Fusion"],
"ingredients": [
{
"groupName": "For the sauce",
"ingredients": [
{"amount": "2", "units": "tablespoons", "ingredient": "gochujang"},
{"amount": "1/2", "units": "cup", "ingredient": "heavy cream"}
]
}
],
"instructions": [
"Heat butter in a pan over medium heat.",
"Add gochujang and stir until fragrant.",
"Add cream and simmer."
]
}'
{
"success": true,
"data": {
"substitutions": [
{
"name": "Sriracha mixed with miso paste",
"description": "Combines heat and umami to mimic gochujang's fermented depth in cream sauce"
},
{
"name": "Sambal oelek with a pinch of sugar",
"description": "Provides similar heat level; sugar balances the spiciness with cream"
},
{
"name": "Tomato paste with red pepper flakes",
"description": "Creates savory base with adjustable heat for this pasta sauce"
}
]
}
}
{
"error": "Ingredient name is required"
}
llama-3.3-70b-versatile model via Groq with:
GROQ_API_KEY in your environment variables.ingredientName is required, providing full recipe context (ingredients, instructions, cuisine) results in much better, more contextually relevant substitution suggestions.