Below you can see all possible options for the request body. See the and sections to learn more about image operations.
Copy {
"input": "http(s)://{public_url}/image.png" |
"storage://{storage_name}/{image_folder}/image.png",
"operations": {
"restorations": {
"decompress": null |
"moderate" | "strong" | "auto",
"upscale": null |
"smart_enhance" | "smart_resize" | "faces" |
"digital_art" | "photo",
"polish": false | true
},
"resizing": null | {
"width": null | "auto" | 500 | "150%",
"height": null | "auto" | 500 | "150%",
"fit": "bounds" | "cover" | "canvas" | "outpaint" | "crop" |
{"type": "crop", "crop": "center" | "smart"} |
{"type": "outpaint", "feathering": "15%"}
"adjustments": null | {
"hdr": 0 | {"intensity": 0, "stitching": true | false},
"exposure": 0,
"saturation": 0,
"contrast": 0,
"sharpness": 0
},
"background": null | {
"remove": false | true | {
"category": "general" | "cars" | "products",
"selective": {
"object_to_keep": "<object>"
},
"clipping": false | true
},
"blur": false | true | {
"category": "general" | "cars" | "products",
"selective": {
"object_to_keep": "<object>"
},
"type": "regular" | "lens",
"level": "low" | "medium" | " high"
}
"color": "#ffffff" | "<color-hex>" | "transparent"
},
"padding": null | "10%" | "5% 25%",
"privacy": {
"blur_car_plate": false | true
},
"generative": null | {
"style_transfer": null | {
"style_reference_image": "storage://{storage_name}/{image_folder}/reference.jpeg",
"prompt": null | "<string>",
"style_strength": null | 0.75,
"denoising_strength": null | 0.75,
"depth_strength": null | 1.0
}
}
},
"output": null | "storage://{storage_name}/{image_folder}/image.jpeg" | {
"destination": null | "storage://{storage_name}/{image_folder}/image.jpeg",
"metadata": null | {"dpi": null | 300},
"format": "jpeg" | "png" | "webp" | "avif" | {
"type": "jpeg",
"quality": 85, // format-specific options
"progressive": true | false
} | {
"type": "png",
"compression": "fast" | "best" | "optimal"
} | {
"type": "webp" | "avif",
"compression": {
"type": "lossy" | "lossless",
"quality": 90
}
}
}
}
Copy Content-Type: application/json
Authorization: Bearer {YOUR_API_KEY}
Copy {
"data": {
"input": {
"ext": "png",
"mps": 0.125,
"mime": "image/png",
"width": 500,
"format": "PNG",
"height": 250
},
"output": {
"ext": "png",
"mps": 0.431,
"mime": "image/jpeg",
"width": 1000,
"format": "JPEG",
"height": 431,
"tmp_url": "https://storage.googleapis.com/production-leapi-tmp-public/733a7c8f-1fea-4097-8fd4-17f54c94d998/shoe_example_05fb154a3a.png"
}
}
}
Copy ratelimit-limit: 120, 120;w=60, 4;w=1
ratelimit-remaining: 119
ratelimit-reset: 34
Request Id header allows to track your request during image edit processing, so we are able to help you with troubleshooting and profiling your request if needed.
Copy x-request-id: 9b321763-1d09-4072-932b-ff031475affa