API Reference

Documentation

Everything you need to render HTML to pixels.

Authentication

All /render endpoints require a Bearer token:

curl -X POST https://supaserv.io/render \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"html": "<h1>Hello</h1>"}'

Your API key is provided when you join the beta. Keep it secret — it authenticates all requests.

POST /render

Render HTML to a PNG screenshot.

Request Body

FieldTypeDefaultDescription
htmlstringHTML to render (required)
widthnumber1080Viewport width (100–3840)
heightnumber1350Viewport height (100–3840)
seek_msnumberWait ms before capture (for animations)
wait_readybooleantrueWait for window.__READY

Example

curl -X POST https://supaserv.io/render \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<div style=\"background:#000;color:#fff;padding:40px\">Hello World</div>",
    "width": 1080,
    "height": 1080
  }' \
  --output screenshot.png

Returns: image/png

POST /render/pdf v1 · Chromium

Render HTML to a PDF document using the Chromium engine. Also available as /render/pdfv1.

Request Body

FieldTypeDefaultDescription
htmlstringHTML to render (required)
formatstring"A4"Page format (A4, A3, Letter, Legal)
landscapebooleanfalseLandscape orientation
marginobjectPage margins {top, right, bottom, left}
print_backgroundbooleantrueInclude background colors/images

Example

curl -X POST https://supaserv.io/render/pdf \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<h1>Invoice #42</h1><p>Total: EUR 99.00</p>",
    "format": "A4",
    "print_background": true
  }' \
  --output invoice.pdf

Returns: application/pdf

POST /render/pdfv2 v2 · WeasyPrint

Print-ready PDF rendering with CMYK, ICC profiles, bleed, trim marks, and PDF/X-4 support. Powered by WeasyPrint.

Full CSS Paged Media support. Falls back to Chromium if WeasyPrint is unavailable.

Full PDF v2 documentation →

Quick Example

curl -X POST https://supaserv.io/render/pdfv2 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<h1>Print Flyer</h1>",
    "format": "A4",
    "color_mode": "cmyk",
    "bleed": "3mm",
    "trim_marks": true
  }' \
  --output flyer-print.pdf

Returns: application/pdf

POST /render/video

Capture animated HTML as MP4 or GIF.

Request Body

FieldTypeDefaultDescription
htmlstringHTML to render (required)
widthnumber1080Viewport width (100–3840)
heightnumber1350Viewport height (100–3840)
fpsnumber10Frames per second (1–30)
duration_msnumberDuration in ms (100–30000, required)
formatstring"mp4""mp4" or "gif"

Example

curl -X POST https://supaserv.io/render/video \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<div id=\"anim\">...</div>",
    "width": 1080,
    "height": 1920,
    "fps": 30,
    "duration_ms": 5000,
    "format": "mp4"
  }' \
  --output animation.mp4

Returns: video/mp4 or image/gif

Limit: max 900 frames total (fps × duration). Reduce FPS or duration if exceeded.

POST /render/rembg NEW

Remove background from an image. Returns a transparent PNG. Powered by rembg (silueta model).

Best suited for images with white or light backgrounds (product photos, headshots, logos).

Request

Send as multipart/form-data with a file field:

FieldTypeDescription
fileFileImage file (required). JPG, PNG, or WEBP. Max 10 MB.

Example

curl -X POST https://supaserv.io/render/rembg \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@photo.jpg" \
  --output cutout.png

Returns: image/png (RGBA with transparent background)

Errors

StatusReason
400Missing file, wrong Content-Type, or unsupported image format
413File exceeds 10 MB limit
500Processing error

Performance: ~3s per image (warm). First request after deploy may take longer.

GET /health

Health check endpoint. No authentication required.

curl https://supaserv.io/health
// Response
{
  "status": "ok",
  "service": "supaserv",
  "version": "0.2.0",
  "backend": "worker"
}