Skip to content

REST API Reference

Interactive API docs with request/response examples are available at http://localhost:1349/api/docs.

Machine-readable specs:

  • /api/v1/openapi.yaml - OpenAPI 3.1 spec
  • /llms.txt - LLM-friendly summary
  • /llms-full.txt - Complete LLM-friendly docs

Authentication

All endpoints require authentication unless AUTH_ENABLED=false.

Session Token

bash
# Login
curl -X POST http://localhost:1349/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"admin"}'
# Returns: {"token":"<session-token>"}

# Use token
curl http://localhost:1349/api/v1/tools/resize \
  -H "Authorization: Bearer <session-token>"

Sessions expire after 24 hours.

API Keys

bash
# Create a key (returns key once - store it)
curl -X POST http://localhost:1349/api/v1/api-keys \
  -H "Authorization: Bearer <session-token>" \
  -H "Content-Type: application/json" \
  -d '{"name":"my-script"}'
# Returns: {"key":"si_<96 hex chars>","id":"...","name":"my-script"}

# Use the key
curl http://localhost:1349/api/v1/tools/resize \
  -H "Authorization: Bearer si_<your-key>"

Keys are prefixed si_ and stored as SHA-256 hashes - the raw key is shown once and never retrievable again.

Auth Endpoints

MethodPathAccessDescription
POST/api/auth/loginPublicLogin, get session token
POST/api/auth/logoutAuthDestroy current session
GET/api/auth/sessionAuthValidate current session
POST/api/auth/change-passwordAuthChange own password (invalidates all other sessions + API keys)
GET/api/auth/usersAdminList all users
POST/api/auth/registerAdminCreate a new user
PUT/api/auth/users/:idAdminUpdate user role or team
POST/api/auth/users/:id/reset-passwordAdminReset user's password
DELETE/api/auth/users/:idAdminDelete a user

Permissions

PermissionAdminUser
Use tools
Own files/pipelines/API keys
See all users' files/pipelines/keys-
Write settings-
Manage users & teams-
Manage branding-

Using Tools

Every tool follows the same pattern:

bash
# Single file
curl -X POST http://localhost:1349/api/v1/tools/<toolId> \
  -H "Authorization: Bearer <token>" \
  -F "file=@input.jpg" \
  -F 'settings={"width":800,"height":600}'

# Batch (returns ZIP)
curl -X POST http://localhost:1349/api/v1/tools/<toolId>/batch \
  -H "Authorization: Bearer <token>" \
  -F "files=@a.jpg" \
  -F "files=@b.jpg" \
  -F 'settings={...}'
  • Upload is multipart/form-data.
  • settings is a JSON string with tool-specific options.
  • Response is the processed file directly (or a ZIP for batch).
  • Progress is tracked via SSE (see Progress Tracking).

Tools Reference

Essentials

Tool IDNameKey settings
resizeResizewidth, height, fit (cover/contain/fill/inside/outside), percentage, withoutEnlargement, plus 23 social media presets
cropCropleft, top, width, height, aspectRatio, shape (rectangle/circle/rounded)
rotateRotate & Flipangle, flip (horizontal/vertical/both), background
convertConvertformat (jpeg/png/webp/avif/tiff/gif/heif), quality
compressCompressquality (1–100), format, targetSizeKB

Optimization

Tool IDNameKey settings
optimize-for-webOptimize for Webformat (auto/jpeg/webp/avif), quality, maxWidthPx, stripMetadata
strip-metadataStrip Metadata-
edit-metadataEdit Metadatatitle, description, author, copyright, keywords, gps (lat/lon), dateTime
bulk-renameBulk Renamepattern (supports {n}, {date}, {original}), startIndex, padding
image-to-pdfImage to PDFpageSize (A4/Letter/…), orientation, margin, fitMode
faviconFavicon Generatorpadding, backgroundColor, borderRadius - generates all standard sizes

Adjustments

Tool IDNameKey settings
color-adjustmentsAdjust Colorsbrightness, contrast, exposure, saturation, temperature, sharpness, vibrance, effects (grayscale/sepia/invert/vignette)
sharpeningSharpeningmode (adaptive/unsharp/highpass), amount, radius, threshold
replace-colorReplace ColortargetColor, replacementColor, tolerance, invert

