{"openapi":"3.1.0","info":{"title":"Restaurant Operations Intelligence API","version":"1.0.0","description":"Read supplied recipes, supplier prices, sales, and allergen flags to calculate food cost and menu profitability without inventing nutrition or compliance claims. Paid with x402 exact USDC on Base. No account is required.","contact":{"email":"support@brainiac.software"},"x-guidance":"BRAINIAC.software is a pay-per-call API for software agents. No account or API key is required.\nPayment uses the x402 protocol with exact USDC on Base (chain id 8453). Each POST operation has a fixed USD price.\nHow to call an operation:\n1. POST a JSON body matching the operation's requestBody schema to the operation path. Include an Idempotency-Key header (64 hex characters, 32 random bytes).\n2. If you have not paid, the server responds 402 with payment requirements in the body. Pay the exact amount to the payTo address on Base.\n3. Retry the identical request with the same Idempotency-Key and add a payment-signature header containing the x402 payment payload. On success (200) the operation result is returned.\n4. Reuse the same Idempotency-Key only for retries of the same operation and request body; it will not be charged twice.\nAll outputs are compliance prechecks, drafts, or data lookups for human review. They are not official determinations, legal advice, identity confirmation, or certified filings. Verify time-sensitive or official data with the cited source before acting."},"servers":[{"url":"https://www.brainiac.software"}],"paths":{"/api/v1/restaurant-operations/recipe-cost-calculate":{"post":{"operationId":"calculate_recipe_cost","summary":"Calculate recipe cost","description":"Calculate recipe and per-portion cost from supplied ingredient quantities and prices after unit conversion. Missing prices are not invented.","tags":["restaurant-operations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","maxLength":200000},"json":{"type":"string","maxLength":200000},"csv":{"type":"string","maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/plain","text/csv","application/json"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"ingredients":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"unit":{"type":"string","maxLength":40},"packSize":{"type":"number","minimum":0,"maximum":1000000000},"packPrice":{"type":"number","minimum":0,"maximum":1000000000},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"prices":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"supplierId":{"type":"string","maxLength":80},"unit":{"type":"string","maxLength":40},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000},"packSize":{"type":"number","minimum":0,"maximum":1000000000},"packPrice":{"type":"number","minimum":0,"maximum":1000000000},"asOf":{"type":"string","maxLength":40}},"additionalProperties":false}},"recipes":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"yieldQty":{"type":"number","minimum":0,"maximum":1000000000},"yieldUnit":{"type":"string","maxLength":40},"portions":{"type":"number","minimum":0,"maximum":1000000},"sellPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"recipeLines":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"ingredientId":{"type":"string","maxLength":80},"quantity":{"type":"number","minimum":0,"maximum":1000000000},"unit":{"type":"string","maxLength":40}},"additionalProperties":false}},"sales":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"units":{"type":"number","minimum":0,"maximum":1000000000},"revenue":{"type":"number","minimum":0,"maximum":1000000000},"date":{"type":"string","maxLength":40}},"additionalProperties":false}},"waste":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"quantity":{"type":"number","minimum":0,"maximum":1000000000},"unit":{"type":"string","maxLength":40},"reason":{"type":"string","maxLength":160}},"additionalProperties":false}},"allergens":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"allergen":{"type":"string","maxLength":80},"present":{"type":"boolean"}},"additionalProperties":false}},"matrix":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"allergen":{"type":"string","maxLength":80},"claimed":{"type":"boolean"}},"additionalProperties":false}},"asOf":{"type":"string","maxLength":40}},"additionalProperties":false},"example":{"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"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string"},"name":{"type":"string"},"lineCount":{"type":"number"},"totalCost":{"type":"number"},"totalCostSupplied":{"type":"boolean"},"portions":{"type":"number"},"portionsSupplied":{"type":"boolean"},"costPerPortion":{"type":"number"},"costPerPortionSupplied":{"type":"boolean"},"sellPrice":{"type":"number"},"sellPriceSupplied":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string"},"lineCost":{"type":"number"},"lineCostSupplied":{"type":"boolean"},"unitPrice":{"type":"number"},"unitPriceSupplied":{"type":"boolean"},"converted":{"type":"boolean"},"priceSource":{"type":"string"}},"additionalProperties":true}},"priceInvented":{"type":"boolean"},"nutritionInvented":{"type":"boolean"}},"additionalProperties":true}},"nutritionInvented":{"type":"boolean"},"allergenInvented":{"type":"boolean"},"priceInvented":{"type":"boolean"},"foodSafetyComplianceClaimed":{"type":"boolean"},"findings":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"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."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{}}]}}},"/api/v1/restaurant-operations/menu-item-margin-analyze":{"post":{"operationId":"analyze_menu_item_margins","summary":"Analyze menu item margins","description":"Calculate gross margin and food-cost percentage from supplied sell prices and calculated recipe costs. Nutritional values are not invented.","tags":["restaurant-operations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","maxLength":200000},"json":{"type":"string","maxLength":200000},"csv":{"type":"string","maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/plain","text/csv","application/json"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"ingredients":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"unit":{"type":"string","maxLength":40},"packSize":{"type":"number","minimum":0,"maximum":1000000000},"packPrice":{"type":"number","minimum":0,"maximum":1000000000},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"prices":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"supplierId":{"type":"string","maxLength":80},"unit":{"type":"string","maxLength":40},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000},"packSize":{"type":"number","minimum":0,"maximum":1000000000},"packPrice":{"type":"number","minimum":0,"maximum":1000000000},"asOf":{"type":"string","maxLength":40}},"additionalProperties":false}},"recipes":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"yieldQty":{"type":"number","minimum":0,"maximum":1000000000},"yieldUnit":{"type":"string","maxLength":40},"portions":{"type":"number","minimum":0,"maximum":1000000},"sellPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"recipeLines":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"ingredientId":{"type":"string","maxLength":80},"quantity":{"type":"number","minimum":0,"maximum":1000000000},"unit":{"type":"string","maxLength":40}},"additionalProperties":false}},"sales":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"units":{"type":"number","minimum":0,"maximum":1000000000},"revenue":{"type":"number","minimum":0,"maximum":1000000000},"date":{"type":"string","maxLength":40}},"additionalProperties":false}},"waste":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"quantity":{"type":"number","minimum":0,"maximum":1000000000},"unit":{"type":"string","maxLength":40},"reason":{"type":"string","maxLength":160}},"additionalProperties":false}},"allergens":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"allergen":{"type":"string","maxLength":80},"present":{"type":"boolean"}},"additionalProperties":false}},"matrix":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"allergen":{"type":"string","maxLength":80},"claimed":{"type":"boolean"}},"additionalProperties":false}},"asOf":{"type":"string","maxLength":40}},"additionalProperties":false},"example":{"ingredients":[{"id":"flour","unit":"g","unitPrice":0.002},{"id":"butter","unit":"g","unitPrice":0.012}],"recipes":[{"id":"R-1","name":"Cookie","portions":10,"sellPrice":3},{"id":"R-2","name":"Toast","portions":1,"sellPrice":4}],"recipeLines":[{"recipeId":"R-1","ingredientId":"flour","quantity":500,"unit":"g"},{"recipeId":"R-1","ingredientId":"butter","quantity":100,"unit":"g"},{"recipeId":"R-2","ingredientId":"flour","quantity":50,"unit":"g"},{"recipeId":"R-2","ingredientId":"butter","quantity":20,"unit":"g"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string"},"name":{"type":"string"},"sellPrice":{"type":"number"},"sellPriceSupplied":{"type":"boolean"},"costPerPortion":{"type":"number"},"costPerPortionSupplied":{"type":"boolean"},"grossProfit":{"type":"number"},"grossProfitSupplied":{"type":"boolean"},"grossMargin":{"type":"number"},"grossMarginSupplied":{"type":"boolean"},"foodCostPct":{"type":"number"},"foodCostPctSupplied":{"type":"boolean"},"priceInvented":{"type":"boolean"},"foodSafetyComplianceClaimed":{"type":"boolean"}},"additionalProperties":true}},"nutritionInvented":{"type":"boolean"},"allergenInvented":{"type":"boolean"},"priceInvented":{"type":"boolean"},"foodSafetyComplianceClaimed":{"type":"boolean"},"findings":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-04T21:00:00.000Z","status":"analyzed","items":[{"recipeId":"R-1","name":"Cookie","sellPrice":3,"sellPriceSupplied":true,"costPerPortion":0.22,"costPerPortionSupplied":true,"grossProfit":2.78,"grossProfitSupplied":true,"grossMargin":0.9267,"grossMarginSupplied":true,"foodCostPct":0.0733,"foodCostPctSupplied":true,"priceInvented":false,"foodSafetyComplianceClaimed":false},{"recipeId":"R-2","name":"Toast","sellPrice":4,"sellPriceSupplied":true,"costPerPortion":0.34,"costPerPortionSupplied":true,"grossProfit":3.66,"grossProfitSupplied":true,"grossMargin":0.915,"grossMarginSupplied":true,"foodCostPct":0.085,"foodCostPctSupplied":true,"priceInvented":false,"foodSafetyComplianceClaimed":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."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{}}]}}},"/api/v1/restaurant-operations/ingredient-price-variance":{"post":{"operationId":"detect_ingredient_price_variance","summary":"Detect ingredient price variance","description":"Compare supplied supplier prices for the same ingredient after unit conversion and report spreads and dated changes. Prices are never invented.","tags":["restaurant-operations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","maxLength":200000},"json":{"type":"string","maxLength":200000},"csv":{"type":"string","maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/plain","text/csv","application/json"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"ingredients":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"unit":{"type":"string","maxLength":40},"packSize":{"type":"number","minimum":0,"maximum":1000000000},"packPrice":{"type":"number","minimum":0,"maximum":1000000000},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"prices":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"supplierId":{"type":"string","maxLength":80},"unit":{"type":"string","maxLength":40},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000},"packSize":{"type":"number","minimum":0,"maximum":1000000000},"packPrice":{"type":"number","minimum":0,"maximum":1000000000},"asOf":{"type":"string","maxLength":40}},"additionalProperties":false}},"recipes":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"yieldQty":{"type":"number","minimum":0,"maximum":1000000000},"yieldUnit":{"type":"string","maxLength":40},"portions":{"type":"number","minimum":0,"maximum":1000000},"sellPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"recipeLines":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"ingredientId":{"type":"string","maxLength":80},"quantity":{"type":"number","minimum":0,"maximum":1000000000},"unit":{"type":"string","maxLength":40}},"additionalProperties":false}},"sales":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"units":{"type":"number","minimum":0,"maximum":1000000000},"revenue":{"type":"number","minimum":0,"maximum":1000000000},"date":{"type":"string","maxLength":40}},"additionalProperties":false}},"waste":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"quantity":{"type":"number","minimum":0,"maximum":1000000000},"unit":{"type":"string","maxLength":40},"reason":{"type":"string","maxLength":160}},"additionalProperties":false}},"allergens":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"allergen":{"type":"string","maxLength":80},"present":{"type":"boolean"}},"additionalProperties":false}},"matrix":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"allergen":{"type":"string","maxLength":80},"claimed":{"type":"boolean"}},"additionalProperties":false}},"asOf":{"type":"string","maxLength":40}},"additionalProperties":false},"example":{"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"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string"},"name":{"type":"string"},"unit":{"type":"string"},"observationCount":{"type":"number"},"minPrice":{"type":"number"},"maxPrice":{"type":"number"},"spread":{"type":"number"},"spreadPct":{"type":"number"},"latestPrice":{"type":"number"},"latestAsOf":{"type":"string"},"previousPrice":{"type":"number"},"previousAsOf":{"type":"string"},"changePct":{"type":"number"},"changePctSupplied":{"type":"boolean"},"inconsistent":{"type":"boolean"},"priceInvented":{"type":"boolean"}},"additionalProperties":true}},"nutritionInvented":{"type":"boolean"},"allergenInvented":{"type":"boolean"},"priceInvented":{"type":"boolean"},"foodSafetyComplianceClaimed":{"type":"boolean"},"findings":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"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."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{}}]}}},"/api/v1/restaurant-operations/food-waste-estimate":{"post":{"operationId":"estimate_food_waste_cost","summary":"Estimate food waste cost","description":"Estimate waste cost from supplied waste quantities and ingredient prices after unit conversion. Missing prices are not invented.","tags":["restaurant-operations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","maxLength":200000},"json":{"type":"string","maxLength":200000},"csv":{"type":"string","maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/plain","text/csv","application/json"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"ingredients":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"unit":{"type":"string","maxLength":40},"packSize":{"type":"number","minimum":0,"maximum":1000000000},"packPrice":{"type":"number","minimum":0,"maximum":1000000000},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"prices":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"supplierId":{"type":"string","maxLength":80},"unit":{"type":"string","maxLength":40},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000},"packSize":{"type":"number","minimum":0,"maximum":1000000000},"packPrice":{"type":"number","minimum":0,"maximum":1000000000},"asOf":{"type":"string","maxLength":40}},"additionalProperties":false}},"recipes":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"yieldQty":{"type":"number","minimum":0,"maximum":1000000000},"yieldUnit":{"type":"string","maxLength":40},"portions":{"type":"number","minimum":0,"maximum":1000000},"sellPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"recipeLines":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"ingredientId":{"type":"string","maxLength":80},"quantity":{"type":"number","minimum":0,"maximum":1000000000},"unit":{"type":"string","maxLength":40}},"additionalProperties":false}},"sales":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"units":{"type":"number","minimum":0,"maximum":1000000000},"revenue":{"type":"number","minimum":0,"maximum":1000000000},"date":{"type":"string","maxLength":40}},"additionalProperties":false}},"waste":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"quantity":{"type":"number","minimum":0,"maximum":1000000000},"unit":{"type":"string","maxLength":40},"reason":{"type":"string","maxLength":160}},"additionalProperties":false}},"allergens":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"allergen":{"type":"string","maxLength":80},"present":{"type":"boolean"}},"additionalProperties":false}},"matrix":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"allergen":{"type":"string","maxLength":80},"claimed":{"type":"boolean"}},"additionalProperties":false}},"asOf":{"type":"string","maxLength":40}},"additionalProperties":false},"example":{"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"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string"},"totalEstimatedCost":{"type":"number"},"totalEstimatedCostSupplied":{"type":"boolean"},"items":{"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string"},"reason":{"type":"string"},"estimatedCost":{"type":"number"},"estimatedCostSupplied":{"type":"boolean"},"unitPrice":{"type":"number"},"priceSource":{"type":"string"},"priceInvented":{"type":"boolean"}},"additionalProperties":true}},"nutritionInvented":{"type":"boolean"},"allergenInvented":{"type":"boolean"},"priceInvented":{"type":"boolean"},"foodSafetyComplianceClaimed":{"type":"boolean"},"findings":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"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."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{}}]}}},"/api/v1/restaurant-operations/recipe-yield-normalize":{"post":{"operationId":"normalize_recipe_yields","summary":"Normalize recipe yields","description":"Normalize recipe line quantities into ingredient units and per-portion amounts using accurate mass and volume conversions.","tags":["restaurant-operations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","maxLength":200000},"json":{"type":"string","maxLength":200000},"csv":{"type":"string","maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/plain","text/csv","application/json"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"ingredients":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"unit":{"type":"string","maxLength":40},"packSize":{"type":"number","minimum":0,"maximum":1000000000},"packPrice":{"type":"number","minimum":0,"maximum":1000000000},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"prices":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"supplierId":{"type":"string","maxLength":80},"unit":{"type":"string","maxLength":40},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000},"packSize":{"type":"number","minimum":0,"maximum":1000000000},"packPrice":{"type":"number","minimum":0,"maximum":1000000000},"asOf":{"type":"string","maxLength":40}},"additionalProperties":false}},"recipes":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"yieldQty":{"type":"number","minimum":0,"maximum":1000000000},"yieldUnit":{"type":"string","maxLength":40},"portions":{"type":"number","minimum":0,"maximum":1000000},"sellPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"recipeLines":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"ingredientId":{"type":"string","maxLength":80},"quantity":{"type":"number","minimum":0,"maximum":1000000000},"unit":{"type":"string","maxLength":40}},"additionalProperties":false}},"sales":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"units":{"type":"number","minimum":0,"maximum":1000000000},"revenue":{"type":"number","minimum":0,"maximum":1000000000},"date":{"type":"string","maxLength":40}},"additionalProperties":false}},"waste":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"quantity":{"type":"number","minimum":0,"maximum":1000000000},"unit":{"type":"string","maxLength":40},"reason":{"type":"string","maxLength":160}},"additionalProperties":false}},"allergens":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"allergen":{"type":"string","maxLength":80},"present":{"type":"boolean"}},"additionalProperties":false}},"matrix":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"allergen":{"type":"string","maxLength":80},"claimed":{"type":"boolean"}},"additionalProperties":false}},"asOf":{"type":"string","maxLength":40}},"additionalProperties":false},"example":{"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"}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string"},"name":{"type":"string"},"yieldQty":{"type":"number"},"yieldQtySupplied":{"type":"boolean"},"yieldUnit":{"type":"string"},"portions":{"type":"number"},"portionsSupplied":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string"},"normalizedQuantity":{"type":"number"},"normalizedUnit":{"type":"string"},"converted":{"type":"boolean"},"convertible":{"type":"boolean"}},"additionalProperties":true}},"perPortion":{"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string"},"quantityPerPortion":{"type":"number"},"quantityPerPortionSupplied":{"type":"boolean"},"unit":{"type":"string"}},"additionalProperties":true}},"nutritionInvented":{"type":"boolean"}},"additionalProperties":true}},"nutritionInvented":{"type":"boolean"},"allergenInvented":{"type":"boolean"},"priceInvented":{"type":"boolean"},"foodSafetyComplianceClaimed":{"type":"boolean"},"findings":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"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."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.04"},"protocols":[{"x402":{}}]}}},"/api/v1/restaurant-operations/menu-profitability-rank":{"post":{"operationId":"rank_menu_profitability","summary":"Rank menu profitability","description":"Rank menu items by contribution using calculated portion profit and supplied sales units. Ties fall back to gross margin.","tags":["restaurant-operations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","maxLength":200000},"json":{"type":"string","maxLength":200000},"csv":{"type":"string","maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/plain","text/csv","application/json"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"ingredients":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"unit":{"type":"string","maxLength":40},"packSize":{"type":"number","minimum":0,"maximum":1000000000},"packPrice":{"type":"number","minimum":0,"maximum":1000000000},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"prices":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"supplierId":{"type":"string","maxLength":80},"unit":{"type":"string","maxLength":40},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000},"packSize":{"type":"number","minimum":0,"maximum":1000000000},"packPrice":{"type":"number","minimum":0,"maximum":1000000000},"asOf":{"type":"string","maxLength":40}},"additionalProperties":false}},"recipes":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"yieldQty":{"type":"number","minimum":0,"maximum":1000000000},"yieldUnit":{"type":"string","maxLength":40},"portions":{"type":"number","minimum":0,"maximum":1000000},"sellPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"recipeLines":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"ingredientId":{"type":"string","maxLength":80},"quantity":{"type":"number","minimum":0,"maximum":1000000000},"unit":{"type":"string","maxLength":40}},"additionalProperties":false}},"sales":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"units":{"type":"number","minimum":0,"maximum":1000000000},"revenue":{"type":"number","minimum":0,"maximum":1000000000},"date":{"type":"string","maxLength":40}},"additionalProperties":false}},"waste":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"quantity":{"type":"number","minimum":0,"maximum":1000000000},"unit":{"type":"string","maxLength":40},"reason":{"type":"string","maxLength":160}},"additionalProperties":false}},"allergens":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"allergen":{"type":"string","maxLength":80},"present":{"type":"boolean"}},"additionalProperties":false}},"matrix":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"allergen":{"type":"string","maxLength":80},"claimed":{"type":"boolean"}},"additionalProperties":false}},"asOf":{"type":"string","maxLength":40}},"additionalProperties":false},"example":{"ingredients":[{"id":"flour","unit":"g","unitPrice":0.002},{"id":"butter","unit":"g","unitPrice":0.012}],"recipes":[{"id":"R-1","name":"Cookie","portions":10,"sellPrice":3},{"id":"R-2","name":"Toast","portions":1,"sellPrice":4}],"recipeLines":[{"recipeId":"R-1","ingredientId":"flour","quantity":500,"unit":"g"},{"recipeId":"R-1","ingredientId":"butter","quantity":100,"unit":"g"},{"recipeId":"R-2","ingredientId":"flour","quantity":50,"unit":"g"},{"recipeId":"R-2","ingredientId":"butter","quantity":20,"unit":"g"}],"sales":[{"recipeId":"R-1","units":40},{"recipeId":"R-2","units":10}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string"},"name":{"type":"string"},"sellPrice":{"type":"number"},"sellPriceSupplied":{"type":"boolean"},"costPerPortion":{"type":"number"},"costPerPortionSupplied":{"type":"boolean"},"grossProfit":{"type":"number"},"grossProfitSupplied":{"type":"boolean"},"grossMargin":{"type":"number"},"grossMarginSupplied":{"type":"boolean"},"foodCostPct":{"type":"number"},"foodCostPctSupplied":{"type":"boolean"},"priceInvented":{"type":"boolean"},"foodSafetyComplianceClaimed":{"type":"boolean"},"unitsSold":{"type":"number"},"unitsSoldSupplied":{"type":"boolean"},"revenue":{"type":"number"},"revenueSupplied":{"type":"boolean"},"contribution":{"type":"number"},"contributionSupplied":{"type":"boolean"},"rank":{"type":"number"}},"additionalProperties":true}},"nutritionInvented":{"type":"boolean"},"allergenInvented":{"type":"boolean"},"priceInvented":{"type":"boolean"},"foodSafetyComplianceClaimed":{"type":"boolean"},"findings":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"checkedAt":"2026-11-04T21:00:00.000Z","status":"ranked","items":[{"recipeId":"R-1","name":"Cookie","sellPrice":3,"sellPriceSupplied":true,"costPerPortion":0.22,"costPerPortionSupplied":true,"grossProfit":2.78,"grossProfitSupplied":true,"grossMargin":0.9267,"grossMarginSupplied":true,"foodCostPct":0.0733,"foodCostPctSupplied":true,"priceInvented":false,"foodSafetyComplianceClaimed":false,"unitsSold":40,"unitsSoldSupplied":true,"revenue":0,"revenueSupplied":false,"contribution":111.2,"contributionSupplied":true,"rank":1},{"recipeId":"R-2","name":"Toast","sellPrice":4,"sellPriceSupplied":true,"costPerPortion":0.34,"costPerPortionSupplied":true,"grossProfit":3.66,"grossProfitSupplied":true,"grossMargin":0.915,"grossMarginSupplied":true,"foodCostPct":0.085,"foodCostPctSupplied":true,"priceInvented":false,"foodSafetyComplianceClaimed":false,"unitsSold":10,"unitsSoldSupplied":true,"revenue":0,"revenueSupplied":false,"contribution":36.6,"contributionSupplied":true,"rank":2}],"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."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{}}]}}},"/api/v1/restaurant-operations/allergen-matrix-validate":{"post":{"operationId":"validate_allergen_matrix","summary":"Validate allergen matrix","description":"Compare menu allergen claims with explicitly supplied ingredient allergen flags. Allergen status is never invented and food-safety compliance is not claimed.","tags":["restaurant-operations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","maxLength":200000},"json":{"type":"string","maxLength":200000},"csv":{"type":"string","maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/plain","text/csv","application/json"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"ingredients":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"unit":{"type":"string","maxLength":40},"packSize":{"type":"number","minimum":0,"maximum":1000000000},"packPrice":{"type":"number","minimum":0,"maximum":1000000000},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"prices":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"supplierId":{"type":"string","maxLength":80},"unit":{"type":"string","maxLength":40},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000},"packSize":{"type":"number","minimum":0,"maximum":1000000000},"packPrice":{"type":"number","minimum":0,"maximum":1000000000},"asOf":{"type":"string","maxLength":40}},"additionalProperties":false}},"recipes":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"yieldQty":{"type":"number","minimum":0,"maximum":1000000000},"yieldUnit":{"type":"string","maxLength":40},"portions":{"type":"number","minimum":0,"maximum":1000000},"sellPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"recipeLines":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"ingredientId":{"type":"string","maxLength":80},"quantity":{"type":"number","minimum":0,"maximum":1000000000},"unit":{"type":"string","maxLength":40}},"additionalProperties":false}},"sales":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"units":{"type":"number","minimum":0,"maximum":1000000000},"revenue":{"type":"number","minimum":0,"maximum":1000000000},"date":{"type":"string","maxLength":40}},"additionalProperties":false}},"waste":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"quantity":{"type":"number","minimum":0,"maximum":1000000000},"unit":{"type":"string","maxLength":40},"reason":{"type":"string","maxLength":160}},"additionalProperties":false}},"allergens":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"allergen":{"type":"string","maxLength":80},"present":{"type":"boolean"}},"additionalProperties":false}},"matrix":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"allergen":{"type":"string","maxLength":80},"claimed":{"type":"boolean"}},"additionalProperties":false}},"asOf":{"type":"string","maxLength":40}},"additionalProperties":false},"example":{"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}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string"},"mismatchCount":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string"},"name":{"type":"string"},"ingredientCount":{"type":"number"},"allergens":{"type":"array","items":{"type":"object","properties":{"allergen":{"type":"string"},"derivedPresent":{"type":"boolean"},"derivedPresentSupplied":{"type":"boolean"},"claimed":{"type":"boolean"},"claimedSupplied":{"type":"boolean"},"status":{"type":"string"},"sources":{"type":"array","items":{"type":"string"}},"allergenInvented":{"type":"boolean"},"foodSafetyComplianceClaimed":{"type":"boolean"}},"additionalProperties":true}},"mismatchCount":{"type":"number"},"foodSafetyComplianceClaimed":{"type":"boolean"},"allergenInvented":{"type":"boolean"}},"additionalProperties":true}},"nutritionInvented":{"type":"boolean"},"allergenInvented":{"type":"boolean"},"priceInvented":{"type":"boolean"},"foodSafetyComplianceClaimed":{"type":"boolean"},"findings":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"code":{"type":"string"},"subject":{"type":"string"},"detail":{"type":"string"}},"additionalProperties":true}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"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."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{}}]}}},"/api/v1/restaurant-operations/food-cost-report":{"post":{"operationId":"report_restaurant_food_cost","summary":"Report restaurant food cost","description":"Combine recipe costs, margins, price variance, waste estimates, yield normalization, profitability ranking, and allergen validation from supplied data.","tags":["restaurant-operations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","maxLength":200000},"json":{"type":"string","maxLength":200000},"csv":{"type":"string","maxLength":200000},"file":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":180},"mediaType":{"type":"string","enum":["text/plain","text/csv","application/json"]},"fileBase64":{"type":"string","minLength":1,"maxLength":12000000}},"required":["mediaType","fileBase64"],"additionalProperties":false},"ingredients":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"unit":{"type":"string","maxLength":40},"packSize":{"type":"number","minimum":0,"maximum":1000000000},"packPrice":{"type":"number","minimum":0,"maximum":1000000000},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"prices":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"supplierId":{"type":"string","maxLength":80},"unit":{"type":"string","maxLength":40},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000},"packSize":{"type":"number","minimum":0,"maximum":1000000000},"packPrice":{"type":"number","minimum":0,"maximum":1000000000},"asOf":{"type":"string","maxLength":40}},"additionalProperties":false}},"recipes":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":160},"yieldQty":{"type":"number","minimum":0,"maximum":1000000000},"yieldUnit":{"type":"string","maxLength":40},"portions":{"type":"number","minimum":0,"maximum":1000000},"sellPrice":{"type":"number","minimum":0,"maximum":1000000000}},"additionalProperties":false}},"recipeLines":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"ingredientId":{"type":"string","maxLength":80},"quantity":{"type":"number","minimum":0,"maximum":1000000000},"unit":{"type":"string","maxLength":40}},"additionalProperties":false}},"sales":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"units":{"type":"number","minimum":0,"maximum":1000000000},"revenue":{"type":"number","minimum":0,"maximum":1000000000},"date":{"type":"string","maxLength":40}},"additionalProperties":false}},"waste":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"quantity":{"type":"number","minimum":0,"maximum":1000000000},"unit":{"type":"string","maxLength":40},"reason":{"type":"string","maxLength":160}},"additionalProperties":false}},"allergens":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string","maxLength":80},"allergen":{"type":"string","maxLength":80},"present":{"type":"boolean"}},"additionalProperties":false}},"matrix":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string","maxLength":80},"allergen":{"type":"string","maxLength":80},"claimed":{"type":"boolean"}},"additionalProperties":false}},"asOf":{"type":"string","maxLength":40}},"additionalProperties":false},"example":{"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}]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}],"responses":{"200":{"description":"Illustrative endpoint-specific JSON response shape. Conditional fields depend on the result and data-source availability.","content":{"application/json":{"schema":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string"},"recipeCount":{"type":"number"},"pricedRecipeCount":{"type":"number"},"wasteCost":{"type":"number"},"wasteCostSupplied":{"type":"boolean"},"allergenMismatchCount":{"type":"number"},"recipes":{"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string"},"name":{"type":"string"},"lineCount":{"type":"number"},"totalCost":{"type":"number"},"totalCostSupplied":{"type":"boolean"},"portions":{"type":"number"},"portionsSupplied":{"type":"boolean"},"costPerPortion":{"type":"number"},"costPerPortionSupplied":{"type":"boolean"},"sellPrice":{"type":"number"},"sellPriceSupplied":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string"},"lineCost":{"type":"number"},"lineCostSupplied":{"type":"boolean"},"unitPrice":{"type":"number"},"unitPriceSupplied":{"type":"boolean"},"converted":{"type":"boolean"},"priceSource":{"type":"string"}},"additionalProperties":true}},"priceInvented":{"type":"boolean"},"nutritionInvented":{"type":"boolean"}},"additionalProperties":true}},"margins":{"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string"},"name":{"type":"string"},"sellPrice":{"type":"number"},"sellPriceSupplied":{"type":"boolean"},"costPerPortion":{"type":"number"},"costPerPortionSupplied":{"type":"boolean"},"grossProfit":{"type":"number"},"grossProfitSupplied":{"type":"boolean"},"grossMargin":{"type":"number"},"grossMarginSupplied":{"type":"boolean"},"foodCostPct":{"type":"number"},"foodCostPctSupplied":{"type":"boolean"},"priceInvented":{"type":"boolean"},"foodSafetyComplianceClaimed":{"type":"boolean"}},"additionalProperties":true}},"priceVariance":{"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string"},"name":{"type":"string"},"unit":{"type":"string"},"observationCount":{"type":"number"},"minPrice":{"type":"number"},"maxPrice":{"type":"number"},"spread":{"type":"number"},"spreadPct":{"type":"number"},"latestPrice":{"type":"number"},"latestAsOf":{"type":"string"},"previousPrice":{"type":"number"},"previousAsOf":{"type":"string"},"changePct":{"type":"number"},"changePctSupplied":{"type":"boolean"},"inconsistent":{"type":"boolean"},"priceInvented":{"type":"boolean"}},"additionalProperties":true}},"waste":{"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string"},"reason":{"type":"string"},"estimatedCost":{"type":"number"},"estimatedCostSupplied":{"type":"boolean"},"unitPrice":{"type":"number"},"priceSource":{"type":"string"},"priceInvented":{"type":"boolean"}},"additionalProperties":true}},"yields":{"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string"},"name":{"type":"string"},"yieldQty":{"type":"number"},"yieldQtySupplied":{"type":"boolean"},"yieldUnit":{"type":"string"},"portions":{"type":"number"},"portionsSupplied":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string"},"normalizedQuantity":{"type":"number"},"normalizedUnit":{"type":"string"},"converted":{"type":"boolean"},"convertible":{"type":"boolean"}},"additionalProperties":true}},"perPortion":{"type":"array","items":{"type":"object","properties":{"ingredientId":{"type":"string"},"quantityPerPortion":{"type":"number"},"quantityPerPortionSupplied":{"type":"boolean"},"unit":{"type":"string"}},"additionalProperties":true}},"nutritionInvented":{"type":"boolean"}},"additionalProperties":true}},"ranking":{"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string"},"name":{"type":"string"},"sellPrice":{"type":"number"},"sellPriceSupplied":{"type":"boolean"},"costPerPortion":{"type":"number"},"costPerPortionSupplied":{"type":"boolean"},"grossProfit":{"type":"number"},"grossProfitSupplied":{"type":"boolean"},"grossMargin":{"type":"number"},"grossMarginSupplied":{"type":"boolean"},"foodCostPct":{"type":"number"},"foodCostPctSupplied":{"type":"boolean"},"priceInvented":{"type":"boolean"},"foodSafetyComplianceClaimed":{"type":"boolean"},"unitsSold":{"type":"number"},"unitsSoldSupplied":{"type":"boolean"},"revenue":{"type":"number"},"revenueSupplied":{"type":"boolean"},"contribution":{"type":"number"},"contributionSupplied":{"type":"boolean"},"rank":{"type":"number"}},"additionalProperties":true}},"allergens":{"type":"array","items":{"type":"object","properties":{"recipeId":{"type":"string"},"name":{"type":"string"},"ingredientCount":{"type":"number"},"allergens":{"type":"array","items":{"type":"object","properties":{"allergen":{"type":"string"},"derivedPresent":{"type":"boolean"},"derivedPresentSupplied":{"type":"boolean"},"claimed":{"type":"boolean"},"claimedSupplied":{"type":"boolean"},"status":{"type":"string"},"sources":{"type":"array","items":{"type":"string"}},"allergenInvented":{"type":"boolean"},"foodSafetyComplianceClaimed":{"type":"boolean"}},"additionalProperties":true}},"mismatchCount":{"type":"number"},"foodSafetyComplianceClaimed":{"type":"boolean"},"allergenInvented":{"type":"boolean"}},"additionalProperties":true}},"nutritionInvented":{"type":"boolean"},"allergenInvented":{"type":"boolean"},"priceInvented":{"type":"boolean"},"foodSafetyComplianceClaimed":{"type":"boolean"},"findings":{"type":"array","items":{}},"limitations":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"example":{"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."]}}}},"400":{"description":"Invalid JSON or request schema."},"402":{"description":"Payment Required"},"409":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Reusing the key cannot trigger a second charge."},"413":{"description":"Request body exceeds the 24 MB limit."},"500":{"description":"Operation failed. With upfront settlement this may occur after payment; reuse the same idempotency key to retrieve the stored result."},"503":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.12"},"protocols":[{"x402":{}}]}}}},"components":{"schemas":{"ApiError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}}}}}}}