Slazzer logo
Slazzer App

All-in-one AI photo editor

Get App

AI Background API

  • Background Magic
  • AI Background Changer
Remove or Replace Backgrounds Instantly with AI Background API

Our AI-powered API allows you to remove or replace backgrounds in images quickly and effortlessly, perfect for e-commerce, marketing, and design projects.

API Reference

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

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. The API replaces the existing background with an AI-generated background based on the provided text prompt.

    Supported Format :PNG, JPG, JPEG.

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

    Important :
    • 0.20 credit will be charged for each processing.
  • text_prompt

    Type :string

    Required :Yes

    Description :

    The text_prompt parameter provides a textual description of the desired background. The API generates a background that matches the given description and replaces the original background of the image.

    Examples :
    • text_prompt = A beach at sunset with palm trees and ocean waves.
    Important :
    • Be specific about the background details for better results.
    • 0.20 credit will be charged for each processing.
Response

Success

Background successfully removed!
Your image has been processed, and the background is now removed. You can now download or use it as you wish.

Binary image data

Error

Background removed failed!
The request could not be processed due to invalid parameters or an unsupported image format. Ensure the input image meets the required format and size specifications, then try again. (No credits were deducted for this request.)

Example :
{
    "error": "Source image file not found"
}

Error

Background removed failed!
API-KEY missing or invalid API-KEY (No credit deducted)

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

Error

Background removed failed!
No credits remaining (No credit deducted)

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

Error

Background removed failed!
Api rate limit crossed (No credit deducted)

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