API reference

Generated from the OpenAPI document the game server enforces, so it describes exactly what the server does. Download it as OpenAPI 3.1 JSON or send live requests in the playground.

Base URL https://gm.ghostagg.com

Operator API

You call these, from your server, with Authorization: Bearer mk_…

GET/operator/gamesBearer key

The catalogue a lobby is built from

200Enabled games with modes, cost multipliers and declared RTP.
gamesobject[]required
401Missing or unknown API key.
Request
curl -s "$GHOSTAGG_API/operator/games" \
  -H "Authorization: Bearer $GHOSTAGG_KEY"
Response 200
{
  "games": [
    {
      "gameId": "bigger-bass-bonanza",
      "gameVersion": 1,
      "title": "Bigger Bass Bonanza",
      "thumbnailUrl": "string",
      "provider": {
        "id": "string",
        "title": "Bigger Bass Bonanza"
      },
      "modes": [
        {
          "name": "base",
          "costMultiplier": 1,
          "rtp": 0.965
        }
      ]
    }
  ]
}
POST/operator/sessionsBearer key

Mint a session for a player launch

Request body
gameIdstringrequired

min length 1

tokenstringrequired

The operator's own session token. Kept server-side; wallet calls carry it back — it never appears in a game URL.

min length 1

playerRefstringrequired

Opaque player reference, never an identity.

min length 1

clientSeedstring

The player's client seed, fixed for the life of the session. Omitted or empty means a weaker proof, and that is the operator’s to explain.

max length 64

device"desktop" | "mobile"

Presentation platform selected by the operator for this browser session.

currencystring

The operator ledger rail selected for this launch.

pattern ^[A-Z][A-Z0-9]{2,7}$

maxBetstring

Maximum total debit in Munja micro-units (1 currency unit = 1,000,000).

pattern ^\d+$

200Munja's sessionID, the epoch commitment, and the launch parameters.
sessionIDstring (uuid)required

Munja's session token — what the game URL carries.

fairnessobjectrequired

The epoch commitment and exact maths artefact digests, available before the game loads.

fairness.scheme"munja-hmac-sha256-v1"required
fairness.serverSeedHashstringrequired

pattern ^[0-9a-f]{64}$

fairness.gameVersionintegerrequired

> 0

fairness.setIdstring (uuid)required
fairness.verifier"/verify"required
fairness.mathVerifierstringrequired
fairness.mathManifestSha256string

pattern ^[0-9a-f]{64}$

fairness.artifactRevisionstring

pattern ^[0-9a-f]{64}$

fairness.modesobjectrequired
launchstringrequired

Query parameters for the game bundle (ADR-0006 launch shape).

400Invalid request.
401Missing or unknown API key.
402The operator's invoice is unpaid seven days past due, or its plan has ended. Only minting is refused: running sessions keep playing.
404Unknown or disabled game.
Request
curl -s -X POST "$GHOSTAGG_API/operator/sessions" \
  -H "Authorization: Bearer $GHOSTAGG_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "gameId": "bigger-bass-bonanza",
    "token": "your-session-token",
    "playerRef": "player-4711",
    "clientSeed": "player-chosen-seed",
    "device": "desktop",
    "currency": "USD",
    "maxBet": "250"
  }'
Response 200
{
  "sessionID": "3f56b3d0-d5f5-47a3-a71e-1dfe0048dd63",
  "fairness": {
    "scheme": "munja-hmac-sha256-v1",
    "serverSeedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "gameVersion": 1,
    "setId": "3f56b3d0-d5f5-47a3-a71e-1dfe0048dd63",
    "verifier": "/verify",
    "mathVerifier": "string",
    "mathManifestSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "artifactRevision": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "modes": {}
  },
  "launch": "string"
}

Wallet API

Your server implements these under your wallet base URL; ghostagg calls them, signed. See the Wallet API guide for signatures and settlement.

POST/authenticateYou implement · signed by ghostagg

validate a session, return the player

Request body
tokenstringrequired

The operator session token from minting.

200The session is valid.
settlementCapabilitiesstring[]
tokenstringrequired
playerRefstringrequired
gameIdstringrequired
balanceobjectrequired
balance.amountintegerrequired
balance.currencystringrequired
clientSeedstringrequired
displayobject

Bet levels for display only — munja never enforces them (ADR-0001).

