Log a meal from photos
Uploads 1–5 photos of a single meal, sends them to Claude vision for per-item calorie and protein estimates, stores the photos plus a meal, and returns the analysis.
/api/nutrition/analyze__Secure-better-auth.session_tokenAPI key · cookierequiredBetter Auth session. Signing in (Google or email magic link) sets an HttpOnly session cookie that scopes every request to that account. The web app and CLI use this; agents use the OAuth 2.1 flow of the MCP server.
AuthorizationBearer token · headerrequiredPersonal API key sent as Authorization: Bearer skcal_…. Create and scope keys in the app under your profile → API keys. Keys default to full access; a scoped key is limited to its granted resource:action permissions and cannot manage other keys.
datestring<date>Day to log against (YYYY-MM-DD). Defaults to the server's current UTC date.
multipart/form-dataThe meal photos (multipart field photos), plus an optional note caption for context.
photosstring<binary>[]required1–5 photos of a single meal, possibly from multiple angles (JPEG, PNG, WebP, or GIF; max 8MB each).
notestringOptional caption to disambiguate the photo; passed to the model and stored as the meal note.
The meal was analyzed and logged.
okbooleanrequiredAlways true once analysis succeeds.
mealIdstring<uuid>requiredIdentifier of the created meal.
itemsAnalyzedItem[]requiredEstimated food items.
Show propertiesHide properties
AnalyzedItemnamestringrequiredEstimated food item name.
kcalintegerrequiredEstimated calories for the portion.
proteinGnumberrequiredEstimated protein in grams.
totalKcalintegerrequiredSummed calories across items.
totalProteinGintegerrequiredSummed protein in grams across items.
notestringrequiredThe model's one-line assumptions note.
photoKeysstring[]requiredR2 object keys of stored photos (empty for text descriptions).
The request body or parameters failed validation.
errorstringrequiredHuman-readable failure reason.
detailstringOptional extra context, present on upstream failures.
The upstream model call failed.
errorstringrequiredHuman-readable failure reason.
detailstringOptional extra context, present on upstream failures.
A required secret (model key or ingest token) is not configured.
errorstringrequiredHuman-readable failure reason.
detailstringOptional extra context, present on upstream failures.