{"uid":"cap_g3JejnqdIFBNcrnJ8ZVxO","slug":"delx-commerce-weight-normalize-c3b9d774","name":"Delx Commerce Weight Normalize","description":"Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.","url":"https://commerce.delx.ai/api/v1/x402/weight-normalize?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"weights":{"type":"array","description":"Non-negative weights to normalize so they sum to 1 when possible."}}},"responseSchema":{"type":"json","example":{"sum":4,"count":3,"valid":true,"schema":"delx/util-weight-normalize/v1","normalized":[0.25,0.5,0.25]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","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.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_2q6PxPrxmvfKqZsE9AFNu","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Normalizes an array of non-negative weights so that they sum to 1, returning normalized values along with count and sum metadata.","exampleAgentPrompt":"Can you normalize these weights for me — [1, 2, 1] — so they sum to 1 and tell me if they're valid?","exampleUseCases":[{"title":"Normalizing portfolio allocation weights","prompt":"I have raw portfolio weights of [30, 50, 20] for my three assets — can you normalize them so they sum to 1 and give me each asset's share?"},{"title":"Scaling feature importance scores","prompt":"I've got feature importance scores from my model — [0.8, 1.6, 0.4, 0.2] — can you normalize them into a proper probability distribution that sums to 1?"},{"title":"Converting vote tallies to proportions","prompt":"We got votes of [120, 240, 40] across three candidates — normalize these to fractional proportions and confirm the total is valid."}],"resultDescription":"Returns a JSON object containing the normalized weight array (each value divided by the total sum), the original sum of all weights, the count of input weights, and a validity flag indicating whether normalization was possible (i.e., sum is non-zero).","failureModes":["All weights are zero — sum is 0, cannot normalize, valid flag returns false","Non-numeric values in the weights array cause a validation error","Empty weights array returns count 0 with no normalized output","Negative weights may be rejected or flagged as invalid"],"whenToPreferThis":"Choose this endpoint when you need a quick, pay-per-use normalization of a numeric weight vector without setting up your own math library or server-side computation. Ideal for agents that need on-the-fly probability distribution computation, especially in contexts where verifiable, micropayment-gated utility functions are preferred over self-hosted solutions.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T00:53:49.523Z","isFirstParty":false,"canonicalSlug":"delx-commerce-weight-normalize-c3b9d774"}