curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/assets/asset789/optimize" \
-H "Authorization: Bearer YOUR_JWT" \
-H "Content-Type: application/json" \
-d '{
"options": {
"quality": 80,
"format": "webp",
"width": 1200,
"height": 800
}
}'
{
"data": {
"id": "asset789",
"name": "hero-image.webp",
"type": "image/webp",
"status": "active",
"url": "https://cdn.metabind.ai/org123/proj456/assets/asset789/hero-image.webp",
"size": 245760,
"metadata": {
"width": 1200,
"height": 800,
"format": "webp",
"originalSize": 2048576,
"compressionRatio": 0.12
},
"tags": ["hero", "optimized"],
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-21T17:00:00Z"
}
}
Create an optimized version of an asset with format conversion and resizing
curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/assets/asset789/optimize" \
-H "Authorization: Bearer YOUR_JWT" \
-H "Content-Type: application/json" \
-d '{
"options": {
"quality": 80,
"format": "webp",
"width": 1200,
"height": 800
}
}'
{
"data": {
"id": "asset789",
"name": "hero-image.webp",
"type": "image/webp",
"status": "active",
"url": "https://cdn.metabind.ai/org123/proj456/assets/asset789/hero-image.webp",
"size": 245760,
"metadata": {
"width": 1200,
"height": 800,
"format": "webp",
"originalSize": 2048576,
"compressionRatio": 0.12
},
"tags": ["hero", "optimized"],
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-21T17:00:00Z"
}
}
curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/assets/asset789/optimize" \
-H "Authorization: Bearer YOUR_JWT" \
-H "Content-Type: application/json" \
-d '{
"options": {
"quality": 80,
"format": "webp",
"width": 1200,
"height": 800
}
}'
{
"data": {
"id": "asset789",
"name": "hero-image.webp",
"type": "image/webp",
"status": "active",
"url": "https://cdn.metabind.ai/org123/proj456/assets/asset789/hero-image.webp",
"size": 245760,
"metadata": {
"width": 1200,
"height": 800,
"format": "webp",
"originalSize": 2048576,
"compressionRatio": 0.12
},
"tags": ["hero", "optimized"],
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-21T17:00:00Z"
}
}
Web Images
{
"options": {
"format": "webp",
"quality": 80
}
}
Thumbnails
{
"options": {
"format": "webp",
"quality": 70,
"width": 300,
"height": 300
}
}
Maximum Compression
{
"options": {
"format": "avif",
"quality": 60
}
}