Clean up an image
POST
/api/ai/cleanup
const url = 'https://example.com/api/ai/cleanup';const form = new FormData();form.append('image', 'file');form.append('mask', 'file');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/ai/cleanup \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form image=@file \ --form mask=@fileRemoves masked regions from an image using the ClipDrop cleanup API. Send multipart/form-data with ‘image’ and ‘mask’ files; returns the cleaned PNG.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typemultipart/form-data
object
image
Source image
string format: binary
mask
Mask image marking regions to clean
string format: binary
Responses
Section titled “Responses”Cleaned image
Media typeimage/png
string format: binary
Missing image or mask file
Server or ClipDrop API error