API reference/POST /preview

Low-res quick preview

Fast preview that downsamples the input (512px by default) before processing. Free on every plan, useful for hover previews and thumbnail grids.

POSThttps://useknockout--api.modal.run/preview

Parameters

Send as multipart/form-data unless noted otherwise.

filerequiredfile–Image to process. JPG, PNG, WebP, HEIC. Up to 10 MB and 4096×4096.
max_dimint 64-1024512Longest edge of the preview, in pixels. The input is downscaled to this before processing.
formatstringpngOutput format: png or webp.

Request

curl -X POST "https://useknockout--api.modal.run/preview" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@cat.jpg" \
  -o out.png

Notes

  • Free tier: previews don't count toward your 30-image monthly quota.
  • Free on every plan, including paid tiers: previews never count toward your quota or your bill.
  • Always use /preview for hover/thumbnail UX. Reserve /remove for the final export.