API reference/POST /remove-batch

Remove background, batch

Process up to 10 images in a single multipart request. Returns a JSON manifest with one entry per input + signed download URLs valid for 24 hours.

POSThttps://useknockout--api.modal.run/remove-batch

Parameters

Send as multipart/form-data unless noted otherwise.

files[]requiredfile[]Array of image files. Up to 10. Each ≤10 MB. JPG/PNG/WebP/HEIC.
formatstringpngOutput format — png (with alpha) or webp.

Request

curl -X POST "https://useknockout--api.modal.run/remove-batch" \
  -H "Authorization: Bearer $TOKEN" \
  -F "files=@cat.jpg" -F "files=@dog.jpg" -F "files=@bird.jpg"

Response

HTTP/1.1 200 OK
content-type: application/json
x-knockout-latency: 1842
x-knockout-model: BiRefNet

Errors

401unauthorizedMissing or invalid token.
402payment_requiredFree tier exhausted. Add a card to continue.
413payload_too_largeImage exceeds 10 MB or 4096×4096.
422no_subject_detectedForeground could not be isolated from background.
429rate_limit_exceededSlow down. Retry-After header tells you when.
500internal_errorSomething broke on our side. Include request_id when reporting.
413payload_too_largeTotal batch >50 MB or any single file >10 MB.
400too_many_filesMaximum 10 files per batch.
Every error response also includes a request_id in the JSON body. Quote it when reporting issues.

Notes

  • Files process in parallel. Total response time ≈ slowest single file + 100ms overhead.
  • Signed URLs are R2-backed and self-expire after 24h. Download or rehost.