Skip to content
Genesis v2.0 and Soteria v7.0 are here. Read the announcement
  • Macros
  • Attributes
  • Obfuscate API
  • Generating Keys with API
  • Editing Keys with API
  • Using the Oracle SDK
  • Setup
  • Commands

Guides

Obfuscate API

Use the Soteria REST API to obfuscate Lua scripts programmatically.

Endpoint

POST https://soteria.rip/api/obfuscate

Send 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"
}
FieldTypeRequiredDescription
codestringYesThe Lua script to obfuscate.
argsobjectNoObfuscation settings. All fields are optional and will fall back to their defaults if omitted.
payWithstringNoWhich 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.

FieldTypeDefaultDescription
targetstring"Roblox"The obfuscation target environment. Accepted values: "Roblox", "Studio", "Luau".
compression-loaderbooleanfalseWraps the output in a compressed loader to decrease file size. Requires loadstring to be available.
compatibility-modebooleanfalseGives up stronger security to improve support for lower-fidelity executors such as Xeno. Only available when target is "Roblox".
custom-errorbooleantrueEnables Soteria's Custom Error Handler, which results in slightly larger output but helps debug issues in your input.
optimization-levelnumber3Controls the level of optimization applied. Range: 1–3, where 3 is maximum optimization.
flow-complexitynumber1Controls the complexity of control flow obfuscation. Range: 1–3, where higher values produce more complex flow.
nodestring"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
}
FieldTypeDescription
codestringThe obfuscated Lua script.
tokensnumberRemaining tokens on your account after this request.
obfuscationsnumberRemaining 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.

AttributesGenerating Keys with API
SoteriaSoteria

Secure your Luau scripts and accelerate your developer experience.

Products

  • Oracle
  • Genesis

Tools

  • Script Library
  • DevEx Converter
  • FFlags Directory

Docs & Support

  • Documentation
  • Roblox Status
  • Error Codes
  • Runtimes

Company

  • About
  • Blog
  • Discord
  • Contact

Legal

  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Acceptable Use

© 2026 Soteria. All rights reserved.

SoteriaSoteria
Pricing
Get Started