{"uid":"cap_vWXo2pk56use4qFtTv5d-","slug":"weighted-selection-sampler-1dd7e759","name":"Weighted Selection Sampler","description":"Weighted selection sampler: Return a deterministic weighted selection for a supplied seed.","url":"https://market.datapackvibe.com/x402/weighted-roll-calculator?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"seed":{"type":"string","default":"example"},"weights":{"type":"array","items":{"type":"number"},"default":[1,2,5,2]}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_4SWzhHK_wHPWISVLSg_ER","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns a deterministic weighted random selection index given a seed and an array of weights.","exampleAgentPrompt":"Use the weighted selection sampler with seed 'battle_round_1' and weights [1, 2, 5, 2] to pick a deterministic outcome for me — I need to know which index gets selected.","exampleUseCases":[{"title":"Reproducible loot drop for game round","prompt":"I need a deterministic loot tier selection for this player's session — use seed 'session_abc42' and weights [1, 3, 10, 5] where higher weights mean more common drops, and tell me which index wins."},{"title":"Weighted NPC encounter selection","prompt":"For tonight's dungeon encounter, pick one of four enemy types using seed 'dungeon_floor2' and weights [5, 3, 1, 1] — the first two should be much more likely to appear than the rares."},{"title":"Probability-weighted A/B variant assignment","prompt":"I have three variants with relative weights [2, 5, 3] and need a stable, repeatable assignment for user 'user_00891' — use that as the seed and tell me which variant index they land on."}],"resultDescription":"The endpoint returns a deterministically selected index into the weights array, chosen proportionally to the supplied weight values. Given the same seed and weights array, the result is always identical, making it reproducible and auditable.","failureModes":["Empty weights array causes undefined selection behavior","Non-numeric values in weights array may produce errors","Negative weights could cause undefined or invalid results","Missing seed defaults to 'example' which may cause collisions across calls"],"whenToPreferThis":"Use this endpoint when you need a reproducible, deterministic weighted random selection — particularly in game systems, simulations, or any scenario where the same seed must always yield the same outcome. Prefer it over non-seeded randomness when auditability or replay is required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T04:56:40.497Z","isFirstParty":false,"canonicalSlug":"weighted-selection-sampler-1dd7e759"}