# Animica Random Pick

> Animica Random Pick is a paid API for AI agents from animica.dev, paid per call via x402, $0.001794/call, status unknown (last checked 2026-09-14).

Randomly selects k items from a candidate list using verifiable DRNG-based randomness, with optional weighting and replacement

## Facts

- Endpoint: POST https://animica.dev/x402/random/pick
- Price: $0.001794/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/animica-random-pick-165a67a8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hGUiZkWZtqLd5CVBNGScj

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 animica-random-pick-165a67a8 -d '<json body>'
```

Example prompt: Pick 3 random winners from this list of contestants — ['Alice','Bob','Carol','Dave','Eve','Frank'] — without replacement and give me proof the draw was fair.

## When to prefer this

Choose this endpoint when you need cryptographically verifiable, auditable random selection — not just any pseudorandom pick. The DRNG-backed attestation and derivation steps make it suitable for public lotteries, giveaways, or any scenario where participants must be able to independently verify the fairness of the draw. Prefer it over a local random function when auditability, reproducibility via request_id, or weighted sampling is required.

## Known failure modes

- items array empty or exceeds 10000 entries — request rejected
- k exceeds items.length when replace=false — invalid parameter error
- weights array length does not match items array — rejected
- float values in weights — rejected (integers only)
- response body exceeds 4MB cap (especially with replace:true and large items) — use indices_only:true
- Payment of 0.006731 USDC not provided or insufficient — 402 Payment Required

## How this service works

Pick k of your items with or without replacement, optionally weighted by integer weights (raffles, lotteries, sortition, A/B splits). One verified randomness draw, cumulative-weight search over a rejection-sampled uniform value, up to 10000 items. The exact rule and the raw draw ride along so you can recompute the winners.

## Output

Returns a JSON object containing: 'picked' (the selected items, omitted if indices_only=true), 'indices' (0-based positions of picks), 'k' (count picked), 'replace' flag, 'weighted' flag, 'randomness' (DRNG seed/output), 'source', 'health', 'attestation', 'verification', and 'derivation' (rules, steps, optional recompute instructions) — plus payment metadata for the x402 micropayment.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "k": {
   "type": "integer",
   "description": "how many to pick, 1..1000 (default 1; alias count). Without replacement k <= items.length"
  },
  "items": {
   "type": "array",
   "description": "candidates, 1..10000 entries (any JSON values)"
  },
  "replace": {
   "type": "boolean",
   "description": "true = with replacement (an item can win twice); default false"
  },
  "weights": {
   "type": "array",
   "description": "one non-negative INTEGER weight per item (floats rejected: the cumulative search must be recomputable exactly)"
  },
  "request_id": {
   "type": "string",
   "description": "your own tag; mixed into the DRNG seed"
  },
  "indices_only": {
   "type": "boolean",
   "description": "omit the picked items and return only their 0-based indices — use it when the items are large: the response cap is 4000000 bytes and with replace:true the same item can be emitted k times"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/animica-random-pick-165a67a8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from animica.dev](https://www.zero.xyz/host/animica.dev/llms.txt)
