Guides
Obfuscate API
Use the Soteria REST API to obfuscate Lua scripts programmatically.
Endpoint
POST https://soteria.rip/api/obfuscateSend your Lua script as a JSON request with the code as a string under the code field, and your API key in the x-api-key header.
Request Body
{
"code": "-- your lua source...",
"args": {
"target": "Roblox",
"compression-loader": false,
"compatibility-mode": false,
"custom-error": true,
"optimization-level": 3,
"flow-complexity": 1,
"node": "main"
},
"payWith": "quota"
}| Field | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | The Lua script to obfuscate. |
| args | object | No | Obfuscation settings. All fields are optional and will fall back to their defaults if omitted. |
| payWith | string | No | Which balance to deduct from. Accepted values: "quota" (membership obfuscations), "tokens". Defaults to "quota" if you have an active membership, otherwise "tokens". |
Args Fields
All fields within args are optional.
| Field | Type | Default | Description |
|---|---|---|---|
| target | string | "Roblox" | The obfuscation target environment. Accepted values: "Roblox", "Studio", "Luau". |
| compression-loader | boolean | false | Wraps the output in a compressed loader to decrease file size. Requires loadstring to be available. |
| compatibility-mode | boolean | false | Gives up stronger security to improve support for lower-fidelity executors such as Xeno. Only available when target is "Roblox". |
| custom-error | boolean | true | Enables Soteria's Custom Error Handler, which results in slightly larger output but helps debug issues in your input. |
| optimization-level | number | 3 | Controls the level of optimization applied. Range: 1–3, where 3 is maximum optimization. |
| flow-complexity | number | 1 | Controls the complexity of control flow obfuscation. Range: 1–3, where higher values produce more complex flow. |
| node | string | "main" | Selects which obfuscator node to use. Accepted values: "main", "beta". Beta may have newer features but can be less stable. |
Response
{
"code": "-- obfuscated lua source...",
"tokens": 9842,
"obfuscations": 247
}| Field | Type | Description |
|---|---|---|
| code | string | The obfuscated Lua script. |
| tokens | number | Remaining tokens on your account after this request. |
| obfuscations | number | Remaining obfuscations on your membership after this request. 0 if you have no active membership. |
Examples
async function obfuscate(script, apiKey) {
const res = await fetch("https://soteria.rip/api/obfuscate", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": apiKey,
},
body: JSON.stringify({ code: script }),
});
if (!res.ok) {
throw new Error(`Request failed: ${res.status} ${res.statusText}`);
}
const data = await res.json();
console.log("Tokens remaining:", data.tokens);
return data.code;
}
const script = `print("Hello, World!")`;
obfuscate(script, "YOUR_API_KEY").then((code) => {
console.log(code);
});API Key Management
Getting your API key: Navigate to Settings → API Keys. Your key is shown there. If you haven't generated one yet, click Generate.
Regenerating a leaked key: If your API key is ever exposed, go to Settings → API Keys and click Generate New. Your old key is immediately invalidated. Note that you can only generate a new key once per minute.
Rate limits: API key generation is limited to once per minute. Script obfuscation requests are subject to your account's token balance, each request deducts one token or one membership obfuscation per request, depending on your payWith setting.

