{"uid":"cap_vXZRh0LCK_U32o26bnfrF","slug":"money-openverbs-com-allocate-0a3f360c","name":"money.openverbs.com Allocate","description":"Split an amount into parts using integer minor-unit math so the shares always sum back to the exact original — no rounding drift. Pass parts for an even split, or ratios for a weighted one (e.g. [1,1,1] splits $100 into 33.34/33.33/33.33). The leftover minor units go to the largest fractional remainders.","url":"https://money.openverbs.com/v1/allocate","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["amount"],"properties":{"parts":{"type":"integer","maximum":100000,"minimum":1,"description":"Number of equal parts (use instead of ratios)."},"amount":{"type":"number","description":"The total to split."},"ratios":{"type":"array","items":{"type":"number","minimum":0},"maxItems":100000,"minItems":1,"description":"Weights for a proportional split (use instead of parts)."},"currency":{"type":"string","maxLength":3,"minLength":3,"description":"ISO 4217 code used to derive minor units. Optional."},"minorUnits":{"type":"integer","maximum":8,"minimum":0,"description":"Explicit minor-unit digits. Overrides currency. Default 2."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_WO8ZxHzegk0Z3N6cjnTRX","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Splits a monetary amount into N equal parts or weighted ratios using integer minor-unit arithmetic, guaranteeing the parts always sum to the exact original amount with no rounding drift.","exampleAgentPrompt":"Split $127.45 evenly among 3 people using exact minor-unit math — I need the shares to add up to exactly $127.45 with no rounding drift, treating it as USD (2 decimal places).","exampleUseCases":[{"title":"Splitting a restaurant bill evenly","prompt":"We owe $83.70 for dinner and there are 4 of us — split it exactly into 4 equal shares in USD so everything adds up perfectly with no rounding errors."},{"title":"Weighted revenue share distribution","prompt":"Distribute $10,000 among three partners using ratios 3, 2, and 1 — so they get proportional shares that sum to exactly $10,000 with no penny lost."},{"title":"Crypto amount allocation across wallets","prompt":"I need to split 0.00154823 BTC across 5 wallets equally using 8 minor-unit digits — make sure all 5 shares add up to the exact original amount."}],"resultDescription":"An array of allocated share amounts expressed in the currency's minor units (or the specified minorUnits precision), guaranteed to sum exactly to the original amount. Leftover minor units from rounding are distributed to the shares with the largest fractional remainders (largest-remainder method).","failureModes":["Missing required 'amount' field returns a validation error","Providing both 'parts' and 'ratios' simultaneously may return an error or undefined behavior","'parts' value of 0 or negative is rejected (minimum 1)","'ratios' array with all-zero weights cannot be normalized and will error","'currency' code not in ISO 4217 may cause minor-unit derivation to fail","Amount with more decimal places than minorUnits may be rejected or silently truncated","Payment failure (x402) if USDC balance is insufficient for the $0.002 per-call fee"],"whenToPreferThis":"Use this endpoint whenever you need to split a monetary amount into parts and require mathematically exact results — i.e. the shares must sum precisely to the original amount with no floating-point or rounding drift. It is preferable to naive division when dealing with financial calculations (invoices, bill splits, revenue shares, payment distributions) where even a one-cent discrepancy is unacceptable. Choose the 'ratios' parameter for weighted/proportional splits and 'parts' for equal splits.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:31:35.611Z","isFirstParty":false}