Slazzer logo
Slazzer App

All-in-one AI photo editor

Get App

AI Sky Replacement API

  • remove background
  • crop
  • background color
Remove image background with just a single API call

Our AI will remove the background from any image that has a clear foreground and background. (tested with human, cars, animals, & products )

API Reference

Head
  • Server URL:
    https://api.slazzer.com/v2.0
  • Request Body:
    multipart/form-data
  • Method:
    POST
  • API:
    /sky_replacement

Authorization

  • API-KEY :
    string
  • Your API key :
    xxxx xxxx xxxx xxxx
  • Get API Key
Parameters Request body
  • source_image_file

    Type :string ($binary)

    Required :Yes

    Description :

    The source_image_file parameter uploads an image for background processing. By default, the API removes the background and returns a transparent PNG. Based on additional parameters, it can replace the background with a solid color or crop the image. It must be sent as a multipart/form-data request, processing one image at a time. Transparent PNGs retain transparency unless a background color is set.

    Supported Format :PNG, JPG, JPEG.

    Examples :source_image_file = @/path/to/image.png

    Important : source_image_file is required. You must provide either bg_image_file or bg_color_code (along with source_image_file)
  • bg_image_file

    Type :string ($binary)

    Required :No

    Description :

    This bg_image_file will be used as the background for the processed image. The background image will automatically be resized to fit the output image’s aspect ratio.

    Supported Format :PNG, JPG, JPEG.

    Examples :bg_image_file = @/path/to/image.png

    Important : Only one of the bg_image_ parameter can be used in a single request. If multiple bg_image_ parameters are included, the request will fail.
  • bg_color_code

    Type :string

    Required :No

    Description :

    The bg_color_code parameter is used to specify a solid background color for the processed image. The color must be provided as a HEX color code.

    Supported Format :HEX color code (e.g., #72E4B3 or #B3D472)

    Examples :bg_color_code = #72E4B3

    Important : The color code must include the # symbol before the color code.
Response

Success

Request processed successfully!
Your request has been processed and completed. The response contains the result data or file as requested.

Binary image data

Error

Bad Request!
The request contains invalid parameters or input format. Please check the input and try again. (No credits were deducted.)

Example :
{
    "error": "Invalid input"
}

Error

Unauthorized!
Missing or invalid API key. Please provide a valid API key. (No credits were deducted.)

Example :
{
    "error": "invalid api key"
}

Error

Credits Required!
No credits remaining. Please top up your account to continue. (No credits were deducted.)

Example :
{
    "error": "No credits remaining"
}

Error

Rate Limit Exceeded!
Api rate limit crossed (No credit deducted)

Example :
{
    "error": "Api rate limit crossed"
}