Provably fair RNG API · built for casinos, sweepstakes & originals

Generate provably fair random numbers.

Third-party seed commitments and unbiased randomness for dice, crash, mines, card shoes, and sweepstakes. Commit each server seed once, derive every bet in microseconds in your own stack, and hand players a proof they don't have to take your word for.

  • 0 msper-bet API latency — derive locally with provable-core
  • 1 commitper seed rotation — bet volume never hits your API quota
  • 7-dayforced reveal — sealed commits auto-publish if unrotated
  • Private betsstakes, players, and payouts never leave your servers

Live API console

GET https://api.provable.io/api/ints?clientSeed=demo-user&count=5&min=1&max=100

No key needed
Your random numbers will appear here
cURL
Live Response
{
  "outcome": [],
  "message": "Click 'Generate' to try the API"
}

For gambling operators

Third-party proof. Your game loop.

Self-hosted provably fair still asks players to trust that the house didn't cherry-pick a friendlier server seed. Sealed commits split the trust without adding latency to your bet path:

  • One commit per seed pair: lock a server seed publicly under your label via POST /api/commit, then run unlimited rounds locally with @provableio/provable-core.
  • Zero bet-path downtime risk: if Provable.io is ever unreachable, active tables keep dealing on the current seed; only rotation waits.
  • Stakes stay internal: we see the commit label and reveal — never your players, bet sizes, or balances.
  • House can't bury a seed: one sealed commit per label (GET /api/commits?label=…) and automatic public reveal after 7 days.
Read the operator integration guide
seed-rotation.ts0 ms bet path
// 1. Once per seed rotation — third-party sealed commit
const commit = await fetch("https://api.provable.io/api/commit", {
  method: "POST", headers,
  body: JSON.stringify({ sealed: true, label: `player:${id}:seed:${n}` }),
}).then((r) => r.json());
// Show commit.serverHash to player; keep commit.serverSeed private

// 2. Every bet — derive locally in microseconds (zero API call)
const [float] = Provable(() => {})({
  serverSeed: commit.serverSeed, clientSeed, nonce, cursor: 0,
}).floats(1);
const diceRoll = Math.floor(float * 10001) / 100; // 0.00–100.00

// 3. Player rotates — reveal old seed publicly
await fetch("https://api.provable.io/api/reveal", {
  method: "POST", headers,
  body: JSON.stringify({ commitId: commit.commitId, clientSeed }),
});

The problem

Random you can't check is just a claim.

A fair draw needs a commitment before the result and a way to check it after. Most random sources give you neither.

How to generate provably fair random numbers

Self-hosted seeds still ask for trust.

When the house generates its own server seed and publishes its own hash, sharp players still wonder if bad seeds get discarded before a big bet.

“Rigged” claims drain support & VIPs.

A cold streak without an independent third-party receipt turns into Telegram FUD, chargebacks, and churn — even when your game math is clean.

On-chain VRF breaks live game UX.

Gas fees per bet and multi-second block confirmations kill dice, crash, mines, and live tables. Off-chain HMAC gives instant bets with the same verifiable math.

Audit trail

Every draw leaves a receipt.

Each outcome is stored with its client seed, nonce and server hash. Once the seed rotates, the server seed is revealed and anyone can re-run the draw. Pick a record and replay it.

How verification works
outcomesExample records · replay runs in your browser
Example outcome records
shortIdclientSeedrangeoutcomeserverHashtime (UTC)
raffle-2026-091–2400284eb39f6e8…14:02:11
loot-box-77811–10087e16699a3…14:02:48
tournament-seat-121–64369299991b…14:03:05
dice-room-31–62, 6cbc4bc81…14:03:19
giveaway-oct1–50002033, 741, 137931edfa0…14:04:02
mint-reveal-04191–100008310190dffe9…14:04:37

Unbiased mapping

Uniform means uniform.

The usual shortcut maps random bytes onto a range with %, which quietly skews dice rolls, deck deals, and live RTP across millions of bets. provable-core rejects out-of-range values so every outcome has the exact same probability.

2,400

MethodSkew, log scaleMost likely outcome vs fair

provable-core ints()exact
Math.random() * n+1.6e-11%
uint32 % n+0.000016%
byte % nmisses 2,144 outcomes

Math.random() assumes a 52-bit float, as in V8. Skew is the worst-case extra chance of the most favoured outcome.

SDK

Typed client. Zero dependencies.

@provableio/sdk covers every endpoint with types generated from the OpenAPI spec. It runs on Node 18+, Deno, Bun, browsers and Workers, and returns errors as values instead of throwing.

TypeScript SDK guide
round.tspackage.json
import { ProvableClient } from "@provableio/sdk";

const client = new ProvableClient({ apiKey: process.env.PROVABLE_KEY });

const { data, error } = await client.getInts({
  clientSeed: "player-4821:round-904",
  count: 1, min: 0, max: 10000, // 0.00–100.00 dice roll
});
if (error) throw new Error(error.error);

// attach data.serverHash + /o/<shortId> to the bet receipt
const { data: ok } = await client.verifyServerHash({
  clientSeed: data.clientSeed,
  serverHash: data.serverHash,
});

Commit-reveal

Hash first. Seed second.

For draws that must be sealed in advance, POST /api/commit returns a server hash before you choose your client seed. POST /api/reveal then returns the outcome and the seed, so the server could not have steered the result.

Commit-reveal reference
seed-pair-01commit-reveal
  1. POST /api/commitserverHash eb39f6e84e957e12… locked publicly
  2. player setsclientSeed "raffle-2026-09" + places bet
  3. POST /api/revealseed rotated, serverSeed aed996bd82c48a54… revealed
  4. sha256(serverSeed)matches hash committed at 14:02:07 (or auto-reveals in 7d)

FAQ

Frequently asked questions.

What is a provably fair random number?

A provably fair random number is an outcome that anyone can independently verify was not chosen on purpose. The server publishes a cryptographic hash of its secret seed before you ask for a number; once your client seed is mixed in and the server seed is revealed, anyone can recompute the result and prove it matches the original hash.

Is the API free to use?

Yes. Without an account you can make 10 draws a minute and 100 a day per IP, enough to try it. A free account gets an API key, 10,000 draws a day, and the batch and streaming endpoints.

How do I verify a past outcome?

Go to the /verify page or call GET /api/verifyServerHash with the original clientSeed and serverHash. The endpoint returns true if the values match our records, confirming the outcome was generated as claimed.

Can I use this for online gaming or a casino?

Yes for crypto casinos, sweepstakes casinos, and provably fair originals. Provable.io is not a gaming license or an ISO/IEC 17025 test lab — operators in regulated jurisdictions still handle licensing and lab certification — but it provides the third-party seed commitments, public proof receipts, and daily Merkle roots players and auditors ask for.

Do I have to call the API on every bet?

No. Call POST /api/commit with sealed: true once per seed rotation, derive every bet locally in your own game engine with the MIT-licensed @provableio/provable-core library, and call POST /api/reveal when the player rotates seeds. Bet volume never touches your quota, player stakes stay on your servers, and live games keep running even if the API is temporarily unreachable.

How does the commit-reveal flow work?

Call POST /api/commit to receive a commitment id and a hash of an outcome that has been generated but not yet shown to you. Later, call POST /api/reveal with the commitment id to receive the outcome itself. Because the hash was issued before reveal, neither party could have changed the result after the fact.

Commit first. Prove every round.

Free live & test API keys, no credit card. 10,000 draws/day — unlimited local bets per sealed seed.