BackgroundCut API

Auto remove background from your images via API

$ curl -H 'Authorization: Token YOUR_API_KEY'
       -F '[email protected]/your/image/file.jpg'

Sample Code

Remove background from image file

$ curl -H 'Authorization: Token YOUR_API_KEY'           \
       -F '[email protected]/your/image/file.jpg'                 \
import requests

URL = ""

image_file = {'file': open(PATH, 'rb')}
headers = {'Authorization': 'Token YOUR_API_KEY'}
response =, files=image_file, headers=headers)


// use Guzzle

post("", [
    'multipart' => [
            'name' => 'file',
            'contents' => fopen('SOURCE_IMAGE_FILE_PATH', 'r')
    'headers' => [
        'Authorization' => 'Token YOUR_API_KEY'

$res_body = $res->getBody()->getContents();
echo $res_body;

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

const imagePath = 'YOUR_IMAGE_PATH'

const settings = {
    "endpointPath": "",
    "Authorization": "Token YOUR_API_KEY"

function endpointHeader(apiKey, formdata){
    return {
        headers: {
            'Content-Type':'multipart/form-data; boundary=' + formdata.getBoundary(),
            'Authorization': 'Token YOUR_API_KEY'

const formdata = new FormData;
formdata.append('file', fs.createReadStream(imagePath));
    settings.endpointPath, formdata, endpointHeader(settings.apiKey, formdata)
.then(response => console.log(
.catch(errors => console.log(;

Output Formats

You can request one of three formats via the format parameter:

Format Resolution
PNG Up to 12 Megapixels
JPG Up to 12 Megapixels

API Reference

  • API Endpoint
  • MethodPOST
  • Request Bodymultipart/form-data
  • Authorization (string)Token YOUR_API_KEY
  • fileSource image file. Support only PNG, JPG, JPEG
  • formatOutput image format. Default value 'png'. Otherwise 'jpg' for JPG format and 'png' for PNG format. 'png' format support alpha transparency.
  • Code : 200Successfully removed image background
  • Code: 400Error: Invalid parameters or unable to process input image file (No credit deducted)
  • Code: 401Error: API-KEY missing or invalid API-KEY (No credit deducted)
  • Code: 402Error: No credits remaining (No credit deducted)
  • Code: 429Error: API rate limit crossed (No credit deducted)
API Rate Limit
  • During Beta, API is rate limited to a maximum of 20 request/minute. Much higher rate limits are coming soon.