# Agent Tools (x402) — Random Integer Generator

> Agent Tools (x402) — Random Integer Generator is a paid API for AI agents from agent-tools-x402.t6y11a.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-11-01).

Returns one or more cryptographically verifiable random integers within a caller-specified range, backed by the drand beacon, via a pay-per-call x402 micropayment.

## Facts

- Endpoint: GET https://agent-tools-x402.t6y11a.workers.dev/api/random?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-tools-x402-random-integer-generator-f6d60fd5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_avmt5V5arDy0Bz8P67eeZ

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 agent-tools-x402-random-integer-generator-f6d60fd5
```

Example prompt: Give me 5 random integers between 1 and 49 — I need them to be provably fair and verifiable, like from a public randomness beacon.

## When to prefer this

Choose this endpoint when you need cryptographically verifiable, publicly auditable random integers — not just pseudo-random — especially when fairness must be demonstrable to third parties (lotteries, raffles, games). It requires no API key or account setup, charges only $0.002 USDC per call via x402, and never charges for failed requests. Prefer it over PRNG-based alternatives when the verifiability of randomness matters, and over heavyweight VRF services when you need a lightweight pay-per-use utility.

## Known failure modes

- Payment not provided or insufficient USDC — request rejected with 402, no charge
- Invalid query parameters (e.g. n > 100, non-numeric values, min > max) — 400 error returned
- n or bound values outside allowed ranges — 400 bad request
- drand beacon temporarily unavailable — upstream error propagated
- Network timeout to workers.dev — 5xx or connection error

## How this service works

Pay-per-call utilities for AI agents. Payments in USDC on Base via x402 v2; no accounts or API keys. Failed requests are never charged. No endpoint performs server-side fetching of caller-supplied URLs.

## Output

A JSON object containing: an array of random integers (integers[]), the drand beacon metadata (round number, chainHash, signature, randomness string) that proves the randomness source, and a verification URL pointing to the public drand API round used to generate the values. The integers are drawn uniformly within the [min, max] range.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "n": {
       "type": "string",
       "description": "number of integers, 1-100 (default 1)"
      },
      "max": {
       "type": "string",
       "description": "inclusive upper bound (default 100)"
      },
      "min": {
       "type": "string",
       "description": "inclusive lower bound (default 0)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "beacon": {
   "round": 6596584,
   "chainHash": "8990e7a9aaed2ffed73dbd7092123d6f289930540d7651336225dc172e51b2ce",
   "signature": "a75225...",
   "randomness": "99909959..."
  },
  "verify": {
   "roundUrl": "https://api.drand.sh/public/6596584"
  },
  "integers": [
   42,
   7,
   91
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-tools-x402-random-integer-generator-f6d60fd5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-tools-x402.t6y11a.workers.dev](https://www.zero.xyz/host/agent-tools-x402.t6y11a.workers.dev/llms.txt)
