Native SDK & API

Validate SantiAuth keys from C++, C#, Python, Node.js or any non-Luau application using Ed25519-signed HTTPS responses.

On this page

If you are protecting a desktop app, external loader, CLI tool or bot outside Roblox, use the Native API (/api/native/v1) instead of the Luau key library. Every server response is signed with Ed25519 so proxies, hosts overrides or fake servers cannot forge a valid response.

Official SDKs

Download ready-to-use files with your Service ID and platform public key pre-filled from Service → SDK & API in the dashboard:

LanguageFile / packageDependencies
C++17santiauth-cpp.zip (santiauth.hpp, santiauth.cpp)libcurl, libsodium, nlohmann/json
C# (.NET 6+)SantiAuth.csBouncyCastle.Cryptography
Python 3.8+santiauth.pyrequests, cryptography
Node.js 18+santiauth.mjsNone (uses built-in fetch and node:crypto)

Quickstart

Copy your serviceId and publicKeyHex (64 hex chars) from Service → SDK & API (or GET https://api.santiauth.com/api/native/v1/public-key during development):

#include <santiauth/santiauth.hpp>
#include <iostream>

int main() {
    santiauth::Config cfg;
    cfg.serviceId = 42;
    cfg.publicKeyHex = "PASTE_64_HEX_PUBLIC_KEY";
    cfg.appName = "MyTool";
    santiauth::Client auth(cfg);

    auto service = auth.init();          // service.name, service.getKeyUrl
    std::string key;
    std::cout << "Key (empty = get one): ";
    std::getline(std::cin, key);
    if (key.empty()) { auth.openGetKeyPage(); std::getline(std::cin, key); }

    auto r = auth.validateKey(key);
    if (!r.ok) {
        std::cerr << santiauth::codeName(r.code) << ": " << r.message << "\n";
        return 1;
    }

    // Re-check every 60 seconds; exits if revoked, expired or banned.
    auth.startHeartbeat(std::chrono::seconds(60), [](const santiauth::Result&) {
        std::exit(0);
    });
}

Security model

ThreatProtection
Fake server, hosts override, proxy rewriting JSONEvery response is signed with SantiAuth's private Ed25519 key; tampering fails verification (BAD_SIGNATURE).
Replaying a recorded valid responseClient sends a fresh random nonce per request; the server signs it into the payload. The SDK checks nonce, endpoint, service_id and server_time (±5 min).
Using a key from another SantiAuth serviceKeys are scoped to service_id (KEY_NOT_FOUND).
Brute-force or replayed requestsNonces are single-use (REPLAY) and requests are rate-limited per IP.
Key sharing across machinesHWID binding with per-key device limits (HWID_MISMATCH).
Key revoked while the app is already openPeriodic /check heartbeat every 1–5 minutes.

Wire protocol

Base URL: https://api.santiauth.com/api/native/v1. Request bodies are JSON with snake_case fields.

Every POST request includes:

FieldTypeDescription
service_idintegerYour numeric service ID.
noncestring16–64 chars ([A-Za-z0-9_-]), freshly generated from a CSPRNG per request.
timestampintegerClient Unix timestamp in milliseconds (allowed skew: ±5 minutes).

Signed response envelope

Valid requests return HTTP 200:

json
{
  "payload": "{\"endpoint\":\"validate\",\"success\":true,\"code\":\"OK\",...}",
  "signature": "<128 hex chars>",
  "key_id": "n1"
}

Verify in this exact order:

  1. Verify Ed25519(publicKey, utf8("SANTIAUTH-NATIVE-V1\n" + payload), hex(signature)) over the raw bytes of payload without re-serializing JSON.
  2. Parse payload and verify endpoint, service_id, nonce match your request and |server_time - now| <= 5 min.
  3. Act on success and code.

Non-200 HTTP statuses: 400 (malformed body, unsigned), 429 (rate-limited), 503 (native API not configured).

Endpoints

EndpointExtra request fieldsResponse payload on success
GET /public-key—algorithm (ed25519), key_id, public_key (64 hex), signature_context (SANTIAUTH-NATIVE-V1\n).
POST /initCommon fields onlyservice: { id, name }, get_key_url.
POST /validatekey (≤512), hwid (8–256), optional app (≤64)key: { expires_at, premium, one_time, hwid_locked }, session: { token, expires_at }. Records an execution in service analytics.
POST /checkkey, hwid, session (1-hour token from /validate)Lightweight heartbeat check without recording a new execution. On SESSION_EXPIRED, call /validate again (handled automatically by the official SDKs).

Response codes

CodeMeaning
OKKey or session is valid.
KEY_NOT_FOUNDKey does not exist in this service.
KEY_DISABLEDKey has been revoked or disabled.
KEY_EXPIREDKey lifetime has ended.
KEY_USEDOne-time key was already consumed.
HWID_MISMATCHKey is bound to another device (or max devices reached).
BANNEDUser or device is banned in this service.
PREMIUM_REQUIREDService requires a Premium key.
SESSION_EXPIRED, SESSION_INVALIDSession token expired or invalid — re-run /validate.
SERVICE_NOT_FOUNDInvalid service_id.
TIME_SKEWClient clock differs from server time by more than 5 minutes.
REPLAYNonce was already used.

Local SDK error codes: NETWORK_ERROR, BAD_SIGNATURE, BAD_RESPONSE, RATE_LIMITED, NOT_CONFIGURED, BAD_REQUEST, NOT_VALIDATED.