AI Tools

All AI tools run on your hardware (CPU or NVIDIA GPU). No internet required.

Tool IDNameAI ModelKey settings
remove-backgroundRemove Backgroundrembg (BiRefNet / U2-Net)model, alphaMattingForeground, alphaMattingBackground, returnMask, background color/image
upscaleImage UpscalingRealESRGANscale (2/4), model, faceEnhance, denoise, format, quality
erase-objectObject EraserLaMa (ONNX)maskData (base64 PNG), maskThreshold
ocrOCR / Text ExtractionPaddleOCR / Tesseractquality (fast/balanced/best), language, enhance
blur-facesFace / PII BlurMediaPipeblurRadius, sensitivity
smart-cropSmart CropMediaPipe + Sharpmode (subject/face/trim), width, height, facePreset (close-up/head-and-shoulders/upper-body/half-body)
image-enhancementImage EnhancementAnalysis-basedmode (auto/exposure/contrast/color/sharpness), strength
enhance-facesFace EnhancementGFPGAN / CodeFormermodel (gfpgan/codeformer), strength, sensitivity, centerFace
colorizeAI ColorizationDDColorintensity, model
noise-removalNoise RemovalTiered denoisingquality (fast/balanced/best), strength, preserveDetail, colorNoise
red-eye-removalRed Eye RemovalFace landmark + color analysissensitivity, strength
restore-photoPhoto RestorationMulti-step pipelinemode (auto/light/heavy), scratchRemoval, faceEnhancement, fidelity, denoise, denoiseStrength, colorize
passport-photoPassport PhotoMediaPipe landmarkscountry (37 countries), printLayout (4x6/A4/none), backgroundColor
content-aware-resizeContent-Aware ResizeSeam carving (caire)width, height, protectFaces, blurRadius, sobelThreshold, square

Watermark & Overlay

Tool IDNameKey settings
watermark-textText Watermarktext, font, fontSize, color, opacity, position, rotation, tile
watermark-imageImage Watermarkopacity, position, scale - second file is the watermark
text-overlayText Overlaytext, font, fontSize, color, x, y, background, padding, borderRadius
composeImage Compositionx, y, opacity, blend - second file is layered on top

Utilities

Tool IDNameKey settings
infoImage Info- (returns width, height, format, size, channels, hasAlpha, DPI, EXIF)
compareImage Comparemode (side-by-side/overlay/diff), diffThreshold - second file is the comparison target
find-duplicatesFind Duplicatesthreshold (perceptual hash distance, default 8) - multi-file
color-paletteColor Palettecount (dominant color count), format (hex/rgb)
qr-generateQR Code Generatordata, size, margin, colorDark, colorLight, errorCorrectionLevel, dotStyle, cornerStyle, logo (optional file)
barcode-readBarcode Reader- (auto-detects QR, EAN, Code128, DataMatrix, etc.)
image-to-base64Image to Base64format (data-uri/plain), mimeType

Layout & Composition

Tool IDNameKey settings
collageCollage / Gridtemplate (25+ layouts), gap, backgroundColor, borderRadius - multi-file
stitchStitch / Combinedirection (horizontal/vertical/grid), gap, backgroundColor, alignment - multi-file
splitImage Splittingmode (grid/rows/cols), rows, cols, tileWidth, tileHeight
borderBorder & Framewidth, color, style (solid/gradient/pattern), borderRadius, padding, shadow

Format & Conversion

Tool IDNameKey settings
svg-to-rasterSVG to Rasterformat (png/jpeg/webp/avif/tiff/gif/heif), width, height, scale, dpi, background
vectorizeImage to SVGcolorMode (bw/color), threshold, colorPrecision, filterSpeckle, pathMode (none/polygon/spline)
gif-toolsGIF Toolsaction (resize/optimize/reverse/speed/extract-frames/rotate/add-text), action-specific params
pdf-to-imagePDF to Imagepages (all/range), format, dpi, quality

Batch Processing

Apply any tool to multiple files at once. Returns a ZIP archive.

bash
curl -X POST http://localhost:1349/api/v1/tools/compress/batch \
  -H "Authorization: Bearer <token>" \
  -F "files=@a.jpg" \
  -F "files=@b.jpg" \
  -F "files=@c.jpg" \
  -F 'settings={"quality":80}'

Limits: up to 200 files per batch. Concurrency controlled by CONCURRENT_JOBS (default: 3).

Pipelines

Execute a pipeline

bash
# Single file
curl -X POST http://localhost:1349/api/v1/pipeline/execute \
  -H "Authorization: Bearer <token>" \
  -F "file=@input.jpg" \
  -F 'pipeline=[
    {"toolId":"resize","settings":{"width":1200}},
    {"toolId":"compress","settings":{"quality":80}},
    {"toolId":"watermark-text","settings":{"text":"© 2025"}}
  ]'

# Batch (multiple files → ZIP)
curl -X POST http://localhost:1349/api/v1/pipeline/batch \
  -H "Authorization: Bearer <token>" \
  -F "files=@a.jpg" \
  -F "files=@b.jpg" \
  -F 'pipeline=[{"toolId":"resize","settings":{"width":800}}]'

Each step's output is the next step's input. Up to 20 steps per pipeline.

Save and manage pipelines

MethodPathDescription
POST/api/v1/pipeline/saveSave a named pipeline (name, description, steps)
GET/api/v1/pipeline/listList saved pipelines (admins see all; users see own)
DELETE/api/v1/pipeline/:idDelete (owner or admin)
GET/api/v1/pipeline/toolsList tool IDs valid for pipeline steps

Progress Tracking

Long-running jobs (AI tools, batch, pipelines) emit real-time progress via Server-Sent Events:

bash
# Connect to the SSE stream (jobId returned in X-Job-Id response header)
curl -N http://localhost:1349/api/v1/jobs/<jobId>/progress \
  -H "Authorization: Bearer <token>"

Event format:

data: {"progress":42,"status":"processing","message":"Upscaling frame 2/5"}
data: {"progress":100,"status":"completed"}

File Library

Persistent file storage with version history.

MethodPathDescription
POST/api/v1/uploadUpload files to workspace
GET/api/v1/filesList saved files (paginated, with search)
GET/api/v1/files/:idGet file metadata + version chain
GET/api/v1/files/:id/downloadDownload file
GET/api/v1/files/:id/thumbnailGet 300px JPEG thumbnail
DELETE/api/v1/files/:idDelete file (and its version chain)

To auto-save a tool result to the library, include fileId in the settings payload referencing an existing library file. The processed result will be saved as a new version.

API Key Management

MethodPathAccessDescription
POST/api/v1/api-keysAuthGenerate new key - shown once
GET/api/v1/api-keysAuthList keys (name, id, lastUsedAt - not raw key)
DELETE/api/v1/api-keys/:idAuthDelete key

Teams

MethodPathAccessDescription
GET/api/v1/teamsAuthList teams
POST/api/v1/teamsAdminCreate team
PUT/api/v1/teams/:idAdminRename team
DELETE/api/v1/teams/:idAdminDelete team (cannot delete default team or teams with members)

Branding

MethodPathAccessDescription
POST/api/v1/branding/logoAdminUpload custom logo (max 500 KB, converted to 128×128 PNG)
GET/api/v1/branding/logoPublicServe current logo
DELETE/api/v1/branding/logoAdminRemove custom logo

Settings

Runtime key-value configuration (read by any authenticated user, write by admin only).

MethodPathDescription
GET/api/v1/settingsGet all settings
PUT/api/v1/settings/:keySet a value

Known keys: disabledTools (JSON array of tool IDs), enableExperimentalTools (bool string), loginAttemptLimit (number), customLogo (managed via branding endpoint).

Error Responses

All errors return JSON:

json
{
  "error": "Human-readable message",
  "code": "MACHINE_READABLE_CODE"
}
StatusMeaning
400Invalid request / validation failed
401Not authenticated
403Insufficient permissions
404Resource not found
413File too large (see MAX_UPLOAD_SIZE_MB)
429Rate limited (see RATE_LIMIT_PER_MIN)
500Internal server error