WGG Encryptor API
Encrypt .lua files to .wgg format programmatically via our REST API.
Public API
The WGG Encryptor API allows you to encrypt Lua scripts into the proprietary .wgg format using AES-256-CBC encryption. Files are processed server-side and encrypted data is returned as base64-encoded strings. No files are stored on the server after encryption.
Endpoint
POST /api/v1/encrypt
Request
Content-Type: multipart/form-data
| Field | Type | Description |
|---|---|---|
files | File[] | One or more .lua files to encrypt |
Constraints
- Only
.luafiles are accepted - Maximum file size: 5 MB per file
- Maximum 20 files per request
Success Response (200)
{
"files": [
{
"name": "script.wgg",
"data": "base64_encoded_encrypted_data...",
"size": 256
}
]
}Response Fields
| Field | Type | Description |
|---|---|---|
name | string | Encrypted filename (.wgg extension) |
data | string | Base64-encoded encrypted file content |
size | number | Size of encrypted data in bytes |
Code Examples
curl -X POST \ -F "files=@script.lua" \ -F "files=@another.lua" \ https://your-domain.com/api/v1/encrypt
Rate Limits
Requests are rate-limited per IP address.
| Limit | Value |
|---|---|
| Requests per minute | 60 |
Rate Limit Response Headers
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests per window |
X-RateLimit-Remaining | Remaining requests in current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
Retry-After | Seconds to wait (only on 429 responses) |
Error Reference
| Status | Code | Description |
|---|---|---|
| 400 | NO_FILES | No files were provided in the request |
| 400 | INVALID_FILE_TYPE | A file does not have a .lua extension |
| 400 | FILE_TOO_LARGE | A file exceeds the 5 MB size limit |
| 400 | TOO_MANY_FILES | More than 20 files in a single request |
| 429 | RATE_LIMITED | Too many requests — try again later |
| 500 | ENCRYPTION_ERROR | Server-side encryption failure |
Error Response Format
{
"error": "Human-readable error message",
"code": "ERROR_CODE"
}