{"uid":"cap_fcrqrP8gt6vgswfW2sgas","slug":"delx-seeded-weighted-sample-cb7292cc","name":"Delx Seeded Weighted Sample","description":"Seeded Weighted Sample: Seeded Weighted Sample samples unique items using caller weights without replacement from bounded caller-supplied values without an external provider. Call Seeded Weighted Sample 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 Sample as versioned deterministic JSON. Price: $0.001 USDC via x402 on Base.…","url":"https://api.delx.ai/api/v1/x402/seeded-weighted-sample","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"seed":{"type":"string","maxLength":8192,"description":"Seed supplied to Seeded Weighted Sample; used only for this bounded calculation and processed in memory without retention."},"count":{"type":"integer","description":"Count supplied to Seeded Weighted Sample; 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 Sample; used only for this bounded calculation and processed in memory without retention."},"weights":{"type":"array","items":{"type":"integer"},"maxItems":256,"description":"Weights supplied to Seeded Weighted Sample; used only for this bounded calculation and processed in memory without retention."}}},"responseSchema":{"type":"json","example":{"result":{"count":2,"items":["a","c"]},"schema":"delx/util-seeded-weighted-sample/v1","status":"pass","evidence":{"retained":false,"input_sha256":"4b94fab1aa6acc04be7b55390f0c8075b8e83c859b6ceaccfd3469af77bb03fd","external_calls":0},"operation":"seeded_decision:seeded_weighted_sample"}},"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_CYORPPRMjgGQktMWx8TmG","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":"Randomly samples a specified count of items from a weighted list using a deterministic seed, returning reproducible results without retaining input data.","exampleAgentPrompt":"Using a seeded weighted sample, pick 3 items from [\"feature-a\", \"feature-b\", \"feature-c\", \"feature-d\"] with weights [10, 50, 25, 15] using seed \"experiment-42\" — I need reproducible results every time I run this.","exampleUseCases":[{"title":"Reproducible A/B variant assignment","prompt":"I need to assign users to one of three UI variants — \"control\", \"variant-a\", \"variant-b\" — with weights 60, 25, 15. Use seed \"user-session-7821\" and pick 1 item so I get the same assignment every time for that user."},{"title":"Weighted random content promotion","prompt":"Pick 2 articles to feature from this list: [\"article-sports\", \"article-tech\", \"article-health\", \"article-finance\"] with weights [5, 30, 40, 25] using seed \"daily-rotation-2024-06-01\" so the selection is deterministic for today."},{"title":"Agent task queue weighted routing","prompt":"I have four worker agents — \"worker-alpha\", \"worker-beta\", \"worker-gamma\", \"worker-delta\" — with capacity weights [100, 80, 60, 40]. Use seed \"job-batch-991\" to sample 2 workers to assign this batch to."}],"resultDescription":"Returns a JSON object with the sampled items array and count, plus evidence metadata including a SHA-256 hash of the input (for auditability), confirmation that no data was retained, and the number of external calls made (zero). The schema version and operation name are also included.","failureModes":["Mismatched array lengths between items and weights may cause errors or unexpected behavior","Count exceeding the number of items could return fewer results or error","Items or weights arrays exceeding 256 elements will be rejected","Seed string exceeding 8192 characters will be rejected","Invalid types (e.g. non-integer weights, non-string items) will fail schema validation"],"whenToPreferThis":"Choose this endpoint when you need deterministic, reproducible weighted random sampling — i.e. the same seed must always yield the same result. Ideal for agent workflows requiring auditable, stateless randomization (e.g. user assignment, load balancing, content rotation) where you need a verifiable SHA-256 input hash and a guarantee of no data retention. Prefer over custom code when operating in a sandboxed agent environment without a reliable RNG library.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T19:00:02.332Z","isFirstParty":false}