API reference/POST /preview
Low-res quick preview
Fast preview that downsamples the input to 256px before processing. Costs nothing against your quota — useful for hover previews and thumbnail grids.
POSThttps://useknockout--api.modal.run/preview
Parameters
Send as multipart/form-data unless noted otherwise.
FieldTypeDefaultDescription
filerequiredfile—Image to process. JPG, PNG, WebP, HEIC. Up to 10 MB and 4096×4096.
formatstringpngOutput format — png (with alpha) or webp.
Request
curl -X POST "https://useknockout--api.modal.run/preview" \
-H "Authorization: Bearer $TOKEN" \
-F "file=@cat.jpg" \
-o out.pngResponse
HTTP/1.1 200 OK
content-type: image/png
x-knockout-latency: 64
x-knockout-preview: 1Errors
FieldTypeDefaultDescription
401unauthorized—Missing or invalid token.
429rate_limit_exceeded—Slow down. Retry-After header tells you when.
Every error response also includes a
request_id in the JSON body. Quote it when reporting issues.Notes
- Free tier: previews don't count toward your 50/mo quota.
- Paid tier: previews are billed at $0.0005/image (10× cheaper than full /remove).
- Always use /preview for hover/thumbnail UX. Reserve /remove for the final export.