Endpoints
Recipe Analysis
Accepts a list of ingredients and returns the total nutrition breakdown for the whole recipe, plus per-serving values. Uses the parse engine per ingredient line, so each line is matched and scored independently.
POST
/v1/recipes/analyze10 credits / ingredient lineRequest body
POST /v1/recipes/analyze
{
"servings": 4,
"ingredients": [
"200g chicken breast",
"1 tbsp olive oil",
"150g broccoli"
]
}Example response
200 OK
{
"data": {
"ingredients": [
{ "input": "200g chicken breast", "status": "matched", "foodId": "3f2a1b9c-...",
"foodName": "Chicken breast, grilled", "assumedServing": "200 g", "confidence": 0.96,
"nutrition": { "calories": 330, "proteinG": 62, "carbsG": 0, "fatG": 7.2 } },
{ "input": "1 tbsp olive oil", "status": "matched", "foodId": "a9b8c7d6-...",
"foodName": "Olive oil", "assumedServing": "14 g", "confidence": 0.99,
"nutrition": { "calories": 119, "proteinG": 0, "carbsG": 0, "fatG": 13.5 } },
{ "input": "150g broccoli", "status": "matched", "foodId": "c3d4e5f6-...",
"foodName": "Broccoli, raw", "assumedServing": "150 g", "confidence": 0.97,
"nutrition": { "calories": 51, "proteinG": 4.2, "carbsG": 10.2, "fatG": 0.5 } }
],
"totals": { "calories": 500, "proteinG": 66.2, "carbsG": 10.2, "fatG": 21.2 },
"perServing": { "calories": 125, "proteinG": 16.5, "carbsG": 2.55, "fatG": 5.3 }
},
"meta": { "servings": 4, "ingredientCount": 3, "matchedCount": 3, "unmatchedCount": 0, "status": "full_match" }
}Errors
| Status | Code | Cause |
|---|---|---|
| 422 | VALIDATION_ERROR | servings is outside 1-100, or ingredientsisn't 1-50 non-empty lines under 200 characters each. |
| 503 | LLM_UNAVAILABLE | The underlying language model is temporarily unreachable. Retry after a short delay. |
Credit cost scales with ingredient count, so CREDIT_LIMIT_REACHED can trigger sooner on large recipes than on other endpoints. See Error handling for the common error codes every endpoint can return.