---
title: "Predict a food's ontology path by rxfood_id (internal testing)"
method: POST
path: "/internal/food_classifier/classify_ontology"
tags: ["internal", "food_classifier"]
---

# Predict a food's ontology path by rxfood_id (internal testing)

`POST /internal/food_classifier/classify_ontology`

Phase 1 admin-only testing endpoint for the LLM ontology classifier. Predicts the {level1..level4} ontology path for the food identified by rxfood_id and returns it alongside the food's current ontology for comparison. Read-only — does not change food.ontology. Do NOT invoke from production paths.

## Request body

- FoodClassifierClassifyOntologyRequest
  - `mode` 'single_shot' | 'cascading'
  - `rxfood_id` string, required

## Response `200`

successful classification

- FoodClassifierClassifyOntologyResponse
  - `current_ontology` object, nullable
  - `invalid_selections` object[]
  - `json_parse_failures` string[]
  - `llm_metadata` object[]
  - `matches_current` boolean, nullable
  - `mode` string
  - `prediction` object, required
  - `rationale_per_level` object
  - `rxfood_id` string, nullable
  - `total_cost_cents` number

## Other responses

- `400` — invalid request
- `403` — not authorized
- `404` — food not found

---

[API](https://skmtc.dev/rxfoodapp/apis/inneranalytics-mnt-server.md) · [All operations](https://skmtc.dev/rxfoodapp/apis/inneranalytics-mnt-server/llms.txt) · [OpenAPI document](https://skmtc.dev/rxfoodapp/apis/inneranalytics-mnt-server/revisions/a229b18839a0?raw)
