endpoint
GET

/api/media/optimizer/config

Optimizer presets, encoder availability, and public pricing metadata

auth: publicbase https://app.nz
Request
curl -s "https://app.nz/api/media/optimizer/config"

Media optimizer API

Cloudflare-style image resizing and AV1-first video re-encoding over your app.nz artifact filesystem. Optimize an existing artifact or a public HTTPS URL, save generated variants back into /artifacts, and serve best-size images through a dynamic URL that negotiates AVIF, WebP, JPEG, or PNG from the Accept header. The same optimizer is available as a Cog image for isolated GPU worker pools.

Optimization body
artifactIdstringSource artifact to read. Required unless url is supplied.
urlstringPublic HTTPS source URL. Private/reserved network targets are rejected.
kindstringimage | video. Inferred from MIME/extension when omitted.
widthsint[]Image widths to generate. Default: [320,640,960,1280].
heightsint[]Video ladder heights. Default: [360,720,1080].
formatsstring[]Image: webp | avif | jpeg | png. Video: webm | av1 | mp4.
qualityint1-100 quality target; defaults to 85 for images.
outputPathstringArtifact directory for generated variants; defaults to /optimized.
dryRunbooleanReturn the plan and estimated credits without encoding.
Generate responsive variants and build the Cog image
# Save responsive image variants back into /artifacts.
curl -sX POST https://app.nz/api/media/optimize \
  -H "Authorization: Bearer pk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "artifactId": "artifact_123",
    "kind": "image",
    "widths": [320, 640, 1280],
    "formats": ["webp"],
    "outputPath": "/optimized"
  }'

# Dynamic best-size image URL.
curl -L "https://app.nz/api/media/image/artifact_123?w=640&format=auto&q=85" \
  -H "Authorization: Bearer pk_live_..."

# CLI equivalents.
app media optimize --artifact-id artifact_123 --width 640 --width 1280 --format webp
app media pricing
app builds media-optimizer-cog