{"uid":"cap_1zxNo2auSgaYVhlIoa5Af","slug":"agenttools-cryptographic-random-generator-686e406d","name":"AgentTools Cryptographic Random Generator","description":"Generate cryptographically secure randomness: passwords with charset rules, hex keys of any byte length, and uniform random integers (rejection sampling, no modulo bias). Never use Math.random for secrets. Use this when an agent needs to cSPRNG passwords, hex keys and uniform integers.","url":"https://agenttools-hub.vercel.app/api/v1/crypto/random-generator?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":"number","description":"Int maximum"},"min":{"type":"number","description":"Int minimum"},"mode":{"enum":["password","hex","int"],"type":"string","description":"Mode"},"upper":{"enum":["true","false"],"type":"string","description":"Include A–Z"},"digits":{"enum":["true","false"],"type":"string","description":"Include 0–9"},"length":{"type":"number","description":"Length (password/hex)"},"symbols":{"enum":["true","false"],"type":"string","description":"Include symbols"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.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_qYqDrj7WxoS4OvJR7374D","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":"Generates cryptographically secure random values: passwords with configurable character sets, hex keys of arbitrary byte length, and uniformly distributed random integers using rejection sampling.","exampleAgentPrompt":"Generate a cryptographically secure random password that's 20 characters long, including uppercase letters, digits, and symbols — no Math.random, I need it safe for production secrets.","exampleUseCases":[{"title":"Secure API key provisioning","prompt":"Generate a cryptographically secure 32-byte hex key I can use as a secret for signing tokens in my app."},{"title":"Strong user password generation","prompt":"Create a secure random password that's 16 characters long with uppercase letters, digits, and symbols included — I need it for a new user account setup."},{"title":"Random integer for lottery or sampling","prompt":"Pick a cryptographically secure random integer between 1 and 1000 with no modulo bias — I'm using it to select a winner from a list."}],"resultDescription":"Returns a generated value based on the selected mode: a password string respecting the specified character set flags and length, a hex-encoded string of the requested byte length, or an integer uniformly sampled between the provided min and max. The response is JSON containing the generated random value and relevant metadata.","failureModes":["Missing required 'mode' parameter returns a 400 error","Invalid mode value (not 'password', 'hex', or 'int') causes a validation failure","For 'int' mode, min or max not provided or min >= max results in an error","Negative or zero length for password/hex mode may cause a rejection","Payment not provided or insufficient (x402) results in a 402 Payment Required response"],"whenToPreferThis":"Use this endpoint when you need cryptographically secure random values (CSPRNG) for secrets, keys, or unbiased integers — not when pseudo-random values from Math.random are acceptable. Prefer this over language built-ins when operating in an agent context without direct access to a secure runtime, or when you need configurable password charset rules or rejection-sampled integers without implementing the logic yourself.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T12:42:55.631Z","isFirstParty":false,"canonicalSlug":"agenttools-cryptographic-random-generator-686e406d"}