Remove Background
Background removal API reference. Remove backgrounds from images with transparent PNG output. Three quality levels for general use, portraits, and fine edge subjects like hair and fur.
Remove Background
POST/v1/tools/remove-bg/
Remove the background from any image and receive a transparent PNG. Three quality levels cover general product and object shots, portrait photography, and subjects with complex edges such as hair, fur, or semi-transparent materials. High quality uses a model specifically trained for fine-edge subjects and operates at higher resolution for more accurate cutouts. Input images are automatically resized if they exceed the resolution limit for the chosen quality level.
# Standard background removal
curl -X POST https://api.3daistudio.com/v1/tools/remove-bg/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image_url": "https://example.com/photo.jpg",
"quality": "medium"
}'
# High quality for hair, fur, or complex edges
curl -X POST https://api.3daistudio.com/v1/tools/remove-bg/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image_url": "https://example.com/portrait.jpg",
"quality": "high"
}'
# Return a grayscale mask instead of the cutout
curl -X POST https://api.3daistudio.com/v1/tools/remove-bg/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image_url": "https://example.com/photo.jpg",
"quality": "medium",
"return_mask": true
}'
# Using a file upload
curl -X POST https://api.3daistudio.com/v1/tools/remove-bg/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-F image_file=@photo.jpg \
-F quality=high{
"task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"created_at": "2026-02-25T12:00:00Z"
}Quality Levels
Choose the quality level that best fits your subject. Higher quality levels produce more accurate cutouts at the cost of additional credits.
| Quality | Best For | Max Input Size | Credits |
|---|---|---|---|
| low | Quick previews, simple objects with clean hard edges. | 2048px | 3 |
| medium | General use — products, objects, portraits, most subjects. | 2048px | 4 |
| high | Hair, fur, semi-transparent materials, or any subject requiring fine edge accuracy. | 4096px | 5 |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| image_url | string (URL) | Conditional | URL of the image to process. Required if image_file is not provided. |
| image_file | file | Conditional | Direct file upload. Supported formats: JPEG, PNG, WebP. Required if image_url is not provided. |
| quality | string | No | Quality level: "low", "medium", or "high". Default: "medium". |
| return_mask | boolean | No | Return a grayscale segmentation mask instead of a transparent cutout. White areas are foreground, black areas are background. Useful for compositing in external tools. Default: false. |
Checking Status
GET/v1/generation-request/<task_id>/status/
Poll this endpoint with the task_id from the submit response. When status is "FINISHED", the results array contains the output PNG. If return_mask was true, the result is a grayscale mask. Results expire after 24 hours.
curl https://api.3daistudio.com/v1/generation-request/YOUR_TASK_ID/status/ \
-H "Authorization: Bearer YOUR_API_KEY"{
"status": "FINISHED",
"progress": 100,
"failure_reason": null,
"results": [
{
"asset": "https://storage.3daistudio.com/assets/cutout.png",
"asset_type": "EDITED_IMAGE",
"metadata": {
"result_type": "background_removed",
"quality": "medium"
}
}
]
}Processing Times
Background removal typically completes in 1–4 seconds. High quality requests may take up to 5 seconds due to higher resolution processing.
Output Format
The result is always a PNG file with an alpha channel for transparency. The output dimensions match the input image, subject to the maximum input size for the chosen quality level. If the input exceeds the maximum, it is resized down proportionally before processing.