Skip to main content
POST
/
v1
/
remove-background
Remove Background
curl --request POST \
  --url https://api.developer.pixelcut.ai/v1/remove-background \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "image_url": "https://cdn3.pixelcut.app/product.jpg",
  "format": "png",
  "shadow": {
    "enabled": false,
    "opacity": 0.5,
    "light_source": {
      "size": 0.3,
      "position": {
        "x": -0.3,
        "y": -0.6,
        "z": 0.7
      }
    }
  },
  "crop": false,
  "margin": "100px",
  "margin_left": "50px",
  "margin_right": "50px",
  "margin_top": "50px",
  "margin_bottom": "50px"
}
'
{
  "result_url": "https://assets.pixelcut.app/public/result/a16646be-91c8-4e3a-b359.png"
}

Authorizations

X-API-KEY
string
header
required

All API requests require a valid api key. Include your token as a HTTP request header in the following format: X-API-Key: skXXXXXXXXXXXXXXXX. You can obtain an api key by signing up for developer access in your Pixelcut account.

Headers

Accept
string

Acceptable response media type(s). application/json or image/*. Default is application/json.

Body

image_url
string<url>
required

URL of the image to be processed.

Example:

"https://cdn3.pixelcut.app/product.jpg"

format
enum<string>

The format of the resultant image. Currently, only png is supported.

Available options:
png
shadow
object

Enable and configure AI-generated shadow. When enabled, +3 credits are consumed. Pass true for automatic shadow estimation or provide a light source for custom control.

crop
boolean
default:false

When true, crops the image to the region of interest (the detected subject).

margin
string

(Beta) General margin applied to all sides when crop is enabled. Only applies if crop is true. When specified as a string with '%' (0-49%), it represents a percentage of the image dimensions. When specified as a string with 'px', it represents pixels (>=0px).

Example:

"100px"

margin_left
string

(Beta) Directional margin override that applies when crop is enabled. Only applies if crop is true. When specified, this overrides the general margin parameter for this specific side. When specified as a string with '%' (0-49%), it represents a percentage of the image dimensions. When specified as a string with 'px', it represents pixels (>=0px).

Example:

"50px"

margin_right
string

(Beta) Directional margin override that applies when crop is enabled. Only applies if crop is true. When specified, this overrides the general margin parameter for this specific side. When specified as a string with '%' (0-49%), it represents a percentage of the image dimensions. When specified as a string with 'px', it represents pixels (>=0px).

Example:

"50px"

margin_top
string

(Beta) Directional margin override that applies when crop is enabled. Only applies if crop is true. When specified, this overrides the general margin parameter for this specific side. When specified as a string with '%' (0-49%), it represents a percentage of the image dimensions. When specified as a string with 'px', it represents pixels (>=0px).

Example:

"50px"

margin_bottom
string

(Beta) Directional margin override that applies when crop is enabled. Only applies if crop is true. When specified, this overrides the general margin parameter for this specific side. When specified as a string with '%' (0-49%), it represents a percentage of the image dimensions. When specified as a string with 'px', it represents pixels (>=0px).

Example:

"50px"

Response

Success

result_url
string

A URL to access the resultant image which is valid for 1 hour. File format will be png.

Example:

"https://assets.pixelcut.app/public/result/a16646be-91c8-4e3a-b359.png"