# BRAINIAC Restaurant Recipe Cost Calculator

> BRAINIAC Restaurant Recipe Cost Calculator is a paid API for AI agents from www.brainiac.software, paid per call via x402, $0.04/call, status unknown (last checked 2026-11-11).

Calculates per-portion and total costs for restaurant recipes using ingredient prices, quantities, waste data, and sales figures, with allergen matrix validation

## Facts

- Endpoint: POST https://www.brainiac.software/api/v1/restaurant-operations/recipe-cost-calculate?utm_source=zero.xyz
- Price: $0.04/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-recipe-cost-calculator-39d1c1d8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_UW_CeK90VkUT7S_uvOTZt

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-recipe-cost-calculator-39d1c1d8 -d '<json body>'
```

Example prompt: Calculate the cost per portion for my Cookie recipe (ID R-1): it uses 500g flour at $0.002/g and 100g butter at $0.012/g, makes 10 portions, and sells for $3 each — tell me the total recipe cost, cost per portion, and whether my sell price covers it.

## When to prefer this

Use this endpoint when you need deterministic, auditable recipe cost calculations based on explicit supplier prices and quantities — it will not invent missing data, making it suitable for financial reporting and menu pricing decisions. Prefer this over general-purpose LLM food cost estimates when you need line-item transparency, unit conversion accuracy, or allergen claim cross-checking against structured ingredient data.

## Known failure modes

- Missing ingredient prices result in that line item being excluded rather than invented — cost may be understated
- Unrecognized unit conversions (e.g. count-to-mass) will not be converted, leaving line costs unsupplied
- Truncated or malformed CSV/JSON input may result in partial recipe parsing
- Allergen validation only works if explicit allergen flags are provided on ingredients — missing flags are not inferred
- Recipe IDs that don't match between recipes and prices arrays will produce missing price warnings
- Exceeding maxItems limits (400 recipes, 400 prices, 200 waste rows) will cause input rejection

## 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 object with an array of recipe cost items, each containing the recipe name, ID, total cost, cost per portion, sell price, line-by-line ingredient costs with unit prices and quantities, portions count, and flags indicating which values were supplied vs derived. Also includes a status field, findings list, allergen and nutrition invention flags, a food safety disclaimer, and a list of calculation limitations.

## 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",
    "lines": [
     {
      "unit": "g",
      "lineCost": 1,
      "quantity": 500,
      "converted": false,
      "unitPrice": 0.002,
      "priceSource": "ingredient.unitPrice",
      "ingredientId": "flour",
      "lineCostSupplied": true,
      "unitPriceSupplied": true
     },
     {
      "unit": "g",
      "lineCost": 1.2,
      "quantity": 100,
      "converted": false,
      "unitPrice": 0.012,
      "priceSource": "ingredient.packPrice/packSize",
      "ingredientId": "butter",
      "lineCostSupplied": true,
      "unitPriceSupplied": true
     }
    ],
    "portions": 10,
    "recipeId": "R-1",
    "lineCount": 2,
    "sellPrice": 3,
    "totalCost": 2.2,
    "priceInvented": false,
    "costPerPortion": 0.22,
    "portionsSupplied": true,
    "nutritionInvented": false,
    "sellPriceSupplied": true,
    "totalCostSupplied": true,
    "costPerPortionSupplied": true
   }
  ],
  "status": "calculated",
  "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-recipe-cost-calculator-39d1c1d8/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)
