# Delx Commerce — Choice Index (Seeded Random Selection)

> Delx Commerce — Choice Index (Seeded Random Selection) is a paid API for AI agents from commerce.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-01).

Returns a deterministic, seeded random index within a given range, useful for reproducible choice selection in agent workflows.

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/choice-index?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-commerce-choice-index-seeded-random-selection-a5a29c66
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6kzJ-wQHTcYdRz9mn6Nv8

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-commerce-choice-index-seeded-random-selection-a5a29c66 -d '<json body>'
```

Example prompt: Pick one item from a list of 5 options using the seed 'morning-blend-42' — give me back which index to use.

## When to prefer this

Use this endpoint when you need fast, cheap, reproducible random index selection seeded by a string — ideal for agent workflows requiring deterministic sampling, consistent A/B routing, or repeatable choice logic without implementing local PRNG. Prefer it over local randomness when you want verifiable, pay-per-result delivery with no API key setup.

## Known failure modes

- Missing or empty seed string results in a validation error
- Length of 0 or negative integer may return an error or undefined behavior
- Non-integer length value causes schema validation failure
- Payment failure via x402 results in HTTP 402 response blocking the call
- Malformed JSON body returns a 400-level error

## How this service works

Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.

## Output

Returns a JSON object with 'ok' (boolean success flag), 'index' (the computed integer index, 0-based, within the given length), 'length' (the range provided), and 'schema' (a versioned schema identifier 'delx/util-choice-index/v1') confirming the computation type.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "seed": {
   "type": "string",
   "description": "Input field: seed."
  },
  "length": {
   "type": "integer",
   "description": "Input field: length."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "index": 3,
  "length": 5,
  "schema": "delx/util-choice-index/v1"
 }
}
```

## More

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