# Solgiery Random Weighted Selection

> Solgiery Random Weighted Selection is a paid API for AI agents from api.solgiery.com, paid per call via x402, $0.007/call, status unknown (last checked 2026-09-14).

Selects one item from an array using cryptographically secure weighted random selection, returning the chosen item and its original index.

## Facts

- Endpoint: POST https://api.solgiery.com/v1/random/weighted
- Price: $0.007/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/solgiery-random-weighted-selection-9dd24d51
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_fav2OuFNPIFaIOEaoG_GE

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 solgiery-random-weighted-selection-9dd24d51 -d '<json body>'
```

Example prompt: Pick one prize from my loot table using these weighted odds: ['common sword', 'rare shield', 'epic bow', 'legendary armor'] with weights [700, 200, 80, 20] — use cryptographically secure weighted random selection.

## When to prefer this

Use this endpoint when you need a single cryptographically secure weighted random selection from a list where different items should have different probabilities. Prefer it over uniform random choice when items have unequal probability mass (e.g. loot tables, weighted lotteries, A/B traffic splitting, raffle draws proportional to ticket count). The CSPRNG backing makes it suitable for fairness-critical applications. For uniform (equal-weight) selection, use the sibling uniform select endpoint instead.

## Known failure modes

- Items and weights arrays of different lengths — request rejected
- All weights are zero — at least one must be positive
- Weight value out of range (negative or above 1,000,000,000) — validation error
- Items array empty or exceeds 1,000 elements — rejected
- Payment not settled (x402) — 402 response before computation
- Network timeout — no result returned

## How this service works

Select one original index and item with probability weight divided by total weight. Weights must match items and be integers from 0 to 1000000000; at least one must be positive. Uses the server OS CSPRNG. Returns consumed bytes for reproducible calculation, not proof of their origin. Price: 0.007 USDC per request, including the bounded batch.

## Output

Returns the selected item, its original array index, and the number of CSPRNG bytes consumed during the operation. The bytes count enables reproducible cost calculation but does not prove the origin of the randomness. The selection is performed using the server OS CSPRNG, giving cryptographically secure weighted probability.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "items": {
   "type": "array",
   "items": {},
   "maxItems": 1000,
   "minItems": 1
  },
  "weights": {
   "type": "array",
   "items": {
    "type": "integer",
    "maximum": 1000000000,
    "minimum": 0
   },
   "maxItems": 1000,
   "minItems": 1
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/solgiery-random-weighted-selection-9dd24d51/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.solgiery.com](https://www.zero.xyz/host/api.solgiery.com/llms.txt)
