Skip to main content

Endpoint

POST /api/v1/food/analyze
Authorization: Bearer <access_token>
X-Language:    zh-CN
Content-Type:  multipart/form-data
Form fields:
  • file=@/path/food.jpg (required, PNG / JPEG / WEBP / HEIC / HEIF)
  • query=Maintain healthy diet (optional — inject user’s health goal)

SSE events

typeMeaning
idfood_analysis_<ts>_<uid>
thinkingPhase prompts (“Analyzing image…”)
foodcontent is a stringified JSON containing is_food (1 = success / 0 = not food), food_items, nutrition, advice
errore.g. Recognition failed!
endEnd
food.content is a string — the client must JSON.parse it.