# BRAINIAC Menu Profitability Rank API

> BRAINIAC Menu Profitability Rank API 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-12).

Ranks menu items by profitability using recipes, ingredient prices, sales, waste, and allergen data, computing food cost %, gross margin, and contribution margin per item.

## Facts

- Endpoint: POST https://www.brainiac.software/api/v1/restaurant-operations/menu-profitability-rank?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/brainiac-menu-profitability-rank-api-ef359409
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_eUdUM7n0i-Z7MO9paHaSx

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-menu-profitability-rank-api-ef359409 -d '<json body>'
```

Example prompt: Can you rank my menu items by profitability? Here are my recipes with ingredients and quantities, the supplier prices I'm paying, and last month's sales by dish — tell me which items have the best gross margin and contribution margin, and flag any allergen compliance issues.

## When to prefer this

Use this endpoint when you need a structured, computation-based profitability ranking of restaurant menu items using real recipe costs and sales data. It is ideal for menu engineering workflows where you have structured recipe, ingredient price, and sales data available. Prefer it over generic LLM analysis when you need deterministic gross margin and food cost calculations with clear traceability of which values were supplied vs. derived, and when allergen compliance flagging is needed alongside financial metrics.

## Known failure modes

- Missing ingredient prices result in incomplete cost calculations — the API will not invent prices
- Unit mismatch between recipe quantities and supplier pack units may prevent cost computation
- Allergen validation only works if ingredient allergen flags are explicitly supplied
- Truncated or malformed CSV/JSON inputs may be rejected or partially parsed
- Exceeding array size limits (400 recipes, 400 sales rows, 200 waste rows) will cause input rejection
- No nutritional data is computed — nutritional fields will be absent from output

## 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

A JSON array of ranked menu items, each with rank position, name, recipe ID, sell price, units sold, food cost %, gross margin, gross profit per portion, and total contribution margin. Flags indicate which values were supplied vs. derived, whether prices were invented, and whether allergen compliance was claimed. A top-level status, findings list, and limitations array are also returned.

## 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",
    "rank": 1,
    "revenue": 0,
    "recipeId": "R-1",
    "sellPrice": 3,
    "unitsSold": 40,
    "foodCostPct": 0.0733,
    "grossMargin": 0.9267,
    "grossProfit": 2.78,
    "contribution": 111.2,
    "priceInvented": false,
    "costPerPortion": 0.22,
    "revenueSupplied": false,
    "sellPriceSupplied": true,
    "unitsSoldSupplied": true,
    "foodCostPctSupplied": true,
    "grossMarginSupplied": true,
    "grossProfitSupplied": true,
    "contributionSupplied": true,
    "costPerPortionSupplied": true,
    "foodSafetyComplianceClaimed": false
   },
   {
    "name": "Toast",
    "rank": 2,
    "revenue": 0,
    "recipeId": "R-2",
    "sellPrice": 4,
    "unitsSold": 10,
    "foodCostPct": 0.085,
    "grossMargin": 0.915,
    "grossProfit": 3.66,
    "contribution": 36.6,
    "priceInvented": false,
    "costPerPortion": 0.34,
    "revenueSupplied": false,
    "sellPriceSupplied": true,
    "unitsSoldSupplied": true,
    "foodCostPctSupplied": true,
    "grossMarginSupplied": true,
    "grossProfitSupplied": true,
    "contributionSupplied": true,
    "costPerPortionSupplied": true,
    "foodSafetyComplianceClaimed": false
   }
  ],
  "status": "ranked",
  "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-menu-profitability-rank-api-ef359409/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)
