# BRAINIAC Cash Shortage Analysis API

> BRAINIAC Cash Shortage Analysis API 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-14).

Projects cash balances for retail outlets over a future period and identifies dates when balances will fall below minimum thresholds, recommending minimum replenishment amounts.

## Facts

- Endpoint: POST https://www.brainiac.software/api/v1/agent-networks/cash-shortage-analysis?utm_source=zero.xyz
- Price: $0.04/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/brainiac-cash-shortage-analysis-api-12450dd1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_7lSxX1s-YxhkSNFJ-4C6r

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-cash-shortage-analysis-api-12450dd1 -d '<json body>'
```

Example prompt: We have three store outlets — shop-A with $5,000 current balance and $500 minimum, shop-B with $2,000 balance and $300 minimum, and shop-C with $8,000 balance and $1,000 minimum — and I have their historical daily cash transactions for the past month plus weekly replenishment schedules. Can you project their cash balances over the next 30 days starting 2025-08-01 and tell me which outlets will hit a shortage, on what dates, and how much minimum replenishment each one needs?

## When to prefer this

Use this endpoint when you need to simulate future cash positions across one or many physical outlets (ATMs, retail stores, bank branches) over a defined forward horizon of up to 90 days. It is ideal when you have a mix of historical transaction data, expected demand patterns, operating schedules, and scheduled replenishments and want to identify specific shortage dates and minimum replenishment requirements. Prefer this over a generic spreadsheet or manual calculation when you have multiple outlets and need systematic, assumption-transparent projections at $0.04 per call with no account setup required.

## Known failure modes

- Missing required fields (outlets array or period_days) return a validation error
- outlet_id references in demand, transactions, schedules, or replenishment that don't match any entry in outlets may be ignored or cause inconsistencies
- period_days exceeding 90 days is rejected by schema
- Supplying more than 5000 transactions or 2000 demand records exceeds schema limits and will be rejected
- Insufficient historical data for an outlet causes the model to fall back to assumptions which are reported in the assumptions array
- Integer overflow on cash amounts is bounded by JavaScript safe integer limits

## 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 JSON object containing: (1) projected_balances — a day-by-day, outlet-by-outlet breakdown of cash_in, cash_out, replenishment, and ending cash_balance; (2) shortage_dates — each specific date and outlet where balance falls below minimum with shortage_amount; (3) affected_outlets — a summary per outlet of total shortage_amount and first_shortage_date; (4) minimum_replenishment — the minimum cash injection needed per outlet to avoid any shortage over the period; (5) assumptions — plain-language notes on any data gaps or modeling choices applied per outlet.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "demand": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "outlet_id",
     "cash_out"
    ],
    "properties": {
     "date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "weekday": {
      "type": "integer",
      "maximum": 6,
      "minimum": 0
     },
     "cash_out": {
      "type": "integer",
      "maximum": 9007199254740991,
      "minimum": 0
     },
     "outlet_id": {
      "type": "string",
      "maxLength": 120,
      "minLength": 1
     }
    },
    "additionalProperties": false
   },
   "maxItems": 2000
  },
  "outlets": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "id",
     "cash_balance"
    ],
    "properties": {
     "id": {
      "type": "string",
      "maxLength": 120,
      "minLength": 1
     },
     "cash_balance": {
      "type": "integer",
      "maximum": 9007199254740991,
      "minimum": -9007199254740991
     },
     "minimum_balance": {
      "type": "integer",
      "maximum": 9007199254740991,
      "minimum": 0
     }
    },
    "additionalProperties": false
   },
   "maxItems": 200,
   "minItems": 1
  },
  "schedules": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "outlet_id",
     "weekday"
    ],
    "properties": {
     "weekday": {
      "type": "integer",
      "maximum": 6,
      "minimum": 0
     },
     "outlet_id": {
      "type": "string",
      "maxLength": 120,
      "minLength": 1
     }
    },
    "additionalProperties": false
   },
   "maxItems": 2000
  },
  "start_date": {
   "type": "string",
   "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
  },
  "period_days": {
   "type": "integer",
   "maximum": 90,
   "minimum": 1
  },
  "transactions": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "id",
     "outlet_id",
     "date",
     "direction",
     "amount"
    ],
    "properties": {
     "id": {
      "type": "string",
      "maxLength": 120,
      "minLength": 1
     },
     "date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
     },
     "amount": {
      "type": "integer",
      "maximum": 9007199254740991,
      "minimum": 0
     },
     "direction": {
      "enum": [
       "in",
       "out"
      ],
      "type": "string"
     },
     "outlet_id": {
      "type": "string",
      "maxLength": 120,
      "minLength": 1
     }
    },
    "additionalProperties": false
   },
 
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "assumptions": [
   {
    "outlet_id": "shop-1",
    "assumption": "No expected demand was supplied for Wednesday. That day has no historical cash movement, so cash out uses the average of the historical days that were supplied."
   },
   {
    "outlet_id": "shop-2",
    "assumption": "No operating schedule was supplied. The outlet is projected as open every day."
   },
   {
    "outlet_id": "shop-2",
    "assumption": "No historical transactions and no expected demand were supplied. The balance changes only when a replenishment is supplied."
   }
  ],
  "shortage_dates": [
   {
    "date": "2026-11-10",
    "outlet_id": "shop-1",
    "shortage_amount": 100
   }
  ],
  "affected_outlets": [
   {
    "outlet_id": "shop-1",
    "shortage_amount": 100,
    "first_shortage_date": "2026-11-10"
   }
  ],
  "projected_balances": [
   {
    "date": "2026-11-09",
    "cash_in": 0,
    "cash_out": 600,
    "outlet_id": "shop-1",
    "cash_balance": 200,
    "replenishment": 500
   },
   {
    "date": "2026-11-10",
    "cash_in": 0,
    "cash_out": 100,
    "outlet_id": "shop-1",
    "cash_balance": 100,
    "replenishment": 0
   },
   {
    "date": "2026-11-11",
    "cash_in": 0,
    "cash_out": 250,
    "outlet_id": "shop-1",
    "cash_balance": 350,
    "replenishment": 500
   },
   {
    "date": "2026-11-09",
    "cash_in": 0,
    "cash_out": 0,
    "outlet_id": "shop-2",
    "cash_balance": 5000,
    "replenishment": 0
   },
   {
    "date": "2026-11-10",
    "cash_in": 0,
    "cash_out": 0,
    "outlet_id": "shop-2",
    "cash_balance": 5000,
    "replenishment": 0
   },
   {
    "date": "2026-11-11",
    "cash_in": 0,
    "cash_out": 0,
    "outlet_id": "shop-2",
    "cash_balance": 5000,
    "replenishment": 0
   }
  ],
  "minimum_replenishment": [
   {
    "amount": 100,
    "outlet_id": "shop-1"
   },
   {
    "amount": 0,
    "outlet_id": "shop-2"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/brainiac-cash-shortage-analysis-api-12450dd1/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)
