> For the complete documentation index, see [llms.txt](https://docs.january.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.january.ai/rest-api/models.md).

# Models

## The ApiErrorDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"ApiErrorDto":{"type":"object","properties":{"message":{"type":"string","description":"A developer-facing explanation of what went wrong and how to fix it."},"code":{"type":"string","description":"A stable machine-readable identifier for the class of failure — build retry logic on this, never on message wording. Current values: invalid_request, unauthorized, forbidden, not_found, not_implemented, payload_too_large, rate_limited, internal_error, upstream_error, service_unavailable, upstream_timeout. Only rate_limited, internal_error, upstream_error, service_unavailable, and upstream_timeout are safe to retry (with backoff) — not_implemented is permanent until the feature ships. New codes may be added over time; treat an unknown code according to its HTTP status class."},"docs_url":{"type":"string","description":"Link to the developer documentation."}},"required":["message","code","docs_url"]}}}}
```

## The CreditsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"CreditsResponseDto":{"type":"object","properties":{"plan":{"type":"string","description":"The plan this allowance comes from."},"period_start":{"type":"string","description":"First day of the current billing period (UTC), inclusive."},"period_end":{"type":"string","description":"Last day of the current billing period (UTC), inclusive."},"resets_at":{"type":"string","description":"When the allowance resets and `used_credits` returns to 0."},"included_credits":{"type":"number","description":"Credits included in the plan for this period. Absent when the plan has no ceiling."},"used_credits":{"type":"number","description":"Credits used so far this period. One successful v1.2 API call costs 1 credit; failed calls cost nothing."},"remaining_credits":{"type":"number","description":"Credits left in this period. Absent when the plan has no ceiling."}},"required":["plan","period_start","period_end","resets_at","used_credits"]}}}}
```

## The NutrientAmountDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]}}}}
```

## The NutrientsDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"NutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"trans_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"cholesterol":{"$ref":"#/components/schemas/NutrientAmountDto"},"calcium":{"$ref":"#/components/schemas/NutrientAmountDto"},"iron":{"$ref":"#/components/schemas/NutrientAmountDto"},"potassium":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"},"vitamin_d":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]}}}}
```

## The FoodServingDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"FoodServingDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"},"scaling_factor":{"type":"number","description":"Multiplier applied to the food's nutrition values for this serving."},"weight_grams":{"type":"number","nullable":true},"is_primary":{"type":"boolean","description":"Whether this is the default serving for the food."}},"required":["id","quantity","unit","scaling_factor","weight_grams","is_primary"]}}}}
```

## The FoodDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"FoodDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"brand_name":{"type":"string","description":"Absent for generic (non-branded) foods."},"nutrients":{"description":"Per-serving nutrition in the shared nutrient vocabulary. Keys are omitted when the database has no value.","allOf":[{"$ref":"#/components/schemas/NutrientsDto"}]},"glycemic_index":{"type":"number","description":"Glycemic index."},"glycemic_load":{"type":"number","description":"Glycemic load."},"image_url":{"type":"string","description":"URL of a picture of the food, when the database has one."},"upc":{"type":"string","description":"The product's barcode, for branded foods that have one."},"servings":{"type":"array","items":{"$ref":"#/components/schemas/FoodServingDto"}}},"required":["id","name","nutrients","servings"]},"NutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"trans_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"cholesterol":{"$ref":"#/components/schemas/NutrientAmountDto"},"calcium":{"$ref":"#/components/schemas/NutrientAmountDto"},"iron":{"$ref":"#/components/schemas/NutrientAmountDto"},"potassium":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"},"vitamin_d":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]},"FoodServingDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"},"scaling_factor":{"type":"number","description":"Multiplier applied to the food's nutrition values for this serving."},"weight_grams":{"type":"number","nullable":true},"is_primary":{"type":"boolean","description":"Whether this is the default serving for the food."}},"required":["id","quantity","unit","scaling_factor","weight_grams","is_primary"]}}}}
```

## The FoodSearchResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"FoodSearchResponseDto":{"type":"object","properties":{"total_count":{"type":"number","description":"Match count reported by the food database. It currently reports a fixed page size rather than a true total, so do not compute page counts from it — request more results with `limit` instead."},"items":{"type":"array","items":{"$ref":"#/components/schemas/FoodDto"}}},"required":["total_count","items"]},"FoodDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"brand_name":{"type":"string","description":"Absent for generic (non-branded) foods."},"nutrients":{"description":"Per-serving nutrition in the shared nutrient vocabulary. Keys are omitted when the database has no value.","allOf":[{"$ref":"#/components/schemas/NutrientsDto"}]},"glycemic_index":{"type":"number","description":"Glycemic index."},"glycemic_load":{"type":"number","description":"Glycemic load."},"image_url":{"type":"string","description":"URL of a picture of the food, when the database has one."},"upc":{"type":"string","description":"The product's barcode, for branded foods that have one."},"servings":{"type":"array","items":{"$ref":"#/components/schemas/FoodServingDto"}}},"required":["id","name","nutrients","servings"]},"NutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"trans_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"cholesterol":{"$ref":"#/components/schemas/NutrientAmountDto"},"calcium":{"$ref":"#/components/schemas/NutrientAmountDto"},"iron":{"$ref":"#/components/schemas/NutrientAmountDto"},"potassium":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"},"vitamin_d":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]},"FoodServingDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"},"scaling_factor":{"type":"number","description":"Multiplier applied to the food's nutrition values for this serving."},"weight_grams":{"type":"number","nullable":true},"is_primary":{"type":"boolean","description":"Whether this is the default serving for the food."}},"required":["id","quantity","unit","scaling_factor","weight_grams","is_primary"]}}}}
```

## The FoodSuggestionDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"FoodSuggestionDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string","description":"Generic foods are lowercase; branded foods keep their product name."},"brand_name":{"type":"string","description":"Absent for generic (non-branded) foods."},"image_url":{"type":"string","description":"Thumbnail of the food, when the database has one."},"nutrients":{"description":"Calories per default serving, in the shared nutrient vocabulary — the one nutrient a suggestion carries. Fetch the food for the full panel.","allOf":[{"$ref":"#/components/schemas/NutrientsDto"}]}},"required":["id","name"]},"NutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"trans_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"cholesterol":{"$ref":"#/components/schemas/NutrientAmountDto"},"calcium":{"$ref":"#/components/schemas/NutrientAmountDto"},"iron":{"$ref":"#/components/schemas/NutrientAmountDto"},"potassium":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"},"vitamin_d":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]}}}}
```

## The FoodSuggestionsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"FoodSuggestionsResponseDto":{"type":"object","properties":{"items":{"description":"Ranked suggestions, generic foods before branded. Empty when nothing matches.","type":"array","items":{"$ref":"#/components/schemas/FoodSuggestionDto"}}},"required":["items"]},"FoodSuggestionDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string","description":"Generic foods are lowercase; branded foods keep their product name."},"brand_name":{"type":"string","description":"Absent for generic (non-branded) foods."},"image_url":{"type":"string","description":"Thumbnail of the food, when the database has one."},"nutrients":{"description":"Calories per default serving, in the shared nutrient vocabulary — the one nutrient a suggestion carries. Fetch the food for the full panel.","allOf":[{"$ref":"#/components/schemas/NutrientsDto"}]}},"required":["id","name"]},"NutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"trans_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"cholesterol":{"$ref":"#/components/schemas/NutrientAmountDto"},"calcium":{"$ref":"#/components/schemas/NutrientAmountDto"},"iron":{"$ref":"#/components/schemas/NutrientAmountDto"},"potassium":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"},"vitamin_d":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]}}}}
```

## The FoodAlternativesRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"FoodAlternativesRequestDto":{"type":"object","properties":{"diet_restrictions":{"type":"array","description":"Allergens/ingredients to avoid. Omit it (or send []) if none apply.","items":{"type":"string","enum":["gluten","lactose","yeast","tree_nuts","peanuts","dairy","eggs","sulfites","soy","wheat","shellfish","fish","mushrooms","sesame","msg","caffeine","fodmaps"]}},"diet_preferences":{"type":"array","description":"Dietary patterns to match. Omit it (or send []) if none apply.","items":{"type":"string","enum":["vegetarian","vegan","keto","paleo","pescatarian","low_carbohydrate","high_protein","kosher","halal"]}}}}}}}
```

## The MacroNutrientsDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"MacroNutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]}}}}
```

## The ServingSummaryDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"ServingSummaryDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"}},"required":["id","unit"]}}}}
```

## The AlternativeFoodDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"AlternativeFoodDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"brand_name":{"type":"string","description":"Empty for generic (non-branded) foods."},"nutrients":{"$ref":"#/components/schemas/MacroNutrientsDto"},"servings":{"type":"array","items":{"$ref":"#/components/schemas/ServingSummaryDto"}}},"required":["name","nutrients"]},"MacroNutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]},"ServingSummaryDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"}},"required":["id","unit"]}}}}
```

## The FoodAlternativeDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"FoodAlternativeDto":{"type":"object","properties":{"food":{"$ref":"#/components/schemas/AlternativeFoodDto"}},"required":["food"]},"AlternativeFoodDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"brand_name":{"type":"string","description":"Empty for generic (non-branded) foods."},"nutrients":{"$ref":"#/components/schemas/MacroNutrientsDto"},"servings":{"type":"array","items":{"$ref":"#/components/schemas/ServingSummaryDto"}}},"required":["name","nutrients"]},"MacroNutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]},"ServingSummaryDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"}},"required":["id","unit"]}}}}
```

## The FoodAlternativesResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"FoodAlternativesResponseDto":{"type":"object","properties":{"alternatives":{"description":"Healthier alternatives matching the restrictions and preferences. An empty array is a valid result, not an error.","type":"array","items":{"$ref":"#/components/schemas/FoodAlternativeDto"}}},"required":["alternatives"]},"FoodAlternativeDto":{"type":"object","properties":{"food":{"$ref":"#/components/schemas/AlternativeFoodDto"}},"required":["food"]},"AlternativeFoodDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"brand_name":{"type":"string","description":"Empty for generic (non-branded) foods."},"nutrients":{"$ref":"#/components/schemas/MacroNutrientsDto"},"servings":{"type":"array","items":{"$ref":"#/components/schemas/ServingSummaryDto"}}},"required":["name","nutrients"]},"MacroNutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]},"ServingSummaryDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"}},"required":["id","unit"]}}}}
```

## The RestaurantResultDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"RestaurantResultDto":{"type":"object","properties":{"type":{"type":"string","enum":["restaurant","menu_item"],"description":"When coordinates are provided and the name matches no restaurant, results may be menu items instead."},"id":{"type":"string"},"name":{"type":"string"},"is_chain":{"type":"boolean"},"distance":{"type":"number","description":"Distance from (latitude, longitude) in meters; present only when coordinates were provided."},"city":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"}},"required":["type","id","name"]}}}}
```

## The RestaurantSearchResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"RestaurantSearchResponseDto":{"type":"object","properties":{"total_count":{"type":"number","description":"Total number of matches; may exceed the number of items returned."},"items":{"type":"array","items":{"$ref":"#/components/schemas/RestaurantResultDto"}}},"required":["total_count","items"]},"RestaurantResultDto":{"type":"object","properties":{"type":{"type":"string","enum":["restaurant","menu_item"],"description":"When coordinates are provided and the name matches no restaurant, results may be menu items instead."},"id":{"type":"string"},"name":{"type":"string"},"is_chain":{"type":"boolean"},"distance":{"type":"number","description":"Distance from (latitude, longitude) in meters; present only when coordinates were provided."},"city":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"}},"required":["type","id","name"]}}}}
```

## The MenuItemDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"MenuItemDto":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"restaurant_name":{"type":"string"},"is_chain":{"type":"boolean"},"nutrients":{"description":"Per-dish nutrition in the shared nutrient vocabulary. Keys are omitted when the menu source has no value.","allOf":[{"$ref":"#/components/schemas/NutrientsDto"}]},"glycemic_index":{"type":"number","description":"Glycemic index."},"glycemic_load":{"type":"number","description":"Glycemic load."},"image_url":{"type":"string","description":"URL of a picture of the dish, when the source has one."},"distance":{"type":"number","description":"Distance from (latitude, longitude) in meters."},"servings":{"type":"array","items":{"$ref":"#/components/schemas/FoodServingDto"}}},"required":["type","id","name","restaurant_name","servings"]},"NutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"trans_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"cholesterol":{"$ref":"#/components/schemas/NutrientAmountDto"},"calcium":{"$ref":"#/components/schemas/NutrientAmountDto"},"iron":{"$ref":"#/components/schemas/NutrientAmountDto"},"potassium":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"},"vitamin_d":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]},"FoodServingDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"},"scaling_factor":{"type":"number","description":"Multiplier applied to the food's nutrition values for this serving."},"weight_grams":{"type":"number","nullable":true},"is_primary":{"type":"boolean","description":"Whether this is the default serving for the food."}},"required":["id","quantity","unit","scaling_factor","weight_grams","is_primary"]}}}}
```

## The MenuSearchResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"MenuSearchResponseDto":{"type":"object","properties":{"total_count":{"type":"number","description":"Total number of matches; may exceed the number of items returned."},"items":{"type":"array","items":{"$ref":"#/components/schemas/MenuItemDto"}}},"required":["total_count","items"]},"MenuItemDto":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"restaurant_name":{"type":"string"},"is_chain":{"type":"boolean"},"nutrients":{"description":"Per-dish nutrition in the shared nutrient vocabulary. Keys are omitted when the menu source has no value.","allOf":[{"$ref":"#/components/schemas/NutrientsDto"}]},"glycemic_index":{"type":"number","description":"Glycemic index."},"glycemic_load":{"type":"number","description":"Glycemic load."},"image_url":{"type":"string","description":"URL of a picture of the dish, when the source has one."},"distance":{"type":"number","description":"Distance from (latitude, longitude) in meters."},"servings":{"type":"array","items":{"$ref":"#/components/schemas/FoodServingDto"}}},"required":["type","id","name","restaurant_name","servings"]},"NutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"trans_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"cholesterol":{"$ref":"#/components/schemas/NutrientAmountDto"},"calcium":{"$ref":"#/components/schemas/NutrientAmountDto"},"iron":{"$ref":"#/components/schemas/NutrientAmountDto"},"potassium":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"},"vitamin_d":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]},"FoodServingDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"},"scaling_factor":{"type":"number","description":"Multiplier applied to the food's nutrition values for this serving."},"weight_grams":{"type":"number","nullable":true},"is_primary":{"type":"boolean","description":"Whether this is the default serving for the food."}},"required":["id","quantity","unit","scaling_factor","weight_grams","is_primary"]}}}}
```

## The ScanPhotoDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"ScanPhotoDto":{"type":"object","properties":{"image":{"type":"string","description":"The meal photo, as an http(s) URL or a base64 data URI (data:image/jpeg;base64,…). Any image of the meal works — a camera photo, a screenshot, or a hosted picture. Formats: JPG, PNG, WEBP, and non-animated GIF. A URL must be publicly fetchable server-side: hosts that block hotlinking or require a login cannot be read. Prefer the URL when the image is already hosted — base64 inflates the payload by ~33%, and request bodies over 5 MB are rejected, so keep raw images under ~3.5 MB when encoding."}},"required":["image"]}}}}
```

## The DetectionServingDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"DetectionServingDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"},"selected_quantity":{"type":"number","description":"Quantity the parser selected from the text ('2 cups' → 2); text scans only. Advisory — corrections reads the serving's own quantity."}},"required":["id","unit"]}}}}
```

## The DetectionFoodDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"DetectionFoodDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"brand_name":{"type":"string","description":"Empty for generic (non-branded) foods."},"nutrients":{"$ref":"#/components/schemas/MacroNutrientsDto"},"servings":{"description":"Never empty: every detection producer guarantees at least one serving.","type":"array","items":{"$ref":"#/components/schemas/DetectionServingDto"}}},"required":["name","nutrients","servings"]},"MacroNutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]},"DetectionServingDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"},"selected_quantity":{"type":"number","description":"Quantity the parser selected from the text ('2 cups' → 2); text scans only. Advisory — corrections reads the serving's own quantity."}},"required":["id","unit"]}}}}
```

## The DetectionDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"DetectionDto":{"type":"object","properties":{"confidence_score":{"type":"string","enum":["high","medium","low"],"description":"Photo scans only; absent on text scans."},"food":{"$ref":"#/components/schemas/DetectionFoodDto"}},"required":["food"]},"DetectionFoodDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"brand_name":{"type":"string","description":"Empty for generic (non-branded) foods."},"nutrients":{"$ref":"#/components/schemas/MacroNutrientsDto"},"servings":{"description":"Never empty: every detection producer guarantees at least one serving.","type":"array","items":{"$ref":"#/components/schemas/DetectionServingDto"}}},"required":["name","nutrients","servings"]},"MacroNutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]},"DetectionServingDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"},"selected_quantity":{"type":"number","description":"Quantity the parser selected from the text ('2 cups' → 2); text scans only. Advisory — corrections reads the serving's own quantity."}},"required":["id","unit"]}}}}
```

## The ScanResultDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"ScanResultDto":{"type":"object","properties":{"meal_name":{"type":"string"},"total_nutrients":{"description":"Aggregated nutrition across all detections.","allOf":[{"$ref":"#/components/schemas/MacroNutrientsDto"}]},"detections":{"description":"Detected foods. Always present — an empty array means nothing was recognized.","type":"array","items":{"$ref":"#/components/schemas/DetectionDto"}}},"required":["detections"]},"MacroNutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]},"DetectionDto":{"type":"object","properties":{"confidence_score":{"type":"string","enum":["high","medium","low"],"description":"Photo scans only; absent on text scans."},"food":{"$ref":"#/components/schemas/DetectionFoodDto"}},"required":["food"]},"DetectionFoodDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"brand_name":{"type":"string","description":"Empty for generic (non-branded) foods."},"nutrients":{"$ref":"#/components/schemas/MacroNutrientsDto"},"servings":{"description":"Never empty: every detection producer guarantees at least one serving.","type":"array","items":{"$ref":"#/components/schemas/DetectionServingDto"}}},"required":["name","nutrients","servings"]},"DetectionServingDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"},"selected_quantity":{"type":"number","description":"Quantity the parser selected from the text ('2 cups' → 2); text scans only. Advisory — corrections reads the serving's own quantity."}},"required":["id","unit"]}}}}
```

## The ScanTextDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"ScanTextDto":{"type":"object","properties":{"text":{"type":"string","description":"Natural-language description of what was eaten; parsed into detected foods with quantities.","maxLength":512}},"required":["text"]}}}}
```

## The CorrectScanDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"CorrectScanDto":{"type":"object","properties":{"meal_name":{"type":"string","description":"The meal name from the scan, when it returned one (photo scans do; text scans don't). Defaults to 'Meal'."},"detections":{"description":"The detections array from a photo or text food scan, exactly as returned. Omitted zero-value nutrient keys are filled in automatically; each detection needs at least one serving.","type":"array","items":{"$ref":"#/components/schemas/DetectionDto"}},"user_input":{"type":"string","description":"Plain-English description of what to correct."}},"required":["detections","user_input"]},"DetectionDto":{"type":"object","properties":{"confidence_score":{"type":"string","enum":["high","medium","low"],"description":"Photo scans only; absent on text scans."},"food":{"$ref":"#/components/schemas/DetectionFoodDto"}},"required":["food"]},"DetectionFoodDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"brand_name":{"type":"string","description":"Empty for generic (non-branded) foods."},"nutrients":{"$ref":"#/components/schemas/MacroNutrientsDto"},"servings":{"description":"Never empty: every detection producer guarantees at least one serving.","type":"array","items":{"$ref":"#/components/schemas/DetectionServingDto"}}},"required":["name","nutrients","servings"]},"MacroNutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]},"DetectionServingDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"},"selected_quantity":{"type":"number","description":"Quantity the parser selected from the text ('2 cups' → 2); text scans only. Advisory — corrections reads the serving's own quantity."}},"required":["id","unit"]}}}}
```

## The ServingSelectionDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"ServingSelectionDto":{"type":"object","properties":{"id":{"type":"number","description":"One of the food's serving ids."},"quantity":{"type":"number","description":"How many of that serving were consumed.","maximum":10000}},"required":["id","quantity"]}}}}
```

## The FoodSelectionDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"FoodSelectionDto":{"type":"object","properties":{"id":{"type":"number","description":"Food id from a search, scan, or detection result."},"serving":{"$ref":"#/components/schemas/ServingSelectionDto"}},"required":["id","serving"]},"ServingSelectionDto":{"type":"object","properties":{"id":{"type":"number","description":"One of the food's serving ids."},"quantity":{"type":"number","description":"How many of that serving were consumed.","maximum":10000}},"required":["id","quantity"]}}}}
```

## The CreateFoodLogDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"CreateFoodLogDto":{"type":"object","properties":{"foods":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/FoodSelectionDto"}},"timestamp_utc":{"type":"string","format":"date-time","description":"When the meal was eaten — any ISO-8601 offset; stored and returned in UTC. Omitted = now."},"name":{"type":"string","maxLength":256}},"required":["foods"]},"FoodSelectionDto":{"type":"object","properties":{"id":{"type":"number","description":"Food id from a search, scan, or detection result."},"serving":{"$ref":"#/components/schemas/ServingSelectionDto"}},"required":["id","serving"]},"ServingSelectionDto":{"type":"object","properties":{"id":{"type":"number","description":"One of the food's serving ids."},"quantity":{"type":"number","description":"How many of that serving were consumed.","maximum":10000}},"required":["id","quantity"]}}}}
```

## The ServingDetailsDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"ServingDetailsDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"},"weight_grams":{"type":"number","nullable":true}},"required":["id","quantity","unit"]}}}}
```

## The LoggedFoodDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"LoggedFoodDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"brand_name":{"type":"string","nullable":true},"image_url":{"type":"string","nullable":true},"glycemic_index":{"type":"number","nullable":true},"glycemic_load":{"type":"number","nullable":true},"nutrients":{"description":"Scaled to the consumed serving.","allOf":[{"$ref":"#/components/schemas/NutrientsDto"}]},"consumed_serving":{"description":"What was logged.","allOf":[{"$ref":"#/components/schemas/ServingSelectionDto"}]},"serving_details":{"description":"The serving definition the quantity refers to.","allOf":[{"$ref":"#/components/schemas/ServingDetailsDto"}]}},"required":["id","name","nutrients","consumed_serving","serving_details"]},"NutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"trans_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"cholesterol":{"$ref":"#/components/schemas/NutrientAmountDto"},"calcium":{"$ref":"#/components/schemas/NutrientAmountDto"},"iron":{"$ref":"#/components/schemas/NutrientAmountDto"},"potassium":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"},"vitamin_d":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]},"ServingSelectionDto":{"type":"object","properties":{"id":{"type":"number","description":"One of the food's serving ids."},"quantity":{"type":"number","description":"How many of that serving were consumed.","maximum":10000}},"required":["id","quantity"]},"ServingDetailsDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"},"weight_grams":{"type":"number","nullable":true}},"required":["id","quantity","unit"]}}}}
```

## The FoodLogDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"FoodLogDto":{"type":"object","properties":{"id":{"type":"string","description":"Save this id to update or delete the log."},"foods":{"type":"array","items":{"$ref":"#/components/schemas/LoggedFoodDto"}},"timestamp_utc":{"type":"string","format":"date-time"},"name":{"type":"string","nullable":true}},"required":["id","foods","timestamp_utc"]},"LoggedFoodDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"brand_name":{"type":"string","nullable":true},"image_url":{"type":"string","nullable":true},"glycemic_index":{"type":"number","nullable":true},"glycemic_load":{"type":"number","nullable":true},"nutrients":{"description":"Scaled to the consumed serving.","allOf":[{"$ref":"#/components/schemas/NutrientsDto"}]},"consumed_serving":{"description":"What was logged.","allOf":[{"$ref":"#/components/schemas/ServingSelectionDto"}]},"serving_details":{"description":"The serving definition the quantity refers to.","allOf":[{"$ref":"#/components/schemas/ServingDetailsDto"}]}},"required":["id","name","nutrients","consumed_serving","serving_details"]},"NutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"trans_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"cholesterol":{"$ref":"#/components/schemas/NutrientAmountDto"},"calcium":{"$ref":"#/components/schemas/NutrientAmountDto"},"iron":{"$ref":"#/components/schemas/NutrientAmountDto"},"potassium":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"},"vitamin_d":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]},"ServingSelectionDto":{"type":"object","properties":{"id":{"type":"number","description":"One of the food's serving ids."},"quantity":{"type":"number","description":"How many of that serving were consumed.","maximum":10000}},"required":["id","quantity"]},"ServingDetailsDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"},"weight_grams":{"type":"number","nullable":true}},"required":["id","quantity","unit"]}}}}
```

## The FoodLogListResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"FoodLogListResponseDto":{"type":"object","properties":{"total_count":{"type":"number"},"items":{"description":"Logs in the range, ordered by timestamp. An empty list is a valid result.","type":"array","items":{"$ref":"#/components/schemas/FoodLogDto"}}},"required":["total_count","items"]},"FoodLogDto":{"type":"object","properties":{"id":{"type":"string","description":"Save this id to update or delete the log."},"foods":{"type":"array","items":{"$ref":"#/components/schemas/LoggedFoodDto"}},"timestamp_utc":{"type":"string","format":"date-time"},"name":{"type":"string","nullable":true}},"required":["id","foods","timestamp_utc"]},"LoggedFoodDto":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"brand_name":{"type":"string","nullable":true},"image_url":{"type":"string","nullable":true},"glycemic_index":{"type":"number","nullable":true},"glycemic_load":{"type":"number","nullable":true},"nutrients":{"description":"Scaled to the consumed serving.","allOf":[{"$ref":"#/components/schemas/NutrientsDto"}]},"consumed_serving":{"description":"What was logged.","allOf":[{"$ref":"#/components/schemas/ServingSelectionDto"}]},"serving_details":{"description":"The serving definition the quantity refers to.","allOf":[{"$ref":"#/components/schemas/ServingDetailsDto"}]}},"required":["id","name","nutrients","consumed_serving","serving_details"]},"NutrientsDto":{"type":"object","properties":{"calories":{"$ref":"#/components/schemas/NutrientAmountDto"},"protein":{"$ref":"#/components/schemas/NutrientAmountDto"},"carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"net_carbohydrates":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"trans_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"saturated_fat":{"$ref":"#/components/schemas/NutrientAmountDto"},"fiber":{"$ref":"#/components/schemas/NutrientAmountDto"},"total_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"added_sugars":{"$ref":"#/components/schemas/NutrientAmountDto"},"cholesterol":{"$ref":"#/components/schemas/NutrientAmountDto"},"calcium":{"$ref":"#/components/schemas/NutrientAmountDto"},"iron":{"$ref":"#/components/schemas/NutrientAmountDto"},"potassium":{"$ref":"#/components/schemas/NutrientAmountDto"},"sodium":{"$ref":"#/components/schemas/NutrientAmountDto"},"vitamin_d":{"$ref":"#/components/schemas/NutrientAmountDto"}}},"NutrientAmountDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","description":"Canonical across the API: g, mg, kcal, IU."}},"required":["value","unit"]},"ServingSelectionDto":{"type":"object","properties":{"id":{"type":"number","description":"One of the food's serving ids."},"quantity":{"type":"number","description":"How many of that serving were consumed.","maximum":10000}},"required":["id","quantity"]},"ServingDetailsDto":{"type":"object","properties":{"id":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string"},"weight_grams":{"type":"number","nullable":true}},"required":["id","quantity","unit"]}}}}
```

## The UpdateFoodLogDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"UpdateFoodLogDto":{"type":"object","properties":{"foods":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/FoodSelectionDto"}},"timestamp_utc":{"type":"string","description":"UTC consumption time, ending in Z."},"name":{"type":"string","maxLength":256}}},"FoodSelectionDto":{"type":"object","properties":{"id":{"type":"number","description":"Food id from a search, scan, or detection result."},"serving":{"$ref":"#/components/schemas/ServingSelectionDto"}},"required":["id","serving"]},"ServingSelectionDto":{"type":"object","properties":{"id":{"type":"number","description":"One of the food's serving ids."},"quantity":{"type":"number","description":"How many of that serving were consumed.","maximum":10000}},"required":["id","quantity"]}}}}
```

## The DeleteFoodLogResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"DeleteFoodLogResponseDto":{"type":"object","properties":{"status":{"type":"string","description":"Deletion is idempotent — an unknown or already-deleted log_id returns the same response."}},"required":["status"]}}}}
```

## The HeightDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"HeightDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","enum":["in","cm"]}},"required":["value","unit"]}}}}
```

## The WeightDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"WeightDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","enum":["lb","kg"]}},"required":["value","unit"]}}}}
```

## The GlucoseUserProfileDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"GlucoseUserProfileDto":{"type":"object","properties":{"age":{"type":"number"},"sex":{"type":"string","enum":["male","female"],"description":"Biological sex, as consumed by the prediction model."},"height":{"$ref":"#/components/schemas/HeightDto"},"weight":{"$ref":"#/components/schemas/WeightDto"},"activity_level":{"type":"string","enum":["sedentary","lightly_active","moderately_active","very_active"]},"health_conditions":{"type":"array","description":"Omit it (or send []) if none apply. Type 1 diabetes is not supported by the prediction model.","items":{"type":"string","enum":["type_2_diabetes","prediabetes"]}}},"required":["age","sex","height","weight"]},"HeightDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","enum":["in","cm"]}},"required":["value","unit"]},"WeightDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","enum":["lb","kg"]}},"required":["value","unit"]}}}}
```

## The CgmReadingDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"CgmReadingDto":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"When the reading was taken. Must carry a timezone designator."},"value":{"type":"number","description":"mg/dL. At most one reading per 15-minute window."}},"required":["timestamp","value"]}}}}
```

## The ConsumedFoodEntryDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"ConsumedFoodEntryDto":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"When the food was eaten. Must carry a timezone designator."},"id":{"type":"number"},"serving":{"$ref":"#/components/schemas/ServingSelectionDto"}},"required":["timestamp","id","serving"]},"ServingSelectionDto":{"type":"object","properties":{"id":{"type":"number","description":"One of the food's serving ids."},"quantity":{"type":"number","description":"How many of that serving were consumed.","maximum":10000}},"required":["id","quantity"]}}}}
```

## The GlucosePredictDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"GlucosePredictDto":{"type":"object","properties":{"user_profile":{"$ref":"#/components/schemas/GlucoseUserProfileDto"},"foods":{"description":"The meal to predict the glucose response for.","maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/FoodSelectionDto"}},"start_time":{"type":"string","format":"date-time","description":"When the meal is (or will be) eaten. Must carry a timezone designator."},"cgm_data":{"description":"Optional CGM history for personalization; requires consumed_foods.","type":"array","items":{"$ref":"#/components/schemas/CgmReadingDto"}},"consumed_foods":{"description":"The meals eaten during the CGM history; requires cgm_data.","type":"array","items":{"$ref":"#/components/schemas/ConsumedFoodEntryDto"}}},"required":["user_profile","foods","start_time"]},"GlucoseUserProfileDto":{"type":"object","properties":{"age":{"type":"number"},"sex":{"type":"string","enum":["male","female"],"description":"Biological sex, as consumed by the prediction model."},"height":{"$ref":"#/components/schemas/HeightDto"},"weight":{"$ref":"#/components/schemas/WeightDto"},"activity_level":{"type":"string","enum":["sedentary","lightly_active","moderately_active","very_active"]},"health_conditions":{"type":"array","description":"Omit it (or send []) if none apply. Type 1 diabetes is not supported by the prediction model.","items":{"type":"string","enum":["type_2_diabetes","prediabetes"]}}},"required":["age","sex","height","weight"]},"HeightDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","enum":["in","cm"]}},"required":["value","unit"]},"WeightDto":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","enum":["lb","kg"]}},"required":["value","unit"]},"FoodSelectionDto":{"type":"object","properties":{"id":{"type":"number","description":"Food id from a search, scan, or detection result."},"serving":{"$ref":"#/components/schemas/ServingSelectionDto"}},"required":["id","serving"]},"ServingSelectionDto":{"type":"object","properties":{"id":{"type":"number","description":"One of the food's serving ids."},"quantity":{"type":"number","description":"How many of that serving were consumed.","maximum":10000}},"required":["id","quantity"]},"CgmReadingDto":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"When the reading was taken. Must carry a timezone designator."},"value":{"type":"number","description":"mg/dL. At most one reading per 15-minute window."}},"required":["timestamp","value"]},"ConsumedFoodEntryDto":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"When the food was eaten. Must carry a timezone designator."},"id":{"type":"number"},"serving":{"$ref":"#/components/schemas/ServingSelectionDto"}},"required":["timestamp","id","serving"]}}}}
```

## The GlucosePredictionPointDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"GlucosePredictionPointDto":{"type":"object","properties":{"minutes":{"type":"number","description":"Minutes after start_time."},"value":{"type":"number","description":"Predicted glucose, mg/dL."}},"required":["minutes","value"]}}}}
```

## The GlucoseChartDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"GlucoseChartDto":{"type":"object","properties":{"min":{"type":"number","description":"Suggested Y-axis lower bound (mg/dL). A fixed target-range bound, not the minimum of the curve."},"max":{"type":"number","description":"Suggested Y-axis upper bound (mg/dL): 180 with Type 2 diabetes in health_conditions, otherwise 140. Not the maximum of the curve."}},"required":["min","max"]}}}}
```

## The GlucosePredictionResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"January AI - Nutrition Intelligence APIs","version":"1.2"},"components":{"schemas":{"GlucosePredictionResponseDto":{"type":"object","properties":{"prediction":{"description":"The predicted glucose curve at 15-minute intervals, starting at start_time.","type":"array","items":{"$ref":"#/components/schemas/GlucosePredictionPointDto"}},"impact_score":{"type":"string","enum":["low","medium","high"],"description":"The meal's overall glucose impact."},"chart":{"$ref":"#/components/schemas/GlucoseChartDto"}},"required":["prediction","impact_score","chart"]},"GlucosePredictionPointDto":{"type":"object","properties":{"minutes":{"type":"number","description":"Minutes after start_time."},"value":{"type":"number","description":"Predicted glucose, mg/dL."}},"required":["minutes","value"]},"GlucoseChartDto":{"type":"object","properties":{"min":{"type":"number","description":"Suggested Y-axis lower bound (mg/dL). A fixed target-range bound, not the minimum of the curve."},"max":{"type":"number","description":"Suggested Y-axis upper bound (mg/dL): 180 with Type 2 diabetes in health_conditions, otherwise 140. Not the maximum of the curve."}},"required":["min","max"]}}}}
```