display.betLevelsnumber[]required
display.defaultBetLevelnumberrequired
display.minBetnumberrequired
display.maxBetnumberrequired
display.stepBetnumberrequired
defaultRefusal with a wallet StatusCode.
Request from ghostagg
POST https://your-casino.example/wallet/authenticate
x-munja-timestamp: 1790000000000
x-munja-signature: 9f1c…

{
  "token": "your-session-token"
}
Response 200
{
  "settlementCapabilities": [
    "string"
  ],
  "token": "your-session-token",
  "playerRef": "player-4711",
  "gameId": "bigger-bass-bonanza",
  "balance": {
    "amount": 2500000,
    "currency": "USD"
  },
  "clientSeed": "player-chosen-seed",
  "display": {
    "betLevels": [
      1
    ],
    "defaultBetLevel": 1,
    "minBet": 1,
    "maxBet": 1,
    "stepBet": 1
  }
}
POST/debitYou implement · signed by ghostagg

take the stake (idempotent per roundId)

Request body
tokenstringrequired
roundIdstringrequired

Idempotency key for every settlement call of this round.

amountintegerrequired

Wire micro-units: 1_000_000 = one unit.

currencystringrequired
200The balance after the debit (or after the earlier identical one).
amountintegerrequired
currencystringrequired
defaultRefusal — ERR_IPB for insufficient funds.
Request from ghostagg
POST https://your-casino.example/wallet/debit
x-munja-timestamp: 1790000000000
x-munja-signature: 9f1c…

{
  "token": "your-session-token",
  "roundId": "r_8f2c1e",
  "amount": 2500000,
  "currency": "USD"
}
Response 200
{
  "amount": 2500000,
  "currency": "USD"
}
POST/creditYou implement · signed by ghostagg

pay the win (idempotent per roundId)

Request body
tokenstringrequired
roundIdstringrequired
payoutMultiplierstringrequired

Integer hundredths of the BASE stake, as a decimal string.

costX100stringrequired

Mode cost in hundredths. payout = debited × payoutMultiplier / costX100, floored.

200The payout and the balance after it.
payoutintegerrequired
balanceobjectrequired
balance.amountintegerrequired
balance.currencystringrequired
defaultRefusal with a wallet StatusCode.
Request from ghostagg
POST https://your-casino.example/wallet/credit
x-munja-timestamp: 1790000000000
x-munja-signature: 9f1c…

{
  "token": "your-session-token",
  "roundId": "r_8f2c1e",
  "payoutMultiplier": "string",
  "costX100": "string"
}
Response 200
{
  "payout": 2500000,
  "balance": {
    "amount": 2500000,
    "currency": "USD"
  }
}
POST/credit-rationalYou implement · signed by ghostagg

settle exact rational payout terms

Request body
tokenstringrequired
roundIdstringrequired
payoutMultiplierstringrequired

Integer hundredths of the BASE stake, as a decimal string.

costX100stringrequired

Mode cost in hundredths. payout = debited × payoutMultiplier / costX100, floored.

payoutDenominatorstringrequired

pattern ^[1-9][0-9]*$

200The original payout and balance.
payoutintegerrequired
balanceobjectrequired
balance.amountintegerrequired
balance.currencystringrequired
defaultRefusal with a wallet StatusCode.
Request from ghostagg
POST https://your-casino.example/wallet/credit-rational
x-munja-timestamp: 1790000000000
x-munja-signature: 9f1c…

{
  "token": "your-session-token",
  "roundId": "r_8f2c1e",
  "payoutMultiplier": "string",
  "costX100": "string",
  "payoutDenominator": "string"
}
Response 200
{
  "payout": 2500000,
  "balance": {
    "amount": 2500000,
    "currency": "USD"
  }
}
POST/rollbackYou implement · signed by ghostagg

refund a debit that never became a round

Request body
tokenstringrequired
roundIdstringrequired
200The balance after the refund (idempotent).
amountintegerrequired
currencystringrequired
defaultRefusal with a wallet StatusCode.
Request from ghostagg
POST https://your-casino.example/wallet/rollback
x-munja-timestamp: 1790000000000
x-munja-signature: 9f1c…

{
  "token": "your-session-token",
  "roundId": "r_8f2c1e"
}
Response 200
{
  "amount": 2500000,
  "currency": "USD"
}