For casinos, aggregators and game teams
Integration docs
Everything a casino needs to offer Sevenstudios games, and everything a game team needs to ship one onto the RGS.
Overview
There are three parties. Studios submit a game version (a math package and a front end build) in the back office. The RGS at https://rgs.sevenstudios.io hosts it, draws outcomes and keeps every round. Casinos integrate once: they call our operator API to open game sessions, and they expose a wallet API that we call to move money.
Money never leaves the casino. We only ask its wallet to debit a bet and credit a win, in the player's currency, with transaction ids that make every call safe to repeat.
A typical spin: the player opens the game from the casino, which calls POST /api/v1/operator/sessions and loads the launch_url in an iframe. The game calls /play, we call the casino's /debit, draw the outcome, return it to the game, and call /credit when the round ends.
Signing
Both directions use the same scheme with the operator's secret: an HMAC-SHA256 over the millisecond timestamp, a dot, and the exact raw body, sent as lowercase hex. Requests more than 5 minutes off are refused.
signature = hex( HMAC_SHA256( secret, timestamp + "." + raw_body ) )
Casino -> RGS headers: X-Operator-Key, X-Timestamp, X-Signature
RGS -> casino headers: X-RGS-Operator, X-RGS-Timestamp, X-RGS-Signature
Node example:
import { createHmac } from 'node:crypto';
const body = JSON.stringify({ game: 'seven-sevens', token: playerToken, mode: 'real' });
const ts = String(Date.now());
const sig = createHmac('sha256', SECRET).update(ts + '.' + body).digest('hex');
await fetch('https://rgs.sevenstudios.io/api/v1/operator/sessions', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-Operator-Key': API_KEY, 'X-Timestamp': ts, 'X-Signature': sig },
body,
});Operator API
Every call is a signed POST with a JSON body. Errors come back as {"error": "CODE", "message": "…"} with a 4xx or 5xx status.
The live games you can offer, with their bet modes, RTP and max win.
Opens a game session. For real money, pass a one-time token you created for the player; we call your wallet's /authenticate with it. For fun play, pass "mode": "demo" and no token.
{ "game": "seven-sevens", "token": "your-one-time-player-token", "mode": "real", "language": "en" }
-> { "session_id": "ses_…", "launch_url": "https://rgs-cdn.sevenstudios.io/v/ver_…/index.html?sessionID=…", "currency": "BTC", "balance": 12345 }
Load launch_url in an iframe or a new window. Sessions last 24 hours from the last activity.
Your rounds, newest first. Filters: player_id, from, to (ISO dates), limit (max 200), before (a round id, for paging; we return next).
One round by round_id: amounts, status, every wallet transaction, the fairness data and a signed replay_url your support team can open.
{ "player_id": "u-123", "currency": "USDT", "game": "seven-sevens", "count": 10, "amount": "1.000000",
"expires_at": "2026-12-31T23:59:59Z", "reference": "welcome-campaign-u-123" }
-> { "grant_id": "fr_…" }
Free rounds play in the game's 1x mode at the given bet. We still send you a debit for 0 with free_round_id set, and a normal credit for the win. reference makes the grant idempotent. Also: /free-rounds/cancel with grant_id, /free-rounds/list with an optional player_id.
Wallet API (you build this)
We call <wallet base URL>/<action> with a signed JSON POST. Amounts are decimal strings in the player's currency. Answer within 8 seconds.
- 2xx with JSON means it worked.
- 4xx (except 408 and 429) with
{"error": "CODE"}means a definite no. For a debit useINSUFFICIENT_FUNDSor any code of yours. - 5xx, 408, 429 or no answer means we don't know. We roll back an unknown debit and keep retrying credits and rollbacks (backing off, for about two weeks) until you confirm.
- Every call with a transaction_id must be idempotent. If you've seen it before, return the original result with 2xx.
{ "token": "your-one-time-player-token", "game": "seven-sevens", "session_id": "ses_…" }
-> { "player_id": "u-123", "currency": "BTC", "balance": "0.01250000" }
{ "player_id": "u-123", "currency": "BTC", "session_id": "ses_…" }
-> { "balance": "0.01250000" }
{ "transaction_id": "tx_…", "round_id": "rnd_…", "player_id": "u-123", "currency": "BTC", "amount": "0.00010000",
"game": "gm_…", "bet_mode": "base", "free_round_id": null, "session_id": "ses_…" }
-> { "balance": "0.01240000", "operator_tx_id": "your-id" }
{ "transaction_id": "tx_…", "round_id": "rnd_…", "player_id": "u-123", "currency": "BTC", "amount": "0.00025000",
"debit_transaction_id": "tx_…", "round_closed": true, "game": "gm_…", "free_round_id": null, "session_id": "ses_…" }
-> { "balance": "0.01265000", "operator_tx_id": "your-id" }
Every round ends with exactly one credit, for 0 on a losing round, so you can close the round on your side.
{ "transaction_id": "tx_…", "round_id": "rnd_…", "player_id": "u-123", "currency": "BTC",
"rolled_back_transaction_id": "tx_… (the debit)", "amount": "0.00010000", "game": "gm_…", "session_id": "ses_…" }
-> { "balance": "0.01250000" }
Refund the debit if you took it. If you never saw that debit, record the rollback and answer 2xx anyway, so a debit that arrives late is refused.
Round lifecycle
debiting -> active -> crediting -> closed
| \-> (no answer) retried every minute, backing off
|-> rejected (your wallet said no)
\-> rolling_back -> rolled_back (your wallet didn't answer the debit)
failed = you definitely refused a credit or rollback; staff follow up in the back office
The outcome is drawn only after your wallet accepts the debit. A round with a win stays active while the game shows it, then the game ends it and we credit you. If the player leaves, the next time they open the game it resumes the round; if they never return, we close and pay it after 60 minutes.
Each casino has a maximum win per round, as a multiple of the bet (10,000x unless agreed otherwise). Wins above it are capped and the round is flagged.
Game client API
For front-end developers. The game reads sessionID and rgs_url from its URL and calls these with POST and a JSON body that includes sessionID. Use our small SDK (/static/rgs-client.js, included in the sample game) rather than calling them by hand.
Balance, bet levels, modes with their cost and RTP, any unfinished round to resume (with its events and last progress), free rounds and the current seed pair hash.
{ "sessionID": "ses_…", "amount": "1.000000", "mode": "base" } // or "freeRound": true
-> { "balance": "999.000000", "round": { "roundID": "rnd_…", "payoutMultiplier": 250, "win": "2.500000",
"active": true, "events": [ … the book's events … ], "fairness": { … } } }
payoutMultiplier is in hundredths of the bet (250 means 2.5x). Animate the events, then:
Pays the win. Losing rounds are closed by /play already.
Save progress inside a long round (for example "freespin:4"), so a resumed round can skip ahead.
Rotates the seed pair: reveals the old server seed, optionally sets a new clientSeed, and starts the nonce at 0. Refused while a round is unfinished.
Replay data for a signed replay link (no session needed). The game opens in replay mode when its URL has replay=1.
Math package
A zip with an index.json, and a lookup table and a books file for each bet mode. The math SDK in the sevenstudios-rgs repository (math-sdk/) builds this for you.
index.json
{ "modes": [
{ "name": "base", "cost": 1, "lookup": "lookup_base.csv", "books": "books_base.jsonl" },
{ "name": "bonus", "cost": 100, "lookup": "lookup_bonus.csv", "books": "books_bonus.jsonl" } ] }
lookup_base.csv (id, weight, payoutMultiplier; weights are whole numbers)
1,1503,0
2,120,250
books_base.jsonl (one book per line; payoutMultiplier must match the lookup)
{"id":2,"payoutMultiplier":250,"events":[{"type":"reveal","board":[…]},{"type":"win","lines":[…]}]}
RTP per mode = sum(weight × payoutMultiplier) ÷ sum(weight) ÷ 100 ÷ cost. The back office recomputes it from the stored table when you submit, spot-checks books against it, and fingerprints the tables (SHA-256), so what is certified is exactly what is served. Event shapes are up to the game: the RGS passes them through untouched.
Front end package
A zip of a static build with index.html at its root (or inside one top-level folder). It is served from https://rgs-cdn.sevenstudios.io/v/<version>/, a separate hostname from the back office, and may be framed by any casino. Use relative paths for assets. It may only call the RGS over the network.
Query parameters the game gets: sessionID, rgs_url (the RGS host, without https://), lang, device and currency. Replay links add replay=true with game, version, mode, event and amount, plus roundID and sig for our SDK.
Games built for Stake Engine
A game made with Stake Engine's math SDK and front-end SDK can be submitted here without changes.
- Math: upload the contents of the math SDK's publish folder as a zip. The uploader reads its
index.json(modes witheventsandweightsfiles), zstd-compressed.jsonl.zstbooks and header-less lookup tables. Lookup weights larger than we can draw from exactly are scaled down proportionally; the uploader shows the RTP in the file and the RTP as served. - Front end: zip the static build. Games call the RGS at
https://<rgs_url>with the same endpoints they use on Stake Engine:/wallet/authenticate,/wallet/balance,/wallet/play,/wallet/end-round,/bet/eventandGET /bet/replay/{game}/{version}/{mode}/{event}. - Amounts on those endpoints are whole numbers where 1,000,000 is 1.00 of the player's currency, and a round's
payoutMultiplieris a plain multiple of the bet. Errors come back as{"error": "ERR_…", "message": "…"}. - Everything else works as for our own games: casinos' wallets, provably fair seeds, free rounds, replays, reports and the review process.
Stake Engine is a trademark of its owner. This RGS is not affiliated with or endorsed by Stake Engine; compatibility is offered so studios can reuse their builds.
Provably fair
Each player has a seed pair: a server seed (32 bytes from the platform CSPRNG) whose SHA-256 hash is shown before play, a client seed the player can change, and a nonce that counts their rounds. The draw is described on the verify page, which checks any round in the browser. The lookup tables are public at /api/v1/fair/lookup/<version>/<mode> for this reason.
Currencies
Amounts are decimal strings with up to the currency's decimals: BTC, ETH and LTC use 8, USDT and USDC 6, USD and EUR 2. Bets must be one of the currency's bet levels (returned by /authenticate). Ask us to add a currency or change levels.