# BRAINIAC Allergen Matrix Validator

> BRAINIAC Allergen Matrix Validator 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).

Validates restaurant menu allergen claims against recipe ingredients, detecting mismatches between declared allergens and ingredient-derived allergen presence.

## Facts

- Endpoint: POST https://www.brainiac.software/api/v1/restaurant-operations/allergen-matrix-validate?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-allergen-matrix-validator-e7431b5e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0FrwHoAZRNmBHaB67kYkG

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-allergen-matrix-validator-e7431b5e -d '<json body>'
```

Example prompt: Can you validate our allergen matrix against our recipe ingredients? I'll give you our recipes and the allergen claims we've made on the menu — flag any mismatches where we've missed declaring an allergen or claimed one that isn't actually present.

## When to prefer this

Use this endpoint when you need to systematically cross-check a restaurant's declared menu allergens against actual recipe ingredient data to find discrepancies. It is especially valuable for pre-inspection audits, menu updates, or supplier changes. Unlike manual review, it programmatically detects undeclared allergens, false claims, and claims with no supporting ingredient evidence. It does not invent data or claim legal food-safety compliance, making it suitable for objective validation workflows.

## Known failure modes

- Missing required allergen matrix or recipe data results in incomplete validation
- Allergen claims with no supporting ingredient rows produce 'claim_without_ingredient_data' status rather than an error
- Ingredient allergen flags not explicitly supplied are never inferred or invented
- Unit conversion failures for non-standard units may cause missing cost data
- Exceeding array size limits (400 matrix rows, 400 recipes) causes rejection
- Invalid mediaType in file upload returns schema validation error

## 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 structured JSON object with per-recipe allergen validation results, including allergen status (match, mismatch, claim_without_ingredient_data), sources (which ingredients contribute each allergen), mismatch counts, overall validation status, specific findings with codes and details (e.g. allergen_mismatch, allergen_basis), a checkedAt timestamp, and a list of limitations. Also returns top-level flags: mismatchCount, priceInvented, allergenInvented, nutritionInvented, foodSafetyComplianceClaimed.

## 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",
    "allergens": [
     {
      "status": "match",
      "claimed": true,
      "sources": [
       "flour",
       "butter"
      ],
      "allergen": "gluten",
      "derivedPresent": true,
      "claimedSupplied": true,
      "allergenInvented": false,
      "derivedPresentSupplied": true,
      "foodSafetyComplianceClaimed": false
     },
     {
      "status": "mismatch",
      "claimed": false,
      "sources": [
       "butter"
      ],
      "allergen": "milk",
      "derivedPresent": true,
      "claimedSupplied": true,
      "allergenInvented": false,
      "derivedPresentSupplied": true,
      "foodSafetyComplianceClaimed": false
     },
     {
      "status": "claim_without_ingredient_data",
      "claimed": false,
      "sources": [],
      "allergen": "peanut",
      "derivedPresent": false,
      "claimedSupplied": true,
      "allergenInvented": false,
      "derivedPresentSupplied": false,
      "foodSafetyComplianceClaimed": false
     }
    ],
    "mismatchCount": 1,
    "ingredientCount": 2,
    "allergenInvented": false,
    "foodSafetyComplianceClaimed": false
   }
  ],
  "status": "validated",
  "findings": [
   {
    "code": "allergen_mismatch",
    "kind": "conflict",
    "detail": "Menu allergen claim does not match derived ingredient allergen flags.",
    "subject": "R-1:milk"
   },
   {
    "code": "allergen_basis",
    "kind": "missing",
    "detail": "A menu allergen claim has no supporting ingredient allergen rows.",
    "subject": "R-1:peanut"
   }
  ],
  "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."
  ],
  "mismatchCount": 1,
  "priceInvented": false,
  "allergenInvented": false,
  "nutritionInvented": false,
  "foodSafetyComplianceClaimed": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/brainiac-allergen-matrix-validator-e7431b5e/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)
