{"uid":"cap_7LfHBEiEVv2GXZpTqJszY","slug":"csprng-random-integer-generator-cloudflare-workers-dbefb1ea","name":"CSPRNG Random Integer Generator (Cloudflare Workers)","description":"CSPRNG random integers in [min,max] via crypto.getRandomValues - unbiased sampling for shuffles, canary rollout, jitter and simulation","url":"https://money-reactor.makar52nn2016.workers.dev/api/random?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","properties":{"input":{"type":"object","properties":{"queryParams":{"type":"object","properties":{}}}},"output":{"type":"object","properties":{"example":{"n":1,"max":100,"min":1,"mode":"int"}}}}},"responseSchema":null,"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.1/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.1","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.1","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_LpmB77FjQ9JDe3NsSabdc","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.1","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns cryptographically secure random integers in a specified [min, max] range using crypto.getRandomValues for unbiased sampling","exampleAgentPrompt":"Give me 5 cryptographically secure random integers between 1 and 500 — I need them unbiased for a shuffle.","exampleUseCases":[{"title":"Canary rollout percentage sampling","prompt":"I need to randomly assign users to a canary release — generate a single unbiased random integer between 1 and 100 so I can compare it against a rollout threshold."},{"title":"Retry jitter for distributed systems","prompt":"My service needs a random jitter delay between 200 and 2000 milliseconds to avoid thundering herd on retries — can you get me a secure random integer in that range?"},{"title":"Card shuffle for card game simulation","prompt":"I'm simulating a card game and need to shuffle a 52-card deck — generate 52 unbiased random integers between 1 and 52 for me."}],"resultDescription":"Returns a JSON object containing one or more cryptographically secure random integers sampled uniformly from the specified [min, max] range, including the parameters used (n, min, max, mode).","failureModes":["Invalid or missing min/max parameters — returns error if min >= max","Non-integer or out-of-range parameter values cause malformed request error","Payment not attached or insufficient USDC — returns 402 Payment Required","Cloudflare Worker cold start or timeout — rare latency spike or 503","n (count) too large — may be rejected or rate-limited"],"whenToPreferThis":"Choose this endpoint when you need cryptographically secure, unbiased random integers (e.g. for shuffles, canary rollout, simulation jitter, or lotteries) and cannot rely on a local PRNG. Prefer this over Math.random()-based generators when bias elimination or reproducible fairness is important. Ideal for agentic workflows that need randomness as a service without deploying their own crypto infrastructure.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T12:31:59.505Z","isFirstParty":false,"canonicalSlug":"csprng-random-integer-generator-cloudflare-workers-dbefb1ea"}