# BRAINIAC Restaurant Menu Item Margin Analyzer

> BRAINIAC Restaurant Menu Item Margin Analyzer is a paid API for AI agents from www.brainiac.software, paid per call via x402, $0.05/call, status unknown (last checked 2026-11-11).

Analyzes restaurant menu items to compute food cost percentage, gross margin, gross profit, and cost per portion using supplied recipes, ingredient prices, sales, waste, and allergen data.

## Facts

- Endpoint: POST https://www.brainiac.software/api/v1/restaurant-operations/menu-item-margin-analyze?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/brainiac-restaurant-menu-item-margin-analyzer-1f414a6f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_H2FFmUhLb-idEsJR4DGOO

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability brainiac-restaurant-menu-item-margin-analyzer-1f414a6f -d '<json body>'
```

Example prompt: Analyze the profit margins for my restaurant menu — here are my recipes with ingredient quantities, supplier prices for each ingredient, and recent sales data. I want to see the food cost percentage, gross margin, gross profit, and cost per portion for each dish.

## When to prefer this

Use this endpoint when you need a transparent, auditable margin and food cost analysis for restaurant menu items using your own supplied recipe, pricing, and sales data — particularly when you need to avoid any invented or hallucinated cost figures. It is especially suited for agentic workflows where you want structured per-item margin breakdowns with explicit data provenance flags. Prefer this over general LLM-based calculations when you need consistent, deterministic computation with allergen validation and clear limitation disclosures.

## Known failure modes

- Missing ingredient prices for recipe components — affected cost fields are omitted rather than invented
- Unrecognized unit types that cannot be converted — portion cost calculation fails for those ingredients
- Recipes referencing ingredient IDs not present in the prices array — cost cannot be computed
- Empty or malformed CSV/JSON input — parsing error returned
- Input exceeds size limits (e.g. more than 400 recipe items or 200 waste rows) — request rejected

## How this service works

Pay-per-call APIs for AI agents: OFAC sanctions screening, compliance checks, token security, and Base chain data via x402. No account. Fixed USDC price. MCP-ready.

## Output

Returns a list of analyzed menu items each with: name, recipe ID, sell price, food cost percentage, gross margin, gross profit, cost per portion, allergen compliance claim status, and flags indicating which values were supplied vs. computed. Also includes overall status ('analyzed'), any findings or warnings, a timestamp, and a list of data limitations/assumptions made during analysis. No nutritional values, allergen flags, or prices are invented — missing data is flagged, not fabricated.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "csv": {
   "type": "string",
   "maxLength": 200000
  },
  "asOf": {
   "type": "string",
   "maxLength": 40
  },
  "file": {
   "type": "object",
   "required": [
    "mediaType",
    "fileBase64"
   ],
   "properties": {
    "filename": {
     "type": "string",
     "maxLength": 180,
     "minLength": 1
    },
    "mediaType": {
     "enum": [
      "text/plain",
      "text/csv",
      "application/json"
     ],
     "type": "string"
    },
    "fileBase64": {
     "type": "string",
     "maxLength": 12000000,
     "minLength": 1
    }
   },
   "additionalProperties": false
  },
  "json": {
   "type": "string",
   "maxLength": 200000
  },
  "text": {
   "type": "string",
   "maxLength": 200000
  },
  "sales": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "date": {
      "type": "string",
      "maxLength": 40
     },
     "units": {
      "type": "number",
      "maximum": 1000000000,
      "minimum": 0
     },
     "revenue": {
      "type": "number",
      "maximum": 1000000000,
      "minimum": 0
     },
     "recipeId": {
      "type": "string",
      "maxLength": 80
     }
    },
    "additionalProperties": false
   },
   "maxItems": 400
  },
  "waste": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "unit": {
      "type": "string",
      "maxLength": 40
     },
     "reason": {
      "type": "string",
      "maxLength": 160
     },
     "quantity": {
      "type": "number",
      "maximum": 1000000000,
      "minimum": 0
     },
     "ingredientId": {
      "type": "string",
      "maxLength": 80
     }
    },
    "additionalProperties": false
   },
   "maxItems": 200
  },
  "matrix": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "claimed": {
      "type": "boolean"
     },
     "allergen": {
      "type": "string",
      "maxLength": 80
     },
     "recipeId": {
      "type": "string",
      "maxLength": 80
     }
    },
    "additionalProperties": false
   },
   "maxItems": 400
  },
  "prices": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "asOf": {
      "type": "string",
      "maxLength": 40
     },
     "unit": {
      "type": "string",
      "maxLength": 40
     },
     "packSize": {
      "type": "number",
      "maximum": 1000000000,
      "minimum": 0
     },
     "packPrice": {
      "type": "number",
      "maximum": 1000000000,
      "minimum": 0
  
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "items": [
   {
    "name": "Cookie",
    "recipeId": "R-1",
    "sellPrice": 3,
    "foodCostPct": 0.0733,
    "grossMargin": 0.9267,
    "grossProfit": 2.78,
    "priceInvented": false,
    "costPerPortion": 0.22,
    "sellPriceSupplied": true,
    "foodCostPctSupplied": true,
    "grossMarginSupplied": true,
    "grossProfitSupplied": true,
    "costPerPortionSupplied": true,
    "foodSafetyComplianceClaimed": false
   },
   {
    "name": "Toast",
    "recipeId": "R-2",
    "sellPrice": 4,
    "foodCostPct": 0.085,
    "grossMargin": 0.915,
    "grossProfit": 3.66,
    "priceInvented": false,
    "costPerPortion": 0.34,
    "sellPriceSupplied": true,
    "foodCostPctSupplied": true,
    "grossMarginSupplied": true,
    "grossProfitSupplied": true,
    "costPerPortionSupplied": true,
    "foodSafetyComplianceClaimed": false
   }
  ],
  "status": "analyzed",
  "findings": [],
  "checkedAt": "2026-11-04T21:00:00.000Z",
  "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."
  ],
  "priceInvented": false,
  "allergenInvented": false,
  "nutritionInvented": false,
  "foodSafetyComplianceClaimed": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/brainiac-restaurant-menu-item-margin-analyzer-1f414a6f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.brainiac.software](https://www.zero.xyz/host/www.brainiac.software/llms.txt)
