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:
| Language | File / package | Dependencies |
|---|---|---|
| C++17 | santiauth-cpp.zip (santiauth.hpp, santiauth.cpp) | libcurl, libsodium, nlohmann/json |
| C# (.NET 6+) | SantiAuth.cs | BouncyCastle.Cryptography |
| Python 3.8+ | santiauth.py | requests, cryptography |
| Node.js 18+ | santiauth.mjs | None (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
| Threat | Protection |
|---|---|
Fake server, hosts override, proxy rewriting JSON | Every response is signed with SantiAuth's private Ed25519 key; tampering fails verification (BAD_SIGNATURE). |
| Replaying a recorded valid response | Client 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 service | Keys are scoped to service_id (KEY_NOT_FOUND). |
| Brute-force or replayed requests | Nonces are single-use (REPLAY) and requests are rate-limited per IP. |
| Key sharing across machines | HWID binding with per-key device limits (HWID_MISMATCH). |
| Key revoked while the app is already open | Periodic /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:
| Field | Type | Description |
|---|---|---|
service_id | integer | Your numeric service ID. |
nonce | string | 16–64 chars ([A-Za-z0-9_-]), freshly generated from a CSPRNG per request. |
timestamp | integer | Client Unix timestamp in milliseconds (allowed skew: ±5 minutes). |
Signed response envelope
Valid requests return HTTP 200:
{
"payload": "{\"endpoint\":\"validate\",\"success\":true,\"code\":\"OK\",...}",
"signature": "<128 hex chars>",
"key_id": "n1"
}Verify in this exact order:
- Verify
Ed25519(publicKey, utf8("SANTIAUTH-NATIVE-V1\n" + payload), hex(signature))over the raw bytes ofpayloadwithout re-serializing JSON. - Parse
payloadand verifyendpoint,service_id,noncematch your request and|server_time - now| <= 5 min. - Act on
successandcode.
Non-200 HTTP statuses: 400 (malformed body, unsigned), 429 (rate-limited), 503 (native API not configured).
Endpoints
| Endpoint | Extra request fields | Response payload on success |
|---|---|---|
GET /public-key | — | algorithm (ed25519), key_id, public_key (64 hex), signature_context (SANTIAUTH-NATIVE-V1\n). |
POST /init | Common fields only | service: { id, name }, get_key_url. |
POST /validate | key (≤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 /check | key, 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
| Code | Meaning |
|---|---|
OK | Key or session is valid. |
KEY_NOT_FOUND | Key does not exist in this service. |
KEY_DISABLED | Key has been revoked or disabled. |
KEY_EXPIRED | Key lifetime has ended. |
KEY_USED | One-time key was already consumed. |
HWID_MISMATCH | Key is bound to another device (or max devices reached). |
BANNED | User or device is banned in this service. |
PREMIUM_REQUIRED | Service requires a Premium key. |
SESSION_EXPIRED, SESSION_INVALID | Session token expired or invalid — re-run /validate. |
SERVICE_NOT_FOUND | Invalid service_id. |
TIME_SKEW | Client clock differs from server time by more than 5 minutes. |
REPLAY | Nonce was already used. |
Local SDK error codes: NETWORK_ERROR, BAD_SIGNATURE, BAD_RESPONSE, RATE_LIMITED, NOT_CONFIGURED, BAD_REQUEST, NOT_VALIDATED.