{"uid":"cap_BmjteUgYeAEzjZ5LnjZ_e","slug":"verifiable-random-number-generator-hmac-sha256-69eeb4d2","name":"Verifiable Random Number Generator (HMAC-SHA256)","description":"Draws a random integer within any min-max range using HMAC-SHA256 over a client-supplied seed, revealing the server seed so the draw can be independently recomputed and verified afterward. For raffles, matchmaking, tie-breaking between competing agents, and any process where 'trust me, it was random' isn't good enough.","url":"https://x402.forgemesh.io/verifiable-random-generator","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"max":{"type":"string","description":"default 100"},"min":{"type":"string","description":"default 1"},"client_seed":{"type":"string","description":"your seed for verifiability"}}},"responseSchema":{"type":"json","example":{"proof":"HMAC-SHA256(server_seed, client_seed) first 4 bytes mod range — recompute to verify","value":4,"server_seed_revealed":"e3b1..."}},"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_sXQ9pk-XQf_oon22VYjrT","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":"Generates a cryptographically verifiable random integer within a specified min-max range using HMAC-SHA256 over a client-supplied seed, with server seed revealed for independent verification.","exampleAgentPrompt":"Pick a verifiable random winner number between 1 and 500 using my seed 'raffle-2024-finalists' so I can prove the draw was fair afterward.","exampleUseCases":null,"resultDescription":"Returns a random integer within the specified min-max range, along with the server seed and HMAC-SHA256 proof used to produce it, enabling anyone to recompute and confirm the result was not manipulated.","failureModes":["Invalid min/max values (e.g. min >= max) returning a 400 error","Missing or malformed client_seed causing rejection","Payment failure via x402 protocol resulting in 402 response","Server-side seed generation failure returning 500 error"],"whenToPreferThis":"Choose this endpoint when you need a random integer that must be independently verifiable and tamper-evident — such as raffles, contests, matchmaking, tie-breaking between agents, or any scenario where auditability matters. Prefer it over standard PRNGs when 'trust me, it was random' is insufficient and participants need cryptographic proof.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T07:02:32.071Z","isFirstParty":false}