{"uid":"cap_avmt5V5arDy0Bz8P67eeZ","slug":"agent-tools-x402-random-integer-generator-f6d60fd5","name":"Agent Tools (x402) — Random Integer Generator","description":"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.","url":"https://agent-tools-x402.t6y11a.workers.dev/api/random?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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"}}}}},"responseSchema":{"type":"json","example":{"beacon":{"round":6596584,"chainHash":"8990e7a9aaed2ffed73dbd7092123d6f289930540d7651336225dc172e51b2ce","signature":"a75225...","randomness":"99909959..."},"verify":{"roundUrl":"https://api.drand.sh/public/6596584"},"integers":[42,7,91]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_vkwtyxua6LgC3ogVfkxmw","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"Give me 5 random integers between 1 and 49 — I need them to be provably fair and verifiable, like from a public randomness beacon.","exampleUseCases":[{"title":"Lottery number picker","prompt":"Pick 6 random numbers between 1 and 60 for my weekly lottery draw — I want them to be verifiably fair so no one can claim they were rigged."},{"title":"Random game event roll","prompt":"Roll 3 random integers between 1 and 20 for my tabletop RPG game tonight — like three independent dice rolls."},{"title":"Random winner selection","prompt":"I have a giveaway with 200 entries numbered 1 through 200 — pick one random winner number for me, and give me something I can show people to prove it was fair."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-01T06:30:32.890Z","isFirstParty":false,"canonicalSlug":"agent-tools-x402-random-integer-generator-f6d60fd5"}