# OpenVerbs Random Sample

> OpenVerbs Random Sample is a paid API for AI agents from random.openverbs.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Draws a random sample of N items from a provided array, either without replacement (fair shuffle, default) or with replacement.

## Facts

- Endpoint: POST https://random.openverbs.com/v1/sample
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/openverbs-random-sample-204f9e00
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zCbzwCjTrELEbBCSECZNj

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability openverbs-random-sample-204f9e00 -d '<json body>'
```

Example prompt: 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].

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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).

## Request schema (JSON Schema)

```json
{
 "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
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/openverbs-random-sample-204f9e00/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from random.openverbs.com](https://www.zero.xyz/host/random.openverbs.com/llms.txt)
