{"openapi":"3.1.0","info":{"title":"Food Cost API","version":"1.0.0","description":"Restaurant food-costing maths as an API, computed locally and deterministically — the menu-engineering and cost-control numbers a kitchen runs on. The recipe endpoint totals a dish from its ingredient line costs (or quantities × unit prices), divides by the yield factor (1 − waste %) so trim and shrinkage raise the true cost, and splits it across the portions to a cost per plate — and against a menu price it returns the food-cost percentage and gross profit. The plate endpoint prices a dish both ways: give a menu price and get the food-cost percentage and markup factor, or give a target food-cost percentage and get the suggested menu price (a 30 % target is a 3.33× markup), plus gross profit, gross margin and, with a labour cost, the prime-cost percentage. The period endpoint turns inventory movement into the cost of goods sold — COGS = opening inventory + purchases − closing inventory — and the food or pour cost percentage against sales, the headline number on every P&L (28–35 % for food, 18–24 % for beverage). Everything is computed locally and deterministically, so it is instant and private. Ideal for restaurant-tech, POS, kitchen-management, catering and hospitality app developers, menu-engineering and recipe-costing tools, and culinary-school training. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 compute endpoints. This is food-cost and menu-pricing maths; for unit conversion use a cooking API and for generic margin maths a pricing API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/foodcost-api","description":"oanor gateway"}],"tags":[{"name":"FoodCost"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/period":{"get":{"operationId":"get_v1_period","tags":["FoodCost"],"summary":"Period COGS & food cost %","description":"","parameters":[{"name":"opening_inventory","in":"query","required":true,"description":"Opening inventory value","schema":{"type":"string"},"example":"5000"},{"name":"purchases","in":"query","required":true,"description":"Purchases in period","schema":{"type":"string"},"example":"12000"},{"name":"closing_inventory","in":"query","required":true,"description":"Closing inventory value","schema":{"type":"string"},"example":"4000"},{"name":"sales","in":"query","required":true,"description":"Food (or beverage) sales","schema":{"type":"string"},"example":"40000"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"cogs":13000,"note":"COGS = opening inventory + purchases − closing inventory. Food (or pour) cost % = COGS / sales — typically 28–35% for food, 18–24% for beverage.","inputs":{"sales":40000,"purchases":12000,"closing_inventory":4000,"opening_inventory":5000},"cost_percent":32.5,"gross_profit":27000,"gross_profit_percent":67.5},"meta":{"timestamp":"2026-06-05T21:48:47.797Z","request_id":"116584e5-8435-4288-9bff-bf23a34fba2a"},"status":"ok","message":"Period COGS","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/plate":{"get":{"operationId":"get_v1_plate","tags":["FoodCost"],"summary":"Menu pricing & food-cost %","description":"","parameters":[{"name":"plate_cost","in":"query","required":true,"description":"Cost per plate","schema":{"type":"string"},"example":"1.25"},{"name":"menu_price","in":"query","required":false,"description":"Menu price (or target_food_cost_percent)","schema":{"type":"string"}},{"name":"target_food_cost_percent","in":"query","required":false,"description":"Target food-cost %","schema":{"type":"string"},"example":"30"},{"name":"labor_cost","in":"query","required":false,"description":"Labour cost per plate (for prime cost)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Menu price = plate cost / target food-cost %. A 30% target means a 3.33x markup. Prime cost (food + labour) under ~60% of sales is the usual benchmark.","inputs":{"plate_cost":1.25},"gross_profit":2.92,"markup_factor":3.3333,"gross_margin_percent":70,"suggested_menu_price":4.17,"target_food_cost_percent":30},"meta":{"timestamp":"2026-06-05T21:48:47.898Z","request_id":"50874672-2d72-490d-8baa-d16dd4acf4c2"},"status":"ok","message":"Plate pricing","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/recipe":{"get":{"operationId":"get_v1_recipe","tags":["FoodCost"],"summary":"Recipe & per-portion cost","description":"","parameters":[{"name":"costs","in":"query","required":false,"description":"Comma list of ingredient line costs","schema":{"type":"string"},"example":"2.50,1.20,0.80"},{"name":"quantities","in":"query","required":false,"description":"Comma list of quantities (with unit_prices)","schema":{"type":"string"}},{"name":"unit_prices","in":"query","required":false,"description":"Comma list of unit prices","schema":{"type":"string"}},{"name":"portions","in":"query","required":false,"description":"Number of portions (default 1)","schema":{"type":"string"},"example":"4"},{"name":"waste_percent","in":"query","required":false,"description":"Yield loss % (default 0)","schema":{"type":"string"},"example":"10"},{"name":"menu_price","in":"query","required":false,"description":"Menu price (for food-cost %)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Recipe cost = Σ ingredient line costs, divided by the yield factor (1 − waste%) and the portions. Yield loss raises the true cost per usable plate.","inputs":{"portions":4,"ingredients":3,"waste_percent":10},"raw_cost":4.5,"cost_per_portion":1.25,"yield_adjusted_cost":5},"meta":{"timestamp":"2026-06-05T21:48:48.001Z","request_id":"6be51d9c-4bd2-4d53-8244-733349dc24b3"},"status":"ok","message":"Recipe cost","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"notes":"One consistent currency in, costs and percentages out. Ingredient costs can be line costs or quantities × unit prices. For generic margin maths use a margin API and for unit conversion a cooking API.","service":"foodcost-api","endpoints":{"GET /v1/meta":"This document.","GET /v1/plate":"Menu price ↔ food-cost %, gross profit, markup and prime cost.","GET /v1/period":"Period COGS and food/pour cost % from inventory and sales.","GET /v1/recipe":"Recipe cost and cost per portion from ingredient costs and yield loss."},"description":"Restaurant food-costing maths: recipe/plate costing with yield loss, menu pricing to a target food-cost %, and period cost of goods (food & pour cost)."},"meta":{"timestamp":"2026-06-05T21:48:48.098Z","request_id":"dabc119c-a8b4-4124-9d45-f33c63faad7a"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":4750,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":480,"monthly_call_quota":48000,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1340,"monthly_call_quota":223000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4150,"monthly_call_quota":1300000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/foodcost-api"}