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 :
    • 1 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.
    • 1 credit will be charged for each processing.
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"
}