Food from text
POST /v1/food/text · $0.01 a call
Send what someone ate in their own words, like "2 fried eggs, toast with butter and a latte". A model splits it into foods with standard portion weights, then each food is matched to our reference nutrition database and scaled to its weight, the same way as the photo endpoint.
For calorie trackers, voice and chat food logging, meal planners.
Request
Send these fields as a JSON body (or form fields) on POST /v1/food/text. No photo is needed.
| Field | Type | Description |
|---|---|---|
text | string, up to 1000 characters, required | What the user ate, in their own words. |
context | string, up to 500 characters | Anything else the user tells you, e.g. "the latte was with oat milk". |
Photo tips. No photo. Send the text as written or spoken; amounts like "2", "a slice" or "half a cup" help most.
curl https://truelens.keronlabs.com/v1/food/text \
-H "Authorization: Bearer $TRUELENS_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"2 fried eggs, toast with butter and a latte"}'
Response
| Field | Description |
|---|---|
summary | One line for a list view, e.g. "412 kcal across 4 items". |
is_food | false when the text describes no food or drink. |
items[].name | The food as understood. |
items[].quantity | The amount as the user said it. |
items[].grams | Edible weight of that amount. |
items[].confidence | 0 to 1, covering the food and the weight. |
items[].nutrition | calories, protein_g, carbs_g, fat_g, fiber_g for that weight. |
items[].estimated | true when the food was not found in our reference nutrition data. |
totals | Sum of all items. |
follow_up_questions | Up to three questions whose answers would change the total most. |
Example
Output of this API’s own code on the sample request above.
{
"metadata": {
"id": "req_9cf4da08fe7f40dab71a",
"engine": "food/text",
"status": "success",
"cached": false,
"credits_used": 1,
"created_at": "2026-10-19T09:30:00.000Z",
"processing_ms": 40
},
"summary": "455 kcal across 4 items",
"is_food": true,
"items": [
{
"name": "fried egg",
"grams": 92,
"confidence": 0.9,
"cooking_method": "fried",
"nutrition": {
"calories": 180,
"protein_g": 12.5,
"carbs_g": 0.8,
"fat_g": 13.6,
"fiber_g": 0
},
"estimated": false,
"quantity": "2"
},
{
"name": "white toast",
"grams": 30,
"confidence": 0.8,
"cooking_method": "baked",
"nutrition": {
"calories": 88,
"protein_g": 3.1,
"carbs_g": 16.2,
"fat_g": 1.2,
"fiber_g": 0.8
},
"estimated": false,
"quantity": "1 slice"
},
{
"name": "butter",
"grams": 5,
"confidence": 0.7,
"cooking_method": "none",
"nutrition": {
"calories": 36,
"protein_g": 0,
"carbs_g": 0,
"fat_g": 4.1,
"fiber_g": 0
},
"estimated": false,
"quantity": "1 pat"
},
{
"name": "latte with whole milk",
"grams": 350,
"confidence": 0.6,
"cooking_method": "none",
"nutrition": {
"calories": 151,
"protein_g": 9.8,
"carbs_g": 15.2,
"fat_g": 5.6,
"fiber_g": 0
},
"estimated": false,
"quantity": "1 regular"
}
],
"totals": {
"calories": 455,
"protein_g": 25.4,
"carbs_g": 32.2,
"fat_g": 24.5,
"fiber_g": 0.8
},
"follow_up_questions": [
"Which milk was in the latte?"
]
}