API Reference
request and response description
Below you can see all possible options for the request body. See the Image Operations and Image I/O sections to learn more about image operations.
{
"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"
},
"resizing": null | {
"width": null | "auto" | 500 | "150%",
"height": null | "auto" | 500 | "150%",
"fit": "bounds" | "cover" | "canvas" | "crop" |
{"crop": "center" | "smart"}
},
"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",
"clipping": false | true
},
"color": "#ffffff" | "<color-hex>" | "transparent"
},
"padding": null | "10%" | "5% 25%",
"privacy": {
"blur_car_plate": false | true
}
},
"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
}
}
}
}
post
/v1-beta1/image/edit
Image Edit
Request body
POST /v1/pipeline HTTP/1.1
Host: api.claid.ai
Authorization: Bearer 12354567890
Content-Type: application/json
Content-Length: 174
{
"input": "https://staging.claid.ai/assets/cms/shoe_example_05fb154a3a/shoe_example_05fb154a3a.png",
"operations": {
"resizing": {
"width": 1000
},
"background": {
"remove": false
}
}
}
In order to send a request, you should set
Content-Type
header to let our system know that you providing a valid json payload and Authorization
header with a generated API key to identify yourself as a Claid user.Content-Type: application/json
Authorization: Bearer {{api_key}}
Once you have made the request to
https://api.claid.ai/v1-beta1/image/edit
you will get a response with information about input and output images.Image information shown in the response:
Parameter | Type | Description |
---|---|---|
ext | string | File extension. Can have values: jpg , png , webp , av1 |
mps | integer | Megapixel count |
mime | string | MIME type (also known as ‘media type’) |
width | integer | Image width in pixels |
height | integer | Image height in pixels |
format | string | File format. Can have values: jpeg , png , webp , avif |
tmp_url | string | Temporary URL of a processed image.* |
Response body
{
"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"
}
}
}
Rate limit headers will help you to understand what number of requests you are able to send according to the current limits on your account:
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.
x-request-id: 9b321763-1d09-4072-932b-ff031475affa
Last modified 2mo ago