bullseye-arrowIntroduction

Our API provides fast, high-quality background removal and image editing features using advanced AI technology.

RemoveBG API Documentation

Welcome to the RemoveBG API documentation. Our API provides fast, high-quality background removal and image editing features using advanced AI technology.


🚀 Getting Started

Introduction

The RemoveBG API allows you to programmatically remove backgrounds from images, apply blurs, change background colors, add gradients, and even add realistic shadows to your subjects. It's designed for developers who need reliable and scalable image processing solutions.

Base URL: https://fapihub.com/v2/rembg/

How to Get an API Key

To use the RemoveBG API, you'll need an active API key.

  1. Sign up or log in to your account at RemoveBG API Dashboardarrow-up-right.

  2. Navigate to the API Keys section in your dashboard.

  3. Click on Create New Key.

  4. Copy your key and store it securely. You'll need to include this in the ApiKey header of every request.

Authentication

All API requests require authentication. Include your API key in the ApiKey header with every request.

Header Format:

Regulations & Limits

The API has limits based on your current subscription plan. There are two types of limits:

  • Monthly Limits: Total number of requests you can make within a billing month.

  • Minute Limits (Rate Limiting): The maximum number of requests you can make per minute to ensure service stability.

Plan Summary:

Plan
Monthly Requests
Minute Limit
Features

Basic (Free)

100

10

Bg Removal, Blur, Color, Gradient, Shadow

Pro

1,000+

Higher

All features + Support

Ultra

5,000+

Higher

All features + Priority Support

Mega

10,000+

Higher

All features + Dedicated Support

Per Usage

Lifetime Quota

Custom

Flexible based on credits


✨ Features

We offer several image processing features. Each feature is accessible via its own endpoint.

  • Remove Background

  • Background Blur

  • Background Color

  • Background Gradient

  • Subject Shadow


Remove Background

The core feature of our API, allowing you to remove the background from any image with high precision.

Endpoint: POST /v2/rembg/

Parameters

Parameter
Type
Required
Description

image

file

Yes

The image file to process (multipart/form-data).

Demo

Original
Processed

Code Samples

cURL:

Python:

JavaScript (Fetch):


Background Blur

Apply a professional blur effect to the background while keeping the subject sharp.

Endpoint: POST /v2/rembg/blur/

Parameters

Parameter
Type
Required
Description

image

file

Yes

The image file to process.

radius

integer

Yes

Blur radius intensity (max 50).

Demo

Original
Blurred Result

Code Samples

Python:


Background Color

Instantly swap the background for any solid RGB color.

Endpoint: POST /v2/rembg/color/

Parameters

Parameter
Type
Required
Description

image

file

Yes

The image file to process.

bgcolor

string

Yes

Background color in RGB format, e.g., (255, 140, 0, 255).

Code Samples

cURL:


Background Gradient

Add a stylish color gradient to the background of your subject.

Endpoint: POST /v2/rembg/gradient/

Parameters

Parameter
Type
Required
Description

image

file

Yes

The image file to process.

top_color

string

Yes

Top color in RGB format, e.g., (255, 140, 0, 255).

bottom_color

string

Yes

Bottom color in RGB format, e.g., (229, 46, 113, 255).

Code Samples

Python:


Subject Shadow

Enhance your images by adding a realistic shadow to the subject.

Endpoint: POST /v2/rembg/shadow/

Parameters

Parameter
Type
Required
Description

image

file

Yes

The image file to process.

shadow_color

string

Yes

Shadow color in RGB/RGBA format.

offset

string

Yes

Offset in pixels (x, y).

blur_radius

integer

Yes

Blur intensity for the shadow edges.

Code Samples

cURL:


🛠 Responses & Error Codes

The API returns binary image data on success (200 OK) or a JSON error object on failure.

Response Status Codes

Code
Status
Description

200

OK

Success. Processed image data returned.

400

Bad Request

Invalid parameters or image format.

401

Unauthorized

Missing or invalid API key.

402

Payment Required

Insufficient credits or subscription expired.

429

Too Many Requests

Rate limit exceeded.

Error Object

On failure, the response body will contain a JSON object detailing the error:

Common Error Codes:

  • invalid_image: The uploaded file is corrupted or not a supported image format.

  • invalid_api_key: The provided API token is not recognized.

  • insufficient_credits: Your plan's quota has been exhausted.

  • rate_limit_exceeded: Too many requests in a short period.

  • server_error: An internal processing error occurred.


💡 Best Practices & Support

  • Image Formats: For best results, use .jpg or .png images under 20MB.

  • Resolution: The API maintains the original aspect ratio but large images may take longer to process.

  • Support: If you encounter any issues, please contact us via the Support Dashboardarrow-up-right.

Last updated