{"uid":"cap_sVCodkfDMnY6Kwm_DDgTS","slug":"delx-seeded-weighted-choice-8a722bd6","name":"Delx Seeded Weighted Choice","description":"Seeded Weighted Choice: Seeded Weighted Choice selects one item using non-negative caller weights from bounded caller-supplied values without an external provider. Call Seeded Weighted Choice when an agent needs a reproducible decision that another run can independently replay. Returns the deterministic selection plus seed provenance, population bounds, and the operation-specific outcome for Seeded Weighted Choice as versioned deterministic JSON. Price: $0.001 USDC via x402 on Base. First-party…","url":"https://api.delx.ai/api/v1/x402/seeded-weighted-choice","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"seed":{"type":"string","maxLength":8192,"description":"Seed supplied to Seeded Weighted Choice; used only for this bounded calculation and processed in memory without retention."},"items":{"type":"array","items":{"type":"string","maxLength":8192},"maxItems":256,"description":"Items supplied to Seeded Weighted Choice; used only for this bounded calculation and processed in memory without retention."},"weights":{"type":"array","items":{"type":"number"},"maxItems":256,"description":"Weights supplied to Seeded Weighted Choice; used only for this bounded calculation and processed in memory without retention."}}},"responseSchema":{"type":"json","example":{"result":{"index":0,"selected":"fast"},"schema":"delx/util-seeded-weighted-choice/v1","status":"pass","evidence":{"retained":false,"input_sha256":"c6638a85aa14e9c05d911356c0a5fbd65272dc5841db91ed4d836ca7d4bf523b","external_calls":0},"operation":"seeded_decision:seeded_weighted_choice"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_GoE12VBCYqZ1nfyG-v98y","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Deterministically selects one item from a weighted list using a seed string, returning the chosen item and its index.","exampleAgentPrompt":"Using a seeded weighted choice, pick one option from [\"fast\", \"slow\", \"medium\"] with weights [0.6, 0.1, 0.3] using the seed \"run-42\" — I need the result to be reproducible every time.","exampleUseCases":[{"title":"Reproducible A/B variant assignment","prompt":"Given the user ID 'user-8821' as my seed, pick one of [\"control\", \"variant_a\", \"variant_b\"] with weights [0.5, 0.3, 0.2] — I need the same user to always land in the same bucket."},{"title":"Weighted random task routing for agents","prompt":"I have three agents — Alpha, Beta, Gamma — and I want to assign tasks with probabilities 0.5, 0.3, 0.2. Use the task ID 'task-991' as the seed so the assignment is deterministic and auditable."},{"title":"Seeded prize tier selection for a campaign","prompt":"For our campaign draw, pick one prize tier from [\"grand\", \"silver\", \"consolation\"] with weights [0.05, 0.15, 0.8] using the entry code 'ENTRY-2024-XZ' as the seed so the result is verifiable."}],"resultDescription":"Returns a JSON object containing the selected item string, its zero-based index in the input array, operational metadata including whether input was retained (always false), a SHA256 hash of the inputs for auditability, and the number of external calls made (always 0). The schema version and operation name are also included.","failureModes":["Mismatched array lengths between items and weights — likely returns a validation error","Weights summing to zero or containing negative values — undefined or error behavior","Items or weights arrays exceeding 256 elements — rejected by maxItems constraint","Seed string exceeding 8192 characters — rejected by maxLength constraint","Empty items array — no item to select, likely an error response","Invalid JSON body — HTTP 400 or parse error"],"whenToPreferThis":"Choose this endpoint when you need deterministic, reproducible weighted selection — i.e., the same seed must always produce the same result. It is ideal for auditable decisions (A/B testing, task routing, prize draws) where you need a verifiable input hash and guaranteed no data retention. Prefer this over pure random selection when reproducibility and auditability matter, and over client-side implementations when you want a governed, logged, off-device computation.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:50:20.823Z","isFirstParty":false}