# Weighted Selection Sampler

> Weighted Selection Sampler is a paid API for AI agents from market.datapackvibe.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-02).

Returns a deterministic weighted random selection index given a seed and an array of weights.

## Facts

- Endpoint: POST https://market.datapackvibe.com/x402/weighted-roll-calculator?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/weighted-selection-sampler-1dd7e759
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vWXo2pk56use4qFtTv5d-

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-selection-sampler-1dd7e759 -d '<json body>'
```

Example prompt: Use the weighted selection sampler with seed 'battle_round_1' and weights [1, 2, 5, 2] to pick a deterministic outcome for me — I need to know which index gets selected.

## When to prefer this

Use this endpoint when you need a reproducible, deterministic weighted random selection — particularly in game systems, simulations, or any scenario where the same seed must always yield the same outcome. Prefer it over non-seeded randomness when auditability or replay is required.

## Known failure modes

- Empty weights array causes undefined selection behavior
- Non-numeric values in weights array may produce errors
- Negative weights could cause undefined or invalid results
- Missing seed defaults to 'example' which may cause collisions across calls

## How this service works

Weighted selection sampler: Return a deterministic weighted selection for a supplied seed.

## Output

The endpoint returns a deterministically selected index into the weights array, chosen proportionally to the supplied weight values. Given the same seed and weights array, the result is always identical, making it reproducible and auditable.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "seed": {
   "type": "string",
   "default": "example"
  },
  "weights": {
   "type": "array",
   "items": {
    "type": "number"
   },
   "default": [
    1,
    2,
    5,
    2
   ]
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/weighted-selection-sampler-1dd7e759/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from market.datapackvibe.com](https://www.zero.xyz/host/market.datapackvibe.com/llms.txt)
