{"uid":"cap_a_l3q2ckg7VrDFgwa2NME","slug":"agent402-tools-random-number-bytes-generator-1147f082","name":"agent402.tools Random Number & Bytes Generator","description":"Cryptographically secure randomness. ?bytes=1..1024 returns hex; or ?min=&max= returns a uniform integer; ?count=1..100.","url":"https://agent402.tools/api/random","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","properties":{"max":{"type":"string","description":"Integer upper bound (inclusive)"},"min":{"type":"string","description":"Integer lower bound (inclusive)"},"bytes":{"type":"string","description":"Return N random bytes as hex (1-1024)"},"count":{"type":"string","description":"How many values (1-100, default 1)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["integers"],"properties":{"integers":{"type":"array","items":{"type":"integer"}}}}}}}},"responseSchema":{"type":"json","example":{"integers":[42,7,93]}},"example":{"request":{"input":{"type":"http","method":"GET","queryParams":{"max":"100","min":"1","bytes":"32","count":"5"}}},"response":{"hex":["2fd47bddb9991dc3e626022729000dbee2c4d240943a1b5dd34958dac18d447b","50ddc09fff477250b2fe29b45d58255a8a01555b4e2979e351b9482c6795333f","dd6110dd7d7702adad2fd0b4b03f473e68ff37c719b18e4e9a9ac5a13ab38d77","32e24f170f7464bcac876a2dbf9c02318bf553b337df42d432e685f2ba8f31f4","b9476f574cb08a724e59ed8bfe0d24716157c9c819ace4d9c78fc6761d5d1d1e"]}},"exampleRequest":{"max":"100","min":"1","bytes":"32","count":"5"},"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Tpl-sjIO55Oy7D49uJ5xx","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","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 bytes as hex or a uniform random integer within a specified range, with optional batch count.","exampleAgentPrompt":"Give me 5 cryptographically secure random integers between 1 and 100, and also generate 32 random bytes as a hex string.","exampleUseCases":null,"resultDescription":"Returns a JSON object containing either a hex string of N random bytes, a single random integer within [min, max], or an array of up to 100 such values if count is specified.","failureModes":["bytes parameter out of range (must be 1–1024) returns error","min greater than max returns error","count out of range (must be 1–100) returns error","mixing bytes and min/max parameters may return error","missing required parameters returns error","payment not included or invalid returns 402"],"whenToPreferThis":"Use this endpoint when you need cryptographically secure randomness rather than pseudo-random values — ideal for generating tokens, nonces, salts, or unbiased integer samples. Prefer over language-runtime Math.random() when security or statistical uniformity matters.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T18:51:47.790Z","isFirstParty":false}