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.
Integration checklist
What a casino does to go live, in order. Most teams finish in a few days.
- Get your keys. We send an API key and a secret over a secure channel.
- Check your signing. Call
POST /api/v1/operator/ping. A200with your casino's name means your key, clock and signature are right. - Build the wallet API (below):
/authenticate,/balance,/debit,/credit,/rollback. Treat transaction ids as idempotency keys. - List games with
/gamesand bet levels with/currencies. Useimagesfor your lobby anddemo_urlfor "try for fun". - Open a session with
/sessions, passingdevice,language,lobby_urlanddeposit_url, and loadlaunch_urlin an iframe. - Play real rounds on staging, including a failed credit (we retry) and a slow debit (we roll it back). Your balances should match our
/roundsto the unit. - Go live. Tell us your production wallet address; we switch it and publish the games you want.
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-test.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-test.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.
Checks your key and signature and returns { "ok": true, "operator": "…", "server_time": "…" }. Use it first, and as a health check.
The live games published to your casino, with their bet modes, RTP, max win, profile text, images (cover, banner, screenshots), the public page_url and a demo_url that opens the game in fun mode with no player needed (add ?currency=, &lang= and &device=mobile if you like).
The currencies you can use, with decimals, min_bet, max_bet, default_bet and the allowed bet_levels, plus your max_win_x (wins above it are paid at the cap).
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",
"device": "mobile", "lobby_url": "https://casino.example/lobby", "deposit_url": "https://casino.example/cashier" }
-> { "session_id": "ses_…", "launch_url": "https://rgs-test-cdn.sevenstudios.io/v/ver_…/index.html?sessionID=…", "currency": "BTC", "balance": "0.01234500" }
device is desktop or mobile. lobby_url and deposit_url (https) are where the game's Lobby and Deposit buttons go; the game also posts { "type": "rgs:lobby" } or { "type": "rgs:deposit" } to your page, and { "type": "rgs:balance", "balance": "…" } after each round, so you can handle them yourself.
Load launch_url in an iframe or a new window. A real-money session ends after 30 minutes without play or 24 hours after it was opened, whichever comes first (a leaked link soon stops working); open a new one when the player comes back. Fun-mode sessions last 24 hours.
Limits: 600 requests per 10 seconds per API key, and 300 per 10 seconds per game session. Over that you get 429 with RATE_LIMITED; wait a few seconds and retry.
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-test-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 with other SDKs
Many slot games are built with a math SDK that publishes pre-simulated rounds ("books") and weighted lookup tables, and a front end that talks to /wallet/… endpoints. Games built that way can usually be submitted here without changes.
- Math: upload the contents of the publish folder (as a zip, a folder or the files themselves). 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: upload the static build. Games call the RGS at
https://<rgs_url>on these endpoints:/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.
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 (decimals in /currencies: 8 for most crypto, 6 for USDT and USDC, the usual minor units for other currencies). Wallet balances with more decimals than that (ETH has 18) are fine: the extra digits are rounded down. Each currency also has display: its symbol, how many decimals to show players and whether the symbol goes before or after the amount.
Bets must be one of the currency's bet levels (returned by /authenticate and /currencies). For most currencies these are 0.10, 0.20, 0.50, 1, 2, 5 … 1,000 USD converted at the live price and rounded to tidy amounts; they're updated when the price moves more than 20%, and the previous levels keep working. Sweepstakes coins (XGC, XSC, XEC, XRC, WRW) have fixed levels.