{"uid":"cap_zCbzwCjTrELEbBCSECZNj","slug":"openverbs-random-sample-204f9e00","name":"OpenVerbs Random Sample","description":"Draw a random sample from a provided array — without replacement by default (a fair shuffle), or with replacement when unique is false. count defaults to 1.","url":"https://random.openverbs.com/v1/sample","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["items"],"properties":{"count":{"type":"integer","maximum":10000,"minimum":1,"description":"How many to draw. Default 1."},"items":{"type":"array","maxItems":10000,"minItems":1,"description":"The pool to sample from."},"unique":{"type":"boolean","description":"Draw without replacement. Default true."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_axWg15_TtZSqNYyaJp7s_","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Draws a random sample of N items from a provided array, either without replacement (fair shuffle, default) or with replacement.","exampleAgentPrompt":"From this list of 20 employee names, randomly pick 5 without replacement: [Alice, Bob, Carol, Dave, Eve, Frank, Grace, Hank, Iris, Jack, Karen, Leo, Mona, Ned, Olivia, Paul, Quinn, Rita, Sam, Tara].","exampleUseCases":[{"title":"Lottery winner selection","prompt":"I have 50 contest entries in this list — can you randomly draw 3 winners without repeating anyone? Here's the list: [entry1, entry2, ... entry50]."},{"title":"Random team assignment","prompt":"Split these 12 people into 3 groups of 4 by randomly sampling their names without replacement from this list: [Alice, Bob, Carol, Dave, Eve, Frank, Grace, Hank, Iris, Jack, Karen, Leo]."},{"title":"Random quiz question picker","prompt":"I have a bank of 100 quiz questions in this array — please randomly pick 10 of them without repeating any, so I can build tonight's quiz."}],"resultDescription":"Returns an array of sampled items drawn from the provided pool. By default draws without replacement (unique=true), ensuring no duplicates. The count parameter controls how many items are returned (default 1, max 10000).","failureModes":["count exceeds pool size when sampling without replacement — returns an error","items array is empty or missing — validation error","count is 0 or negative — schema validation failure","count or items array exceeds 10000 limit — rejected with max-size error","malformed JSON body — HTTP 400"],"whenToPreferThis":"Choose this endpoint when you need to randomly select one or more items from an existing collection — especially when fairness (no-replacement) matters. Prefer it over random integer endpoints when your input is already a list of objects, strings, or mixed values. Ideal for lotteries, quiz shuffles, team assignments, card deals, or any scenario where you need a subset of a pool without writing sampling logic yourself.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:41:23.319Z","isFirstParty":false}