Background Remover
Remove image backgrounds automatically.
Base URL
https://use.api.co.id
Send an image as multipart/form-data (the file field) or by image URL, with the x-api-co-id header. The response is a transparent PNG with the background removed.
File format & limits
| Requirement | Value |
|---|---|
| Input formats | JPG, JPEG, PNG, WEBP |
| Maximum size | 10 MB |
| Output format | PNG (with transparency) |
Models
Choose a model with the model parameter (default: u2netp). Supported models: u2net, u2netp, silueta, isnet-general-use.
Advanced parameters
| Parameter | Purpose | Default |
|---|---|---|
a | Enable alpha matting | false |
af | Foreground threshold (0–255) | 240 |
ab | Background threshold (0–255) | 10 |
ae | Erode size | 10 |
om | Return only the mask | false |
ppm | Post-process mask | false |
bgc | Background color as R,G,B,A (e.g. 255,255,255,255) | — |
extras | Extra parameters as JSON | — |
Rate limits
| Plan | Quota |
|---|---|
| Free | 20 requests per month |
| Premium | 1000 requests per month |
Remove Background from URL
GET/bg-remover/remove
Remove background from an image by providing its URL. Returns processed image with background removed as PNG (with transparency).
Query parameters
| Name | Type | Description |
|---|---|---|
urlRequired | string | URL of the image to process Example: https://example.com/image.jpg |
modelOptional | string | Model name (u2net, u2netp, silueta, isnet-general-use) |
aOptional | boolean | Enable Alpha Matting (true/false) |
afOptional | integer | Foreground Threshold (0-255) |
abOptional | integer | Background Threshold (0-255) |
aeOptional | integer | Erode Size |
omOptional | boolean | Only Mask (true/false) |
ppmOptional | boolean | Post Process Mask (true/false) |
bgcOptional | string | Background Color in format R,G,B,A (e.g., "255,255,255,255") |
extrasOptional | string | Extra JSON parameters |
Request
curl -X GET "https://use.api.co.id/bg-remover/remove?url=https%3A%2F%2Fexample.com%2Fimage.jpg" \ -H "x-api-co-id: $API_CO_ID_KEY"Response
{ "is_success": false, "message": "url parameter is required", "data": null}Remove Background from File
POST/bg-remover/remove
Remove background from an uploaded image file. Maximum file size: 10 MB. Supported formats: JPG, JPEG, PNG, WEBP.
Body (multipart/form-data)
| Name | Type | Description |
|---|---|---|
fileRequired | file | Image file to process. Maximum size: 10 MB. Supported formats: JPG, JPEG, PNG, WEBP |
modelOptional | string | Model name (u2net, u2netp, silueta, isnet-general-use) |
aOptional | boolean | Enable Alpha Matting |
afOptional | integer | Foreground Threshold (0-255) |
abOptional | integer | Background Threshold (0-255) |
aeOptional | integer | Erode Size |
omOptional | boolean | Only Mask |
ppmOptional | boolean | Post Process Mask |
bgcOptional | string | Background Color in format R,G,B,A (e.g., "255,255,255,255") |
extrasOptional | string | Extra JSON parameters |
Request
curl -X POST "https://use.api.co.id/bg-remover/remove" \ -H "x-api-co-id: $API_CO_ID_KEY" \ -F "[email protected]" \ -F "model=<model>" \ -F "a=<a>" \ -F "af=<af>" \ -F "ab=<ab>" \ -F "ae=<ae>" \ -F "om=<om>" \ -F "ppm=<ppm>" \ -F "bgc=<bgc>" \ -F "extras=<extras>"Response
{ "is_success": false, "message": "File is required. Please upload an image file using 'file' field in multipart/form-data", "data": null}List Available Models
GET/bg-remover/models
Get list of available background removal models.
Request
curl -X GET "https://use.api.co.id/bg-remover/models" \ -H "x-api-co-id: $API_CO_ID_KEY"Response
{ "is_success": true, "message": "Success", "data": { "models": [ "u2net", "u2netp", "silueta", "isnet-general-use" ], "default": "u2netp" }}Was this page helpful?