Cutmatte

Migrate from the remove.bg API

remove.bg closes its self-serve API on 1 December 2026. Cutmatte takes the same requests and sends the same responses, so you change two things: the address and the key.

Three steps

  1. Sign in with your email and create an API key.
  2. Replace https://api.remove.bg with https://api.cutmatte.com.
  3. Use the new key in the same X-Api-Key header.

Parameters, response formats, headers such as X-Credits-Charged and X-Width, and error codes stay the same. The few features we do not have are listed in differences.

Examples

Every example below is the remove.bg sample with the address changed. We run them against Cutmatte.

cURL

curl -H "X-Api-Key: YOUR_KEY" \
     -F "image_file=@/path/to/photo.jpg" \
     -F "size=auto" \
     -f https://api.cutmatte.com/v1.0/removebg -o no-bg.png

Node.js

import fs from "node:fs";

const formData = new FormData();
formData.append("size", "auto");
formData.append("image_file", await fs.openAsBlob("/path/to/photo.jpg"));

const response = await fetch("https://api.cutmatte.com/v1.0/removebg", {
  method: "POST",
  headers: { "X-Api-Key": "YOUR_KEY" },
  body: formData,
});
if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);
fs.writeFileSync("no-bg.png", Buffer.from(await response.arrayBuffer()));

Python

import requests

response = requests.post(
    "https://api.cutmatte.com/v1.0/removebg",
    files={"image_file": open("/path/to/photo.jpg", "rb")},
    data={"size": "auto"},
    headers={"X-Api-Key": "YOUR_KEY"},
)
if response.status_code == requests.codes.ok:
    with open("no-bg.png", "wb") as out:
        out.write(response.content)
else:
    print("Error:", response.status_code, response.text)

PHP

<?php
$ch = curl_init("https://api.cutmatte.com/v1.0/removebg");
curl_setopt_array($ch, [
    CURLOPT_HTTPHEADER => ["X-Api-Key: YOUR_KEY"],
    CURLOPT_POSTFIELDS => ["image_file" => new CURLFile("/path/to/photo.jpg"), "size" => "auto"],
    CURLOPT_RETURNTRANSFER => true,
]);
$result = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200) {
    file_put_contents("no-bg.png", $result);
} else {
    echo "Error: " . $result;
}

Ruby

require "net/http"

uri = URI("https://api.cutmatte.com/v1.0/removebg")
req = Net::HTTP::Post.new(uri, "X-Api-Key" => "YOUR_KEY")
req.set_form([["image_file", File.open("/path/to/photo.jpg")], ["size", "auto"]], "multipart/form-data")
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
if res.is_a?(Net::HTTPSuccess)
  File.binwrite("no-bg.png", res.body)
else
  puts "Error: #{res.body}"
end

Libraries and tools

npm remove.bg

Version 1.3.0 has the address built in. Change it in one line after installing (repeat after reinstalling, or save it with patch-package):

sed -i.bak 's#https://api.remove.bg#https://api.cutmatte.com#' node_modules/remove.bg/dist/index.js

All three functions (removeBackgroundFromImageFile, ...Url, ...Base64), the result fields and the error arrays work unchanged. Or drop the package and use the Node.js example above.

PyPI removebg

from removebg import RemoveBg
from removebg import removebg as removebg_module

removebg_module.API_ENDPOINT = "https://api.cutmatte.com/v1.0/removebg"
rmbg = RemoveBg("YOUR_KEY", "error.log")
rmbg.remove_background_from_img_file("photo.jpg")

remove.bg command-line tool

In lib/functions.js of remove-bg-cli, replace https://api.remove.bg/v1.0/removebg with https://api.cutmatte.com/v1.0/removebg. The tool downloads ZIP results and joins them into PNG; that works with Cutmatte, background colours and images included.

What we test

We run the npm package remove.bg 1.3.0, the PyPI package removebg 0.4, remove.bg's command-line tool and the cURL, Node.js and Python samples from remove.bg's API page against Cutmatte: 34 of 34 checks pass. Using another client? Write to support@cutmatte.com and we will test it.

Free credits for remove.bg users

Unused remove.bg credits expire when its API closes. Send a screenshot of your remaining balance from your Cutmatte dashboard and get the same number of free Cutmatte credits, up to 1,000, once per account. We check each screenshot by hand. The offer runs until 31 December 2026.

Things to check

Get a free API keyRead the docs