Skip to main content
POST
Log a meal or workout from photos

Authorizations

__Secure-better-auth.session_token
string
cookie
required

Better 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.

Query Parameters

date
string<date>

Day to log against (YYYY-MM-DD). Defaults to today.

tz
integer

Timezone offset in minutes (as from getTimezoneOffset), used to anchor a dated workout.

Body

multipart/form-data

The photos (multipart field photos), plus an optional note caption for context.

photos
file[]
required

1–5 photos of one meal or one workout (JPEG, PNG, WebP, or GIF; max 8MB each).

Example:
note
string

Optional caption; trusted over the pixels when they disagree.

Maximum string length: 2000
Example:

"today's treadmill session"

Response

The photos were classified and, unless kind is other, logged.

Result of classify-and-log. kind says what the photos showed; food results carry the MealAnalysis fields, workout results carry workout, and other logs nothing.

kind
enum<string>
required

What the photos were classified as.

Available options:
food,
workout,
weight,
measurement,
other
Example:

"workout"

ok
boolean

True when something was logged.

Example:

true

mealId
string<uuid>

Created meal id (food only).

Example:

"3f8b1c2a-5d6e-4f70-8a1b-2c3d4e5f6071"

items
object[]

Estimated food items (food only).

Example:
totalKcal
integer

Summed calories (food only).

Example:

374

totalProteinG
integer

Summed protein grams (food only).

Example:

54

note
string

Model assumptions note (food only).

Example:

"assumed a single chicken breast"

photoKeys
string[]

Stored photo keys (food only).

Example:
workout
object

A logged workout, normalized to the standard fields of Apple Health, Garmin, and Strava; metric fields are null when the user didn't state them.

pounds
number

Logged body weight in pounds (weight only).

Example:

158.2

weightKg
number

Logged body weight in kilograms (weight only).

Example:

71.8

bodyFatPct
number | null

Body-fat percentage when the scale showed one (weight only).

Example:

17.2

site
string

Body site the measurement was logged against (measurement only).

Example:

"waist"

inches
number

Measured value in inches (measurement only).

Example:

31.8

needSite
boolean

True when a measurement was read but the body site could not be identified — nothing was logged; resubmit with a caption naming the site.

Example:

false