# BRAINIAC Safety Stock Calculator

> BRAINIAC Safety Stock Calculator 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).

Calculates safety stock levels and reorder points for SKUs using historical sales, supplier lead times, and a configurable service-level z-factor

## Facts

- Endpoint: POST https://www.brainiac.software/api/v1/inventory-intelligence/safety-stock-calculate?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-safety-stock-calculator-09d531f7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_r-Np5myLpfyumeBHissth

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-safety-stock-calculator-09d531f7 -d '<json body>'
```

Example prompt: Using our last 90 days of daily sales data and a 7-day supplier lead time, calculate safety stock and reorder points for all our SKUs at a 95% service level (z=1.65), and flag any items where we currently have less than the recommended safety stock on hand.

## When to prefer this

Choose this endpoint when you need a statistically grounded safety stock calculation using real historical sales data and supplier lead times, without integrating with an ERP or inventory system. It is ideal for AI agents automating inventory planning tasks, e-commerce operations tools, or procurement workflows where you want an auditable formula-based result (not a black-box ML forecast) with explicit assumptions and uncertainty flags. At $0.05 per call with no account required, it suits pay-per-use agent pipelines on Base via x402.

## Known failure modes

- Insufficient sales history leads to high uncertainty flag rather than refusal — results returned with caveat
- Missing supplier lead time data causes the endpoint to omit or flag affected SKUs
- SKU count exceeding 200 products or 2000 sales records returns a validation error
- Malformed date strings in sales or purchase arrays cause parsing errors
- Missing required SKU identifiers result in items being skipped or grouped incorrectly

## 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 per-SKU breakdown including calculated safety stock quantity, reorder point, demand standard deviation, lead time days used, service level z-factor, the exact formula applied, uncertainty rating, and whether key inputs were supplied vs. inferred. Also returns a list of findings (e.g. short history warnings), all modeling assumptions, and explicit confirmations that no purchase orders were created and no inventory system was accessed.

## 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": {
     "sku": {
      "type": "string",
      "maxLength": 80
     },
     "date": {
      "type": "string",
      "maxLength": 40
     },
     "units": {
      "type": "number",
      "maximum": 1000000000,
      "minimum": 0
     }
    },
    "additionalProperties": false
   },
   "maxItems": 2000
  },
  "products": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "sku": {
      "type": "string",
      "maxLength": 80
     },
     "name": {
      "type": "string",
      "maxLength": 160
     },
     "onHand": {
      "type": "number",
      "maximum": 1000000000,
      "minimum": 0
     },
     "onOrder": {
      "type": "number",
      "maximum": 1000000000,
      "minimum": 0
     },
     "unitCost": {
      "type": "number",
      "maximum": 1000000000,
      "minimum": 0
     }
    },
    "additionalProperties": false
   },
   "maxItems": 200
  },
  "slowDays": {
   "type": "number",
   "maximum": 3650,
   "minimum": 1
  },
  "purchases": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "sku": {
      "type": "string",
      "maxLength": 80
     },
     "date": {
      "type": "string",
      "maxLength": 40
     },
     "units": {
      "type": "number",
      "maximum": 1000000000,
      "minimum": 0
     },
     "unitPrice": {
      "type": "number",
      "maximum": 1000000000,
      "minimum": 0
     }
    },
    "additionalProperties": false
   },
   "maxItems": 500
  },
  "slowUnits": {
   "type": "number",
   "maximum": 1000000000,
   "minimum": 0
  },
  "suppliers": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "moq
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "items": [
   {
    "sku": "SKU-1",
    "name": "SKU-1",
    "formula": "safetyStock = serviceLevelZ × demandStdev × sqrt(leadTimeDays)",
    "demandStdev": 1.7889,
    "safetyStock": 5.9,
    "uncertainty": "high",
    "leadTimeDays": 4,
    "serviceLevelZ": 1.65,
    "demandSupplied": true,
    "historyDaysUsed": 5,
    "safetyStockSupplied": true,
    "leadTimeDaysSupplied": true
   }
  ],
  "status": "calculated",
  "findings": [
   {
    "code": "history_short",
    "kind": "observation",
    "detail": "Only 5 history day(s) were available. Safety stock uncertainty is high and seasonality is not modeled.",
    "subject": "SKU-1"
   }
  ],
  "checkedAt": "2026-11-04T19:00:00.000Z",
  "assumptions": [
   "serviceLevelZ=1.65 (explicit normal z factor for safety stock)",
   "reviewDays=0",
   "historyDays=5",
   "forecastDays=30",
   "excessDaysCover=90",
   "slowUnits=5 over slowDays=90",
   "Daily demand average fills missing days in the history window with zero when a history end date exists.",
   "Seasonality is not added. Only variation already present in the supplied history affects the standard deviation."
  ],
  "limitations": [
   "Products, sales, supplier lead times, and purchases are copied only from labeled fields supplied by the caller.",
   "Reorder point = average daily demand × (lead time days + review days) + safety stock.",
   "Safety stock = service-level z × daily demand standard deviation × square root of lead time days.",
   "Demand forecasts use a simple average of available history only. Seasonality is not modeled unless present in that history.",
   "Lead times, demand, and purchase prices are never invented. No purchase order is created and no inventory system is accessed."
  ],
  "priceInvented": false,
  "serviceLevelZ": 1.65,
  "demandInvented": false,
  "leadTimeInvented": false,
  "purchaseOrderCreated": false,
  "inventorySystemAccessed": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/brainiac-safety-stock-calculator-09d531f7/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)
