Restaurant Operations Intelligence API Documentation
Read supplied recipes, supplier prices, sales, and allergen flags to calculate food cost and menu profitability without inventing nutrition or compliance claims. Payment is the exact USDC price on Base with x402.
https://brainiac.software/api/v1/restaurant-operations/recipe-cost-calculate$0.04 USDCCalculate recipe cost
Calculate recipe and per-portion cost from supplied ingredient quantities and prices after unit conversion. Missing prices are not invented.
Body
| Field | Required | Notes |
|---|---|---|
text | No | string |
json | No | string |
csv | No | string |
file | No | object; Object |
ingredients | No | array; Array |
prices | No | array; Array |
recipes | No | array; Array |
recipeLines | No | array; Array |
sales | No | array; Array |
waste | No | array; Array |
allergens | No | array; Array |
matrix | No | array; Array |
asOf | No | string |
Request exampleJSON
{
"ingredients": [
{
"id": "flour",
"name": "Flour",
"unit": "g",
"unitPrice": 0.002
},
{
"id": "butter",
"name": "Butter",
"unit": "g",
"packSize": 250,
"packPrice": 3
}
],
"recipes": [
{
"id": "R-1",
"name": "Cookie",
"portions": 10,
"sellPrice": 3
}
],
"recipeLines": [
{
"recipeId": "R-1",
"ingredientId": "flour",
"quantity": 500,
"unit": "g"
},
{
"recipeId": "R-1",
"ingredientId": "butter",
"quantity": 100,
"unit": "g"
}
]
}Response exampleJSON
{
"checkedAt": "2026-11-04T21:00:00.000Z",
"status": "calculated",
"items": [
{
"recipeId": "R-1",
"name": "Cookie",
"lineCount": 2,
"totalCost": 2.2,
"totalCostSupplied": true,
"portions": 10,
"portionsSupplied": true,
"costPerPortion": 0.22,
"costPerPortionSupplied": true,
"sellPrice": 3,
"sellPriceSupplied": true,
"lines": [
{
"ingredientId": "flour",
"quantity": 500,
"unit": "g",
"lineCost": 1,
"lineCostSupplied": true,
"unitPrice": 0.002,
"unitPriceSupplied": true,
"converted": false,
"priceSource": "ingredient.unitPrice"
},
{
"ingredientId": "butter",
"quantity": 100,
"unit": "g",
"lineCost": 1.2,
"lineCostSupplied": true,
"unitPrice": 0.012,
"unitPriceSupplied": true,
"converted": false,
"priceSource": "ingredient.packPrice/packSize"
}
],
"priceInvented": false,
"nutritionInvented": false
}
],
"nutritionInvented": false,
"allergenInvented": false,
"priceInvented": false,
"foodSafetyComplianceClaimed": false,
"findings": [],
"limitations": [
"Recipes, supplier prices, sales, waste, and allergen rows are copied only from labeled fields supplied by the caller.",
"Recipe cost uses supplied quantities and prices after unit conversion. Missing prices are not invented.",
"Unit conversion covers common mass and volume units. Count units convert only to the same count family.",
"Allergen validation uses only explicitly supplied ingredient allergen flags and menu claims.",
"Nutritional values are never invented. No legal food-safety compliance is claimed."
]
}cURL
curl -i -X POST "https://brainiac.software/api/v1/restaurant-operations/recipe-cost-calculate" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"ingredients": [
{
"id": "flour",
"name": "Flour",
"unit": "g",
"unitPrice": 0.002
},
{
"id": "butter",
"name": "Butter",
"unit": "g",
"packSize": 250,
"packPrice": 3
}
],
"recipes": [
{
"id": "R-1",
"name": "Cookie",
"portions": 10,
"sellPrice": 3
}
],
"recipeLines": [
{
"recipeId": "R-1",
"ingredientId": "flour",
"quantity": 500,
"unit": "g"
},
{
"recipeId": "R-1",
"ingredientId": "butter",
"quantity": 100,
"unit": "g"
}
]
}
JSONhttps://brainiac.software/api/v1/restaurant-operations/ingredient-price-variance$0.04 USDCDetect ingredient price variance
Compare supplied supplier prices for the same ingredient after unit conversion and report spreads and dated changes. Prices are never invented.
Body
| Field | Required | Notes |
|---|---|---|
text | No | string |
json | No | string |
csv | No | string |
file | No | object; Object |
ingredients | No | array; Array |
prices | No | array; Array |
recipes | No | array; Array |
recipeLines | No | array; Array |
sales | No | array; Array |
waste | No | array; Array |
allergens | No | array; Array |
matrix | No | array; Array |
asOf | No | string |
Request exampleJSON
{
"prices": [
{
"ingredientId": "flour",
"supplierId": "A",
"unit": "kg",
"unitPrice": 1.8,
"asOf": "2026-10-01"
},
{
"ingredientId": "flour",
"supplierId": "B",
"unit": "g",
"unitPrice": 0.0025,
"asOf": "2026-11-01"
},
{
"ingredientId": "flour",
"supplierId": "A",
"unit": "kg",
"unitPrice": 2.2,
"asOf": "2026-11-01"
}
]
}Response exampleJSON
{
"checkedAt": "2026-11-04T21:00:00.000Z",
"status": "detected",
"items": [
{
"ingredientId": "flour",
"name": "flour",
"unit": "kg",
"observationCount": 3,
"minPrice": 1.8,
"maxPrice": 2.5,
"spread": 0.7,
"spreadPct": 0.3889,
"latestPrice": 2.5,
"latestAsOf": "2026-11-01",
"previousPrice": 2.2,
"previousAsOf": "2026-11-01",
"changePct": 0.1364,
"changePctSupplied": true,
"inconsistent": true,
"priceInvented": false
}
],
"nutritionInvented": false,
"allergenInvented": false,
"priceInvented": false,
"foodSafetyComplianceClaimed": false,
"findings": [],
"limitations": [
"Recipes, supplier prices, sales, waste, and allergen rows are copied only from labeled fields supplied by the caller.",
"Recipe cost uses supplied quantities and prices after unit conversion. Missing prices are not invented.",
"Unit conversion covers common mass and volume units. Count units convert only to the same count family.",
"Allergen validation uses only explicitly supplied ingredient allergen flags and menu claims.",
"Nutritional values are never invented. No legal food-safety compliance is claimed."
]
}cURL
curl -i -X POST "https://brainiac.software/api/v1/restaurant-operations/ingredient-price-variance" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"prices": [
{
"ingredientId": "flour",
"supplierId": "A",
"unit": "kg",
"unitPrice": 1.8,
"asOf": "2026-10-01"
},
{
"ingredientId": "flour",
"supplierId": "B",
"unit": "g",
"unitPrice": 0.0025,
"asOf": "2026-11-01"
},
{
"ingredientId": "flour",
"supplierId": "A",
"unit": "kg",
"unitPrice": 2.2,
"asOf": "2026-11-01"
}
]
}
JSONhttps://brainiac.software/api/v1/restaurant-operations/food-waste-estimate$0.04 USDCEstimate food waste cost
Estimate waste cost from supplied waste quantities and ingredient prices after unit conversion. Missing prices are not invented.
Body
| Field | Required | Notes |
|---|---|---|
text | No | string |
json | No | string |
csv | No | string |
file | No | object; Object |
ingredients | No | array; Array |
prices | No | array; Array |
recipes | No | array; Array |
recipeLines | No | array; Array |
sales | No | array; Array |
waste | No | array; Array |
allergens | No | array; Array |
matrix | No | array; Array |
asOf | No | string |
Request exampleJSON
{
"ingredients": [
{
"id": "lettuce",
"unit": "g",
"unitPrice": 0.004
}
],
"waste": [
{
"ingredientId": "lettuce",
"quantity": 500,
"unit": "g",
"reason": "spoilage"
},
{
"ingredientId": "lettuce",
"quantity": 0.2,
"unit": "kg",
"reason": "trim"
}
]
}Response exampleJSON
{
"checkedAt": "2026-11-04T21:00:00.000Z",
"status": "estimated",
"totalEstimatedCost": 2.8,
"totalEstimatedCostSupplied": true,
"items": [
{
"ingredientId": "lettuce",
"quantity": 500,
"unit": "g",
"reason": "spoilage",
"estimatedCost": 2,
"estimatedCostSupplied": true,
"unitPrice": 0.004,
"priceSource": "ingredient.unitPrice",
"priceInvented": false
},
{
"ingredientId": "lettuce",
"quantity": 0.2,
"unit": "kg",
"reason": "trim",
"estimatedCost": 0.8,
"estimatedCostSupplied": true,
"unitPrice": 4,
"priceSource": "ingredient.unitPrice",
"priceInvented": false
}
],
"nutritionInvented": false,
"allergenInvented": false,
"priceInvented": false,
"foodSafetyComplianceClaimed": false,
"findings": [],
"limitations": [
"Recipes, supplier prices, sales, waste, and allergen rows are copied only from labeled fields supplied by the caller.",
"Recipe cost uses supplied quantities and prices after unit conversion. Missing prices are not invented.",
"Unit conversion covers common mass and volume units. Count units convert only to the same count family.",
"Allergen validation uses only explicitly supplied ingredient allergen flags and menu claims.",
"Nutritional values are never invented. No legal food-safety compliance is claimed."
]
}cURL
curl -i -X POST "https://brainiac.software/api/v1/restaurant-operations/food-waste-estimate" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"ingredients": [
{
"id": "lettuce",
"unit": "g",
"unitPrice": 0.004
}
],
"waste": [
{
"ingredientId": "lettuce",
"quantity": 500,
"unit": "g",
"reason": "spoilage"
},
{
"ingredientId": "lettuce",
"quantity": 0.2,
"unit": "kg",
"reason": "trim"
}
]
}
JSONhttps://brainiac.software/api/v1/restaurant-operations/recipe-yield-normalize$0.04 USDCNormalize recipe yields
Normalize recipe line quantities into ingredient units and per-portion amounts using accurate mass and volume conversions.
Body
| Field | Required | Notes |
|---|---|---|
text | No | string |
json | No | string |
csv | No | string |
file | No | object; Object |
ingredients | No | array; Array |
prices | No | array; Array |
recipes | No | array; Array |
recipeLines | No | array; Array |
sales | No | array; Array |
waste | No | array; Array |
allergens | No | array; Array |
matrix | No | array; Array |
asOf | No | string |
Request exampleJSON
{
"ingredients": [
{
"id": "milk",
"name": "Milk",
"unit": "ml"
},
{
"id": "sugar",
"name": "Sugar",
"unit": "g"
}
],
"recipes": [
{
"id": "R-1",
"name": "Latte syrup base",
"portions": 4,
"yieldQty": 1,
"yieldUnit": "batch"
}
],
"recipeLines": [
{
"recipeId": "R-1",
"ingredientId": "milk",
"quantity": 1,
"unit": "l"
},
{
"recipeId": "R-1",
"ingredientId": "sugar",
"quantity": 0.2,
"unit": "kg"
}
]
}Response exampleJSON
{
"checkedAt": "2026-11-04T21:00:00.000Z",
"status": "normalized",
"items": [
{
"recipeId": "R-1",
"name": "Latte syrup base",
"yieldQty": 1,
"yieldQtySupplied": true,
"yieldUnit": "batch",
"portions": 4,
"portionsSupplied": true,
"lines": [
{
"ingredientId": "milk",
"quantity": 1,
"unit": "l",
"normalizedQuantity": 1000,
"normalizedUnit": "ml",
"converted": true,
"convertible": true
},
{
"ingredientId": "sugar",
"quantity": 0.2,
"unit": "kg",
"normalizedQuantity": 200,
"normalizedUnit": "g",
"converted": true,
"convertible": true
}
],
"perPortion": [
{
"ingredientId": "milk",
"quantityPerPortion": 250,
"quantityPerPortionSupplied": true,
"unit": "ml"
},
{
"ingredientId": "sugar",
"quantityPerPortion": 50,
"quantityPerPortionSupplied": true,
"unit": "g"
}
],
"nutritionInvented": false
}
],
"nutritionInvented": false,
"allergenInvented": false,
"priceInvented": false,
"foodSafetyComplianceClaimed": false,
"findings": [],
"limitations": [
"Recipes, supplier prices, sales, waste, and allergen rows are copied only from labeled fields supplied by the caller.",
"Recipe cost uses supplied quantities and prices after unit conversion. Missing prices are not invented.",
"Unit conversion covers common mass and volume units. Count units convert only to the same count family.",
"Allergen validation uses only explicitly supplied ingredient allergen flags and menu claims.",
"Nutritional values are never invented. No legal food-safety compliance is claimed."
]
}cURL
curl -i -X POST "https://brainiac.software/api/v1/restaurant-operations/recipe-yield-normalize" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"ingredients": [
{
"id": "milk",
"name": "Milk",
"unit": "ml"
},
{
"id": "sugar",
"name": "Sugar",
"unit": "g"
}
],
"recipes": [
{
"id": "R-1",
"name": "Latte syrup base",
"portions": 4,
"yieldQty": 1,
"yieldUnit": "batch"
}
],
"recipeLines": [
{
"recipeId": "R-1",
"ingredientId": "milk",
"quantity": 1,
"unit": "l"
},
{
"recipeId": "R-1",
"ingredientId": "sugar",
"quantity": 0.2,
"unit": "kg"
}
]
}
JSONhttps://brainiac.software/api/v1/restaurant-operations/allergen-matrix-validate$0.05 USDCValidate allergen matrix
Compare menu allergen claims with explicitly supplied ingredient allergen flags. Allergen status is never invented and food-safety compliance is not claimed.
Body
| Field | Required | Notes |
|---|---|---|
text | No | string |
json | No | string |
csv | No | string |
file | No | object; Object |
ingredients | No | array; Array |
prices | No | array; Array |
recipes | No | array; Array |
recipeLines | No | array; Array |
sales | No | array; Array |
waste | No | array; Array |
allergens | No | array; Array |
matrix | No | array; Array |
asOf | No | string |
Request exampleJSON
{
"recipes": [
{
"id": "R-1",
"name": "Cookie"
}
],
"recipeLines": [
{
"recipeId": "R-1",
"ingredientId": "flour",
"quantity": 100,
"unit": "g"
},
{
"recipeId": "R-1",
"ingredientId": "butter",
"quantity": 50,
"unit": "g"
}
],
"allergens": [
{
"ingredientId": "flour",
"allergen": "gluten",
"present": true
},
{
"ingredientId": "butter",
"allergen": "milk",
"present": true
},
{
"ingredientId": "butter",
"allergen": "gluten",
"present": false
}
],
"matrix": [
{
"recipeId": "R-1",
"allergen": "gluten",
"claimed": true
},
{
"recipeId": "R-1",
"allergen": "milk",
"claimed": false
},
{
"recipeId": "R-1",
"allergen": "peanut",
"claimed": false
}
]
}Response exampleJSON
{
"checkedAt": "2026-11-04T21:00:00.000Z",
"status": "validated",
"mismatchCount": 1,
"items": [
{
"recipeId": "R-1",
"name": "Cookie",
"ingredientCount": 2,
"allergens": [
{
"allergen": "gluten",
"derivedPresent": true,
"derivedPresentSupplied": true,
"claimed": true,
"claimedSupplied": true,
"status": "match",
"sources": [
"flour",
"butter"
],
"allergenInvented": false,
"foodSafetyComplianceClaimed": false
},
{
"allergen": "milk",
"derivedPresent": true,
"derivedPresentSupplied": true,
"claimed": false,
"claimedSupplied": true,
"status": "mismatch",
"sources": [
"butter"
],
"allergenInvented": false,
"foodSafetyComplianceClaimed": false
},
{
"allergen": "peanut",
"derivedPresent": false,
"derivedPresentSupplied": false,
"claimed": false,
"claimedSupplied": true,
"status": "claim_without_ingredient_data",
"sources": [],
"allergenInvented": false,
"foodSafetyComplianceClaimed": false
}
],
"mismatchCount": 1,
"foodSafetyComplianceClaimed": false,
"allergenInvented": false
}
],
"nutritionInvented": false,
"allergenInvented": false,
"priceInvented": false,
"foodSafetyComplianceClaimed": false,
"findings": [
{
"kind": "conflict",
"code": "allergen_mismatch",
"subject": "R-1:milk",
"detail": "Menu allergen claim does not match derived ingredient allergen flags."
},
{
"kind": "missing",
"code": "allergen_basis",
"subject": "R-1:peanut",
"detail": "A menu allergen claim has no supporting ingredient allergen rows."
}
],
"limitations": [
"Recipes, supplier prices, sales, waste, and allergen rows are copied only from labeled fields supplied by the caller.",
"Recipe cost uses supplied quantities and prices after unit conversion. Missing prices are not invented.",
"Unit conversion covers common mass and volume units. Count units convert only to the same count family.",
"Allergen validation uses only explicitly supplied ingredient allergen flags and menu claims.",
"Nutritional values are never invented. No legal food-safety compliance is claimed."
]
}cURL
curl -i -X POST "https://brainiac.software/api/v1/restaurant-operations/allergen-matrix-validate" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"recipes": [
{
"id": "R-1",
"name": "Cookie"
}
],
"recipeLines": [
{
"recipeId": "R-1",
"ingredientId": "flour",
"quantity": 100,
"unit": "g"
},
{
"recipeId": "R-1",
"ingredientId": "butter",
"quantity": 50,
"unit": "g"
}
],
"allergens": [
{
"ingredientId": "flour",
"allergen": "gluten",
"present": true
},
{
"ingredientId": "butter",
"allergen": "milk",
"present": true
},
{
"ingredientId": "butter",
"allergen": "gluten",
"present": false
}
],
"matrix": [
{
"recipeId": "R-1",
"allergen": "gluten",
"claimed": true
},
{
"recipeId": "R-1",
"allergen": "milk",
"claimed": false
},
{
"recipeId": "R-1",
"allergen": "peanut",
"claimed": false
}
]
}
JSONhttps://brainiac.software/api/v1/restaurant-operations/food-cost-report$0.12 USDCReport restaurant food cost
Combine recipe costs, margins, price variance, waste estimates, yield normalization, profitability ranking, and allergen validation from supplied data.
Body
| Field | Required | Notes |
|---|---|---|
text | No | string |
json | No | string |
csv | No | string |
file | No | object; Object |
ingredients | No | array; Array |
prices | No | array; Array |
recipes | No | array; Array |
recipeLines | No | array; Array |
sales | No | array; Array |
waste | No | array; Array |
allergens | No | array; Array |
matrix | No | array; Array |
asOf | No | string |
Request exampleJSON
{
"ingredients": [
{
"id": "flour",
"name": "Flour",
"unit": "g",
"unitPrice": 0.002
},
{
"id": "butter",
"name": "Butter",
"unit": "g",
"unitPrice": 0.012
}
],
"prices": [
{
"ingredientId": "flour",
"supplierId": "A",
"unit": "kg",
"unitPrice": 1.8,
"asOf": "2026-10-01"
},
{
"ingredientId": "flour",
"supplierId": "A",
"unit": "kg",
"unitPrice": 2.2,
"asOf": "2026-11-01"
}
],
"recipes": [
{
"id": "R-1",
"name": "Cookie",
"portions": 10,
"sellPrice": 3
}
],
"recipeLines": [
{
"recipeId": "R-1",
"ingredientId": "flour",
"quantity": 500,
"unit": "g"
},
{
"recipeId": "R-1",
"ingredientId": "butter",
"quantity": 100,
"unit": "g"
}
],
"sales": [
{
"recipeId": "R-1",
"units": 40
}
],
"waste": [
{
"ingredientId": "flour",
"quantity": 100,
"unit": "g",
"reason": "spill"
}
],
"allergens": [
{
"ingredientId": "flour",
"allergen": "gluten",
"present": true
},
{
"ingredientId": "butter",
"allergen": "milk",
"present": true
}
],
"matrix": [
{
"recipeId": "R-1",
"allergen": "gluten",
"claimed": true
},
{
"recipeId": "R-1",
"allergen": "milk",
"claimed": true
}
]
}Response exampleJSON
{
"checkedAt": "2026-11-04T21:00:00.000Z",
"status": "reported",
"recipeCount": 1,
"pricedRecipeCount": 1,
"wasteCost": 0.22,
"wasteCostSupplied": true,
"allergenMismatchCount": 0,
"recipes": [
{
"recipeId": "R-1",
"name": "Cookie",
"lineCount": 2,
"totalCost": 2.3,
"totalCostSupplied": true,
"portions": 10,
"portionsSupplied": true,
"costPerPortion": 0.23,
"costPerPortionSupplied": true,
"sellPrice": 3,
"sellPriceSupplied": true,
"lines": [
{
"ingredientId": "flour",
"quantity": 500,
"unit": "g",
"lineCost": 1.1,
"lineCostSupplied": true,
"unitPrice": 0.0022,
"unitPriceSupplied": true,
"converted": true,
"priceSource": "price.unitPrice"
},
{
"ingredientId": "butter",
"quantity": 100,
"unit": "g",
"lineCost": 1.2,
"lineCostSupplied": true,
"unitPrice": 0.012,
"unitPriceSupplied": true,
"converted": false,
"priceSource": "ingredient.unitPrice"
}
],
"priceInvented": false,
"nutritionInvented": false
}
],
"margins": [
{
"recipeId": "R-1",
"name": "Cookie",
"sellPrice": 3,
"sellPriceSupplied": true,
"costPerPortion": 0.23,
"costPerPortionSupplied": true,
"grossProfit": 2.77,
"grossProfitSupplied": true,
"grossMargin": 0.9233,
"grossMarginSupplied": true,
"foodCostPct": 0.0767,
"foodCostPctSupplied": true,
"priceInvented": false,
"foodSafetyComplianceClaimed": false
}
],
"priceVariance": [
{
"ingredientId": "flour",
"name": "Flour",
"unit": "kg",
"observationCount": 3,
"minPrice": 1.8,
"maxPrice": 2.2,
"spread": 0.4,
"spreadPct": 0.2222,
"latestPrice": 2.2,
"latestAsOf": "2026-11-01",
"previousPrice": 1.8,
"previousAsOf": "2026-10-01",
"changePct": 0.2222,
"changePctSupplied": true,
"inconsistent": true,
"priceInvented": false
}
],
"waste": [
{
"ingredientId": "flour",
"quantity": 100,
"unit": "g",
"reason": "spill",
"estimatedCost": 0.22,
"estimatedCostSupplied": true,
"unitPrice": 0.0022,
"priceSource": "price.unitPrice",
"priceInvented": false
}
],
"yields": [
{
"recipeId": "R-1",
"name": "Cookie",
"yieldQty": 10,
"yieldQtySupplied": true,
"yieldUnit": "portions",
"portions": 10,
"portionsSupplied": true,
"lines": [
{
"ingredientId": "flour",
"quantity": 500,
"unit": "g",
"normalizedQuantity": 500,
"normalizedUnit": "g",
"converted": false,
"convertible": true
},
{
"ingredientId": "butter",
"quantity": 100,
"unit": "g",
"normalizedQuantity": 100,
"normalizedUnit": "g",
"converted": false,
"convertible": true
}
],
"perPortion": [
{
"ingredientId": "flour",
"quantityPerPortion": 50,
"quantityPerPortionSupplied": true,
"unit": "g"
},
{
"ingredientId": "butter",
"quantityPerPortion": 10,
"quantityPerPortionSupplied": true,
"unit": "g"
}
],
"nutritionInvented": false
}
],
"ranking": [
{
"recipeId": "R-1",
"name": "Cookie",
"sellPrice": 3,
"sellPriceSupplied": true,
"costPerPortion": 0.23,
"costPerPortionSupplied": true,
"grossProfit": 2.77,
"grossProfitSupplied": true,
"grossMargin": 0.9233,
"grossMarginSupplied": true,
"foodCostPct": 0.0767,
"foodCostPctSupplied": true,
"priceInvented": false,
"foodSafetyComplianceClaimed": false,
"unitsSold": 40,
"unitsSoldSupplied": true,
"revenue": 0,
"revenueSupplied": false,
"contribution": 110.8,
"contributionSupplied": true,
"rank": 1
}
],
"allergens": [
{
"recipeId": "R-1",
"name": "Cookie",
"ingredientCount": 2,
"allergens": [
{
"allergen": "gluten",
"derivedPresent": true,
"derivedPresentSupplied": true,
"claimed": true,
"claimedSupplied": true,
"status": "match",
"sources": [
"flour"
],
"allergenInvented": false,
"foodSafetyComplianceClaimed": false
},
{
"allergen": "milk",
"derivedPresent": true,
"derivedPresentSupplied": true,
"claimed": true,
"claimedSupplied": true,
"status": "match",
"sources": [
"butter"
],
"allergenInvented": false,
"foodSafetyComplianceClaimed": false
}
],
"mismatchCount": 0,
"foodSafetyComplianceClaimed": false,
"allergenInvented": false
}
],
"nutritionInvented": false,
"allergenInvented": false,
"priceInvented": false,
"foodSafetyComplianceClaimed": false,
"findings": [],
"limitations": [
"Recipes, supplier prices, sales, waste, and allergen rows are copied only from labeled fields supplied by the caller.",
"Recipe cost uses supplied quantities and prices after unit conversion. Missing prices are not invented.",
"Unit conversion covers common mass and volume units. Count units convert only to the same count family.",
"Allergen validation uses only explicitly supplied ingredient allergen flags and menu claims.",
"Nutritional values are never invented. No legal food-safety compliance is claimed."
]
}cURL
curl -i -X POST "https://brainiac.software/api/v1/restaurant-operations/food-cost-report" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"ingredients": [
{
"id": "flour",
"name": "Flour",
"unit": "g",
"unitPrice": 0.002
},
{
"id": "butter",
"name": "Butter",
"unit": "g",
"unitPrice": 0.012
}
],
"prices": [
{
"ingredientId": "flour",
"supplierId": "A",
"unit": "kg",
"unitPrice": 1.8,
"asOf": "2026-10-01"
},
{
"ingredientId": "flour",
"supplierId": "A",
"unit": "kg",
"unitPrice": 2.2,
"asOf": "2026-11-01"
}
],
"recipes": [
{
"id": "R-1",
"name": "Cookie",
"portions": 10,
"sellPrice": 3
}
],
"recipeLines": [
{
"recipeId": "R-1",
"ingredientId": "flour",
"quantity": 500,
"unit": "g"
},
{
"recipeId": "R-1",
"ingredientId": "butter",
"quantity": 100,
"unit": "g"
}
],
"sales": [
{
"recipeId": "R-1",
"units": 40
}
],
"waste": [
{
"ingredientId": "flour",
"quantity": 100,
"unit": "g",
"reason": "spill"
}
],
"allergens": [
{
"ingredientId": "flour",
"allergen": "gluten",
"present": true
},
{
"ingredientId": "butter",
"allergen": "milk",
"present": true
}
],
"matrix": [
{
"recipeId": "R-1",
"allergen": "gluten",
"claimed": true
},
{
"recipeId": "R-1",
"allergen": "milk",
"claimed": true
}
]
}
JSON