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.
FieldTypeDefaultDescription
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: BiRefNetErrors
FieldTypeDefaultDescription
401unauthorized—Missing or invalid token.
402payment_required—Free tier exhausted. Add a card to continue.
413payload_too_large—Image exceeds 10 MB or 4096×4096.
422no_subject_detected—Foreground could not be isolated from background.
429rate_limit_exceeded—Slow down. Retry-After header tells you when.
500internal_error—Something broke on our side. Include request_id when reporting.
413payload_too_large—Total batch >50 MB or any single file >10 MB.
400too_many_files—Maximum 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.