copy Copy chevron-down
Getting Started bullseye-arrow IntroductionOur 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
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.
Navigate to the API Keys section in your dashboard.
Copy your key and store it securely. You'll need to include this in the ApiKey header of every request.
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
Bg Removal, Blur, Color, Gradient, Shadow
All features + Priority Support
All features + Dedicated Support
Flexible based on credits
We offer several image processing features. Each feature is accessible via its own endpoint.
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
The image file to process (multipart/form-data).
Demo
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
The image file to process.
Blur radius intensity (max 50).
Demo
Code Samples
Python:
Background Color
Instantly swap the background for any solid RGB color.
Endpoint: POST /v2/rembg/color/
Parameters
Parameter
Type
Required
Description
The image file to process.
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
The image file to process.
Top color in RGB format, e.g., (255, 140, 0, 255).
Bottom color in RGB format, e.g., (229, 46, 113, 255).
Code Samples
Python:
Enhance your images by adding a realistic shadow to the subject.
Endpoint: POST /v2/rembg/shadow/
Parameters
Parameter
Type
Required
Description
The image file to process.
Shadow color in RGB/RGBA format.
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
Success. Processed image data returned.
Invalid parameters or image format.
Missing or invalid API key.
Insufficient credits or subscription expired.
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.