OPENAPI / v1.4.0
SPILVON Operator API
The Operator API is the half of a SPILVON integration that you call. The other half, the Wallet API that SPILVON calls on your servers, is specified in wallet-api.yaml.
This specification is derived from the server code (rgs/src/operator-api.ts, rgs/src/free-rounds-api.ts, rgs/src/jackpot-api.ts, rgs/src/sandbox-wallet-proxy.ts, rgs/src/host-policy.ts, rgs/src/index.ts, shared/signing.ts, shared/http.ts) as of 2026-12-01. test/unit/openapi-operator-api.test.ts checks that every operator route in the code is described here (and nothing else under /api/v1/operator/), and that every error code those routes return is in ErrorResponse. Where the prose guide (docs/operator-integration.md) and this file disagree, the code is authoritative; please report the difference.
Two hosts
Each environment has two public host names, and each answers only its own surface (421 WRONG_HOST naming the right host otherwise):
| Host | Example (production) | Serves |
|---|---|---|
| API host | api.spilvon.com | the signed Operator API, /api/v1/operator/* (your servers) |
| games host | games.spilvon.com | game pages (launch_url, /play/*), the game client API, static game files, round pages (players' browsers) |
| both | /healthz, /.well-known/spilvon-wallet-keys.json, /api/v1/public/* |
The servers below are the API host; the operations served elsewhere name their own servers. Local development uses one host for everything.
Signing every request
Every /api/v1/operator/* request carries three headers:
X-Spilvon-Operator: <operator id, op_ + 32 hex>
X-Spilvon-Timestamp: <unix time in milliseconds, exactly 13 digits>
X-Spilvon-Signature: lowercase_hex( HMAC-SHA256( api_secret, timestamp + "." + METHOD + "." + path_and_query + "." + raw_body ) )METHODis upper case.path_and_queryis the request path plus the query string exactly as sent (for example/api/v1/operator/reports/daily?from=2026-12-01&to=2026-12-31). The host is not signed.raw_bodyis the exact UTF-8 bytes you send; the empty string forGET.- The server rejects a timestamp more than 300 seconds from its clock (
TIMESTAMP_OUT_OF_RANGE). - Each signature is accepted once (
REPLAYED_REQUEST). To retry, sign again with a fresh timestamp. - Test vectors:
docs/signature-test-vectors.json.
Requests to the Operator API are always signed with HMAC and your API secret. (Ed25519 is available only for the opposite direction, SPILVON → your wallet; see wallet-api.yaml.)
Other server-side controls
- IP allowlist (optional, per operator, IPv4/IPv6 addresses or CIDR). Checked after the signature:
403 IP_NOT_ALLOWED. - Rate limit: 3,000 requests per minute per operator unless agreed otherwise;
429 RATE_LIMITEDwithRetry-After,X-RateLimit-Limit,X-RateLimit-Remaining. More than 60 failed authentications per minute from one IP also yield429 RATE_LIMITED. - Body size: 16 KiB, except
POST /api/v1/operator/free-roundsandPOST /api/v1/operator/jackpot-network/bets/batch(64 KiB):413 BODY_TOO_LARGE.
Conventions
- Amounts are decimal strings in the currency's precision (
"12.50","0.00010000"), never JSON numbers. Decimals: 2 for USD/EUR/GBP/TRY and uBTC/uETH/uLTC, 5 for mBTC/mETH/mLTC, 6 for USDT/USDC/TRX, 8 for BTC/ETH/LTC/SOL/DOGE. - Ids are prefixed:
op_operator,ses_session,rnd_round,tx_transaction,fra_free-round award,jp_jackpot pool,jpw_jackpot prize, each followed by 32 lowercase hex characters. - Errors always have the shape
{ "error": { "code", "message" }, "request_id" }. Quoterequest_idwhen contacting support. - Timestamps: the rounds endpoint uses epoch milliseconds; the free-rounds endpoints use ISO 8601 UTC strings.