{"uid":"cap_7lSxX1s-YxhkSNFJ-4C6r","slug":"brainiac-cash-shortage-analysis-api-12450dd1","name":"BRAINIAC Cash Shortage Analysis API","description":"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.","url":"https://www.brainiac.software/api/v1/agent-networks/cash-shortage-analysis?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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},"maxItems":5000},"replenishment":{"type":"array","items":{"type":"object","required":["outlet_id","amount"],"properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"amount":{"type":"integer","maximum":9007199254740991,"minimum":0},"weekday":{"type":"integer","maximum":6,"minimum":0},"outlet_id":{"type":"string","maxLength":120,"minLength":1},"every_days":{"type":"integer","maximum":90,"minimum":1}},"additionalProperties":false},"maxItems":2000}}},"responseSchema":{"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"}]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.04","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.04/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.04","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.04","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_JcKaxN5ldoMe5qcs1-N_s","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.04","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Projects cash balances for retail outlets over a future period and identifies dates when balances will fall below minimum thresholds, recommending minimum replenishment amounts.","exampleAgentPrompt":"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?","exampleUseCases":[{"title":"ATM network shortage forecasting","prompt":"I operate a network of 15 ATMs across the city. Here are their current cash balances, historical withdrawal data for the past 60 days, and weekly replenishment schedules. Starting 2025-08-01, project their balances over the next 45 days and tell me which ATMs will run out of cash and by how much, so I can prioritize replenishment runs."},{"title":"Retail store cash flow planning","prompt":"We have 5 retail stores with current cash balances, daily sales cash flow history, and minimum float requirements. Can you forecast their cash positions for the next 30 days starting 2025-09-01 and identify which stores will fall below their minimum balance thresholds and what the minimum cash injection would be to cover the shortfall?"},{"title":"Cash logistics schedule optimization","prompt":"I'm planning replenishment routes for our branch network starting 2025-10-15 for 60 days. I have current balances for 8 branches, their transaction histories, expected demand by weekday, and scheduled deliveries. Can you run the shortage analysis to show me which branches are at risk and the minimum amounts needed so I can adjust the delivery schedule?"}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-14T18:30:48.248Z","isFirstParty":false,"canonicalSlug":"brainiac-cash-shortage-analysis-api-12450dd1"}