# Delx Weighted Choice

> Delx Weighted Choice is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Picks one item from a list using non-negative weights, returning a single sampled selection as deterministic JSON

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/weighted-choice
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-weighted-choice-ed5059b1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DNt6j5tNsvd_QnVSRVQ_r

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 delx-weighted-choice-ed5059b1 -d '<json body>'
```

Example prompt: Pick one item from this list — ['GPT-4', 'Claude', 'Gemini'] — using weights [0.5, 0.3, 0.2], so higher-weighted models get chosen more often.

## When to prefer this

Use this endpoint when you need a lightweight, stateless, single-call weighted random selection from a finite list — especially during agent preflight, traffic splitting, probabilistic routing, or any scenario where you need one item sampled proportionally to non-negative weights. Prefer it over building your own sampling logic when you need a cheap ($0.001 USDC), fast, machine-readable result with no side effects and no data retention.

## Known failure modes

- Mismatched array lengths between items and weights returns an error
- Negative weight values cause validation failure
- Empty items or weights arrays return an error
- All-zero weights array may cause undefined behavior or error
- Malformed JSON input returns a parsing error

## How this service works

Pick one item from a list using non-negative weights — first-party local utility for agent preflight and proven micro-utils expansion. Returns deterministic machine-readable JSON for $0.001 USDC via x402 on Base. Execution is first-party, local-only, stateless, and memory-only with no paid upstream, no input retention, no web search, no live RPC, and no mediagen. Results are advisory; the caller owns authorization, budgets, and production controls. Sibling of Delx routes that already converted…

## Output

Returns a JSON object containing the chosen item from the input array, selected with probability proportional to its corresponding weight. Typically includes the selected item value and possibly its index.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "items": {
   "type": "array",
   "description": "Input field: items."
  },
  "weights": {
   "type": "array",
   "description": "Input field: weights."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "index": 1,
  "choice": "b",
  "schema": "delx/util-weighted-choice/v1",
  "weight": 2,
  "probability": 0.5,
  "total_weight": 4
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-weighted-choice-ed5059b1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
