ByByBG API Documentation – AI Background Removal API
🚀 Developer Documentation

ByByBG API Documentation

Integrate AI-powered background removal into your websites, mobile apps, automation workflows, SaaS platforms, and production systems with simple API requests.

INTRODUCTION

Welcome to ByByBG API

The ByByBG API allows developers to remove image backgrounds automatically using advanced AI models with a single API request.

Our infrastructure is optimized for speed, scalability, security, and production-ready integrations for websites, apps, and SaaS platforms.

Fast AI Processing

Remove image backgrounds in seconds using optimized AI servers and smart processing systems.

🔐

Secure API

Your API requests are protected using secure API key authentication and encrypted communication.

🌍

Multi Platform Support

Use the API with websites, mobile applications, backend servers, SaaS products, and automation systems.

📦

Bulk Processing Ready

Efficiently process single or multiple images with scalable infrastructure and reliable performance.

HOW IT WORKS

Simple Background Removal Workflow

01

Upload an Image

Users select and upload an image from their device using a simple upload form or drag-and-drop interface.

02

Send API Request

Your backend securely sends the image to the ByByBG API using your private API key.

03

Receive Transparent PNG

The API processes the image using AI and instantly returns a transparent PNG image.

API ENDPOINT

Official API Endpoint

Send a POST request to the endpoint below to remove image backgrounds using AI.

POST https://api.bybybg.com/v1/remove-bg
READY TO USE DEMO

Ready-to-Use Background Remover Demo

Copy the files below, add your API key, upload them to your hosting, and your AI background remover will be live instantly.

Project Folder Structure

project/
├── index.html
├── style.css
├── script.js
└── remove-bg.php

index.html

Create a file named index.html and paste the code below.

<!DOCTYPE html>
<html>

<head>

<link rel="stylesheet" href="style.css">

</head>

<body>

<div class="upload-box">

    <input type="file"
           id="imageInput"
           accept="image/*">

    <button id="uploadBtn">
        Remove Background
    </button>

    <img id="preview">

</div>

<script src="script.js"></script>

</body>
</html>

style.css

body{
    background:#0f172a;
    color:white;
    font-family:Arial;
    padding:40px;
}

.upload-box{
    max-width:500px;
    margin:auto;
    padding:30px;
    background:#111827;
    border-radius:20px;
    text-align:center;
}

button{
    padding:14px 22px;
    border:none;
    border-radius:10px;
    cursor:pointer;
}

img{
    width:100%;
    margin-top:20px;
}

script.js

const input = document.getElementById("imageInput");
const button = document.getElementById("uploadBtn");
const preview = document.getElementById("preview");

button.onclick = async () => {

    if(!input.files.length) return;

    const formData = new FormData();

    formData.append("file", input.files[0]);

    const response = await fetch("remove-bg.php", {
        method:"POST",
        body:formData
    });

    const blob = await response.blob();

    preview.src = URL.createObjectURL(blob);
};

remove-bg.php

Create a file named remove-bg.php and replace YOUR_API_KEY with your real API key.

<?php

$apiKey = "YOUR_API_KEY";

$ch = curl_init(
"https://api.bybybg.com/v1/remove-bg?format=png"
);

$cfile = new CURLFile(
    $_FILES['file']['tmp_name']
);

curl_setopt_array($ch,[

    CURLOPT_POST => true,

    CURLOPT_POSTFIELDS => [
        'file' => $cfile
    ],

    CURLOPT_RETURNTRANSFER => true,

    CURLOPT_HTTPHEADER => [
        'X-API-KEY: '.$apiKey,
        'Accept: image/png'
    ]

]);

$response = curl_exec($ch);

curl_close($ch);

header('Content-Type:image/png');

echo $response;
SETUP GUIDE

Setup Instructions

  • Create a new project folder on your computer or hosting account.
  • Create the files exactly as shown above using the same file names.
  • Paste the provided code into each file.
  • Replace YOUR_API_KEY with your real ByByBG API key.
  • Upload the files to your hosting and open index.html in your browser.
RESPONSE

API Response Output

  • Transparent PNG image output
  • High-quality edge detection and AI processing
  • Fast processing speed for production usage
  • Ready-to-use image response for websites and applications

Ready to Start Building?

Continue to the authentication guide and learn how to generate and securely use your API key.