Πύλη προγραμματιστών

Πύλη προγραμματιστών / Τεκμηρίωση API

Τεχνική τεκμηρίωση στα αγγλικά

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):

HostExample (production)Serves
API hostapi.spilvon.comthe signed Operator API, /api/v1/operator/* (your servers)
games hostgames.spilvon.comgame 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:

Text
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 ) )
  • METHOD is upper case. path_and_query is 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_body is the exact UTF-8 bytes you send; the empty string for GET.
  • 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_LIMITED with Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining. More than 60 failed authentications per minute from one IP also yield 429 RATE_LIMITED.
  • Body size: 16 KiB, except POST /api/v1/operator/free-rounds and POST /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" }. Quote request_id when contacting support.
  • Timestamps: the rounds endpoint uses epoch milliseconds; the free-rounds endpoints use ISO 8601 UTC strings.

Browse endpoints · Download YAML