Skip to content

Powerful Background Removal API

Integrate our advanced AI-powered background removal technology directly into your applications

Simple Integration

Easy to integrate with any programming language using our RESTful API

Secure Authentication

API key authentication for secure and controlled access

Detailed Documentation

Comprehensive guides and examples to get you started quickly

API Endpoint

POST https://rmbg.pro/api/remove-background

API base URL: https://rmbg.pro/api. Upload PNG, JPEG or WebP images up to 20 MB and 40 megapixels. PDF conversion accepts PDFs up to 15 MB.

Use image (or legacy image_file). Choose return_type=base64 for JSON containing image_base64, or binary for an image response. Link output and URL imports are not supported.

Background operations use the configured RemoveBackground credit cost (1 by default). PDF text/Markdown conversion uses 0 credits. API access requires an active account and X-API-KEY. Limit: 60 requests/minute per account, up to 4 concurrent operations.

Send a unique Idempotency-Key for retries. The same key and input replay the original result without a second charge. Pending or conflicting requests return 409; failed operations are refunded.

Migration guide and supported operations · OpenAPI specification

Authentication

Include your API key in the request headers:

X-API-KEY: your_api_key_here

Open Source Examples

Explore ready-to-run examples for popular frameworks in our public repository.

https://github.com/ch-moez/rmbg.pro-examples/tree/main

Code Examples

const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');

async function removeBackground() {
  try {
    const formData = new FormData();
    formData.append('image_file', fs.createReadStream('path/to/your/image.jpg'));
    formData.append('return_type', 'binary');
    
    // Optional parameters
    formData.append('custom_bg_color', '#FFFFFF'); // Custom background color
    formData.append('output_format', 'png'); // png, jpeg or webp
    formData.append('custom_bg_image', fs.createReadStream('path/to/background.jpg')); // Custom background image
    formData.append('logo', fs.createReadStream('path/to/logo.png')); // Logo to add
    formData.append('position_logo', 'center-center'); // Logo position (e.g., 'center-center', 'top-left', etc.)
    formData.append('logo_size_percentage', '30'); // Logo size as percentage

    const response = await axios.post('https://rmbg.pro/api/remove-background', formData, {
      responseType: 'arraybuffer',
      headers: {
        ...formData.getHeaders(),
        'X-API-KEY': 'YOUR_API_KEY'
      }
    });

    // Save the processed image
    fs.writeFileSync('output.png', response.data);
    console.log('Background removed successfully!');
  } catch (error) {
    console.error('Error:', error.message);
  }
}

removeBackground();

Ready to Get Started?

Create an account now and get your API key to start removing backgrounds programmatically

Sign Up for Free

Guides de l’API