# Weighted Random Item Selector

> Weighted Random Item Selector is a paid API for AI agents from rng.sociologic.ai, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-01).

Selects a single random item from a list of up to 1000 weighted options using cryptographically secure randomness

## Facts

- Endpoint: POST https://rng.sociologic.ai/weighted?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/weighted-random-item-selector-5bbb639f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_veBd4jupO3wTKabGg-b-N

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 weighted-random-item-selector-5bbb639f -d '<json body>'
```

Example prompt: Pick a random prize for me using these weighted options: 'Grand Prize' with weight 1, 'Second Prize' with weight 5, 'Consolation Prize' with weight 20, and 'No Prize' with weight 74.

## When to prefer this

Choose this endpoint when you need non-uniform random selection where different options should have different probabilities of being chosen. Prefer it over a simple shuffle or uniform random pick when outcomes have known likelihoods, rarity tiers, or priority scores. It is ideal for loot tables, A/B test traffic splitting, raffle draws, probabilistic routing, and simulation tasks where outcome frequency must match specified weights.

## Known failure modes

- Array exceeds 1000 items — returns 400 error
- Weight values are zero or negative — invalid input
- Items array is empty — returns error with no selection
- Malformed item objects missing required value or weight fields — validation error
- Payment not provided or insufficient — returns 402 Payment Required

## How this service works

Select a random item from weighted options (max 1000 items)

## Output

Returns the randomly selected item value from the weighted list, chosen with probability proportional to each item's weight relative to the total sum of all weights. The result is a single value drawn from the provided items array using cryptographically secure randomness.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "items": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "value",
     "weight"
    ],
    "properties": {
     "value": {
      "description": "The item value"
     },
     "weight": {
      "type": "number",
      "description": "Weight (positive number)"
     }
    }
   },
   "maxItems": 1000,
   "description": "Array of weighted items"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/weighted-random-item-selector-5bbb639f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from rng.sociologic.ai](https://www.zero.xyz/host/rng.sociologic.ai/llms.txt)
