# Random Item Picker (Uniform, No-Replacement)

> Random Item Picker (Uniform, No-Replacement) is a paid API for AI agents from x402-catalog-history.ai-business-surface.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-19).

Picks a specified count of random items from a user-supplied list using cryptographically secure randomness, returning the chosen items and their 0-based indices

## Facts

- Endpoint: GET https://x402-catalog-history.ai-business-surface.workers.dev/pick?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/random-item-picker-uniform-no-replacement-80721645
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OfK21PBLCrD6r8uQu7ubu

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 random-item-picker-uniform-no-replacement-80721645
```

Example prompt: Randomly pick 3 winners from this list of contestants — alice, bob, carol, dave, eve, frank — without repeating any name.

## When to prefer this

Use this endpoint when you need a cryptographically secure, stateless, single-GET random draw from a small list (up to 100 items) without maintaining your own RNG or state. Prefer it over client-side Math.random() when auditability or reproducible fairness matters, or when you want a simple pay-per-use call with no API key setup. It is ideal for raffles, random assignment, or sampling tasks where the list fits in a query parameter and you need fresh unpredictable results each time.

## Known failure modes

- 400 if any item is empty or malformed
- 400 if more than 100 items are provided
- 400 if count exceeds number of items when replace=false
- 400 if count is less than 1 or greater than 100
- 400 if items are over the maximum allowed length
- 402 on first call — must repeat request with PAYMENT-SIGNATURE header to receive result
- Malformed query string may result in unexpected parsing of the items list

## How this service works

Pick random items from a list in one GET: count items from the items you pass, uniform, by default without replacement. Returns picked[] and the 0-based indices[], drawn with crypto.getRandomValues and rejection sampling (Fisher-Yates for unique draws). Nothing is fetched or stored. curl: GET /pick?items=alice,bob,carol&count=2 . Response: {"picked":["carol","alice"],"indices":[2,0],"unique":true,...}. items 1..100 comma/newline separated; count 1..100 (default 1); replace=false by default. An empty item, too many/over-long items, a bad count or count>items without replacement is 400 before payment. No seed and no signed beacon; each paid call returns fresh picks. No keys, no account, one GET, one delivery — 0.001 USDC. A purchase is two calls by design: this first call returns 402 with the price and the payment terms, and you then repeat the same request with the PAYMENT-SIGNATURE header to receive the 200 delivery.

## Output

A JSON object containing: `picked` (array of the randomly selected item strings), `indices` (array of 0-based positions of each picked item in the original list), and `unique` (boolean indicating whether sampling was without replacement). The selection is drawn using crypto.getRandomValues with Fisher-Yates for unique draws, ensuring cryptographic quality randomness.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "count": {
       "type": "string"
      },
      "items": {
       "type": "string"
      },
      "replace": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/random-item-picker-uniform-no-replacement-80721645/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-catalog-history.ai-business-surface.workers.dev](https://www.zero.xyz/host/x402-catalog-history.ai-business-surface.workers.dev/llms.txt)
