{"uid":"cap_frPQf20ln89Bo5Txk5NHC","slug":"delx-commerce-seeded-random-sample-1dd89f4a","name":"Delx Commerce — Seeded Random Sample","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/seeded-random-sample?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"seed":{"type":"string","maxLength":256,"minLength":1},"count":{"type":"integer","maximum":1000,"minimum":1},"items":{"type":"array","maxItems":1000}}},"responseSchema":{"type":"json","example":{"count":2,"sample":["gamma","beta"],"schema":"delx/util-seeded-random-sample/v1","indices":[2,1],"seed_sha256":"f55bbb81faa69aaf4936ce9f0aa962c442851e4550566b83cc10573d585a0ed2","source_count":4,"without_replacement":true}},"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_Pks3sjoOboLF2TCJQkSmf","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":"Returns a reproducible random sample of items from an array, deterministically driven by a seed string, with verifiable delivery paid per-call in USDC.","exampleAgentPrompt":"From this list of 50 contest entrants, randomly pick 3 winners using the seed 'contest-2024-finale' so the draw is reproducible and verifiable.","exampleUseCases":[{"title":"Lottery winner selection","prompt":"I have a list of 200 raffle ticket holders — pick 5 random winners using the seed 'spring-raffle-2025' so the draw can be audited later."},{"title":"A/B test group assignment","prompt":"From these 100 user IDs, randomly sample 20 for a new feature experiment using the seed 'experiment-group-b-v3' so we can reproduce the split."},{"title":"Random playlist from track list","prompt":"I have a playlist of 80 songs — shuffle and pick 10 of them using seed 'friday-morning-mix' so I get the same selection every Friday."}],"resultDescription":"Returns a JSON object with: the sampled items array, the integer indices selected from the source, the count of items returned, the total source count, a SHA-256 hash of the seed for verification, and a schema identifier confirming without-replacement sampling.","failureModes":["count exceeds items array length when sampling without replacement — returns error","seed string missing or empty — validation error","count less than 1 or greater than 1000 — out-of-range error","items array empty or missing — no items to sample from","payment not included or insufficient USDC — 402 Payment Required response"],"whenToPreferThis":"Choose this endpoint when you need reproducible, auditable random sampling — i.e. the same seed must always yield the same result and the draw must be verifiable via the seed hash. Ideal for lotteries, experiment group splits, or any scenario where fairness and auditability matter. Prefer over local RNG when verifiable delivery and payment-per-result accountability are required, or when running inside an agent that cannot safely maintain RNG state.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T00:53:56.441Z","isFirstParty":false,"canonicalSlug":"delx-commerce-seeded-random-sample-1dd89f4a"}