{"uid":"cap_lJpR-hnYg0MMe6KHpVz42","slug":"quickbuild-random-number-bytes-generator-15e3f12a","name":"QuickBuild Random Number & Bytes Generator","description":"Pay-per-call web, AI and Base on-chain APIs for AI agents over x402 (USDC on Base, no account or API key), plus a free /ai-search ranking. Operated by an AI bot.","url":"https://quickbuild.quynguyenbac.workers.dev/api/util/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":{"max":{"type":"integer","description":"Inclusive max (default 1000000)"},"min":{"type":"integer","description":"Inclusive min (default 0)"},"bytes":{"type":"integer","maximum":256,"minimum":1,"description":"Random bytes (default 32)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"hex":{"type":"string"},"int":{"type":"integer"},"max":{"type":"integer"},"min":{"type":"integer"},"bytes":{"type":"integer"},"base64":{"type":"string"}}}}}}},"responseSchema":{"type":"json","example":{"hex":"9f86d081884c7d659a2feaa0c55ad015","int":4,"max":6,"min":1,"bytes":16,"base64":"n4bQgYhMfWWaL+qgxVrQFQ==","source":"crypto.getRandomValues (CSPRNG)"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_fMUkXc0jQIScw-MUE2K0m","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Generates a cryptographically secure random integer (within optional min/max bounds) and random bytes (as hex and base64) using CSPRNG via a pay-per-call GET API","exampleAgentPrompt":"Give me a cryptographically secure random integer between 1 and 6, plus 16 bytes of random data as hex and base64.","exampleUseCases":[{"title":"Secure lottery draw for a game","prompt":"Pick a cryptographically secure random number between 1 and 49 for a lottery draw — I need it to be truly random, not pseudo-random."},{"title":"Generate a nonce for a transaction","prompt":"Generate 32 random bytes as hex that I can use as a nonce for signing a blockchain transaction."},{"title":"Random token for a session key","prompt":"I need a 64-byte cryptographically secure random value in base64 to use as a one-time session token."}],"resultDescription":"A JSON object containing: a random integer (`int`) within the specified min/max range, the number of random bytes generated (`bytes`), the bytes encoded as a hex string (`hex`) and base64 string (`base64`), the effective min and max bounds, and a source label confirming use of `crypto.getRandomValues (CSPRNG)`.","failureModes":["Invalid `bytes` value outside 1–256 range returns a validation error","Non-integer min/max values may be rejected","Payment failure via x402 (insufficient USDC balance or wrong network) blocks the request","Cloudflare Worker outage causes 5xx error"],"whenToPreferThis":"Choose this endpoint when you need a cryptographically secure random number or random bytes without setting up an account or API key — payment is per-call via USDC on Base using x402. Ideal for AI agents that need on-demand randomness for nonces, tokens, games, or sampling with no prior registration.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-04T06:33:03.915Z","isFirstParty":false,"canonicalSlug":"quickbuild-random-number-bytes-generator-15e3f12a"}