> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinematic.run/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> These are the customer docs for kinematic, a name written in lowercase except at the start of a sentence. Kinematic provides provably fair casino games, served to a casino's site by a game server: a Cloudflare Worker that the kinematic dashboard deploys into the casino's own Cloudflare account.
> Never put SESSION_SECRET or WALLET_SECRET in code, prompts, logs, commits or chat. Read them from environment variables and ask the person you work with to set them. The dashboard's Integration page shows each secret once.
> Values such as lucky-star, luckystar.example, og-rgs-lucky-star.luckystar.workers.dev, games.luckystar.example and player_48213 are examples. Use the casino's own casino ID, game server origin, element tag, session issuer and currencies: the Instructions for your coding agent on the dashboard's Integration page hold them, or ask the person you work with.
> To debug, start at https://docs.kinematic.run/troubleshooting and https://docs.kinematic.run/reference/errors. The wallet contract is at https://docs.kinematic.run/api/wallet.openapi.yaml.
> Sandbox bets are recorded on Solana devnet. Live game servers record nothing on Solana until the audited mainnet program is deployed.

# Your game server

> Your game server is one Worker in your own Cloudflare account, with its settings from the dashboard, public routes, reports and automatic updates.

Your game server is one Cloudflare Worker in your own Cloudflare account. The dashboard deploys it through Cloudflare's API with the access you grant when you connect Cloudflare. Its code is a release that kinematic builds; your settings come from the dashboard.

## What you see in Cloudflare

* A Worker named `og-rgs-<casino ID>` unless you chose another name, for example `og-rgs-lucky-star`.
* Its address: `https://og-rgs-lucky-star.<your subdomain>.workers.dev`, or a hostname of your own.
* Its Durable Objects, which hold each player's bets, the sandbox test balances, your VRF keys and the game server's Solana key.
* Its variables and secrets, which the dashboard sets on every deploy.

Your game server runs and stores its data in your account, under your agreement with Cloudflare and at your cost.

> [!WARNING]
>
> Change your game server's settings in the dashboard, not in Cloudflare. Each deploy from the dashboard replaces the Worker's code, variables and secrets. Deleting the Worker or its Durable Objects deletes your players' bet records and your VRF keys.

## Settings without redeploying

The dashboard signs your settings: allowed origins, session issuer, wallet URL, currencies and limits, games, return to player, appearance and whether new bets are allowed. Your game server checks the signature, applies them and keeps the last good settings. It fetches them about once a minute, and at once when you save.

Your game server refuses settings it must not apply and keeps serving with its last good ones. On the **Game server** page, its card notes the refusal and **Check now** gives the reason. It refuses:

* settings for the other mode, until you redeploy the game server in that mode;
* a new decimal scale for a currency it already serves, because balances and receipts stay in the scale they were made in.

## Routes

| Route | Who calls it |
| - | - |
| `GET /health` | Anyone. Reports the service (`og-rgs`), the rules ID, the mode (`sandbox`, or `operator` for live), whether new bets are allowed, the release, the settings revision and the Solana record's state. |
| `GET /v1/catalog` | Anyone. Your payout tables, your currency's scale and limits, your VRF keys and the release. Add `?currency=` when you serve several currencies. |
| `GET /element/v1/loader.js` | Your pages. The element, with your games and theme. Only allowed origins can load it. |
| `/v1/stream`, `/v1/commands` | The element, with a session token. Bets, actions and balances. |
| `/v1/history`, `/v1/evidence/<bet ID>`, `/v1/math` | The element, with a session token. The player's rounds and proofs. |
| `POST /v1/wallet-events` | Your backend, signed with `WALLET_SECRET`. Tells the game server a balance changed outside the games. |
| `/v1/ops/...` | The dashboard, signed with a key only the dashboard holds. Status, settings refresh, the live feed and Solana registration. |

`GET /health` is the address to watch from your own monitoring:

```bash theme={null}
curl -s https://games.luckystar.example/health
```

```json theme={null}
{"service":"og-rgs","rules":"og-v1-h512","mode":"sandbox","enabled":true,"release":"…","control":{"revision":12,"issuedAt":1793629805120},"chain":{"network":"devnet","paused":null,"…":"…"}}
```

## What it reports

Every 60 seconds your game server posts counts to the dashboard: bets, settled rounds, refusals and errors by code, wallet round trips, the newest errors, the Solana record's state, and totals wagered and paid by game and currency. The reports carry no player names or player IDs. Kinematic keeps them for 30 days.

The dashboard's **Live** page reads the newest bets from your game server's memory while you watch it. Kinematic stores no individual bets: each bet's records stay in your game server.

## Updates

New releases deploy to your game server automatically: the dashboard checks every 5 minutes and updates each deployed game server that has **Update automatically** on, in the mode it already runs, so an automatic update never switches modes. You can turn automatic updates off for a game server on the **Game server** page, and update it yourself with **Update to** and the release. A failed automatic update to the same release is retried after an hour.

## Solana address

When it records bets, your game server generates its own Solana key and keeps it in its storage. That address signs and pays for every record and registers your VRF keys on chain. Kinematic keeps the address funded: you never fund it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.