Migrating from remove.bg

Your remove.bg code,
now powered by ShortPixel.

ShortPixel AI Background Removal accepts the same requests as the remove.bg API and answers the same way. Point your integration at a new base URL, use your ShortPixel API key, and the rest of your code keeps working.

remove.bg is shutting down its self-serve API on December 1, 2026. After that date, calls to api.remove.bg stop working. Switch here with a two-line change and keep your code.
the whole migration
POST https://api.remove.bg/v1.0/removebgPOST https://remove-bg-di.shortpixel.com/v1.0/removebgX-Api-Key: <your remove.bg key>X-Api-Key: <your ShortPixel API key>
Endpoint paths, parameters, response headers and error codes stay the same.

What changes, and what doesn't

Your requests stay as they are. Only the address and the credentials change.

You change

  • The base URL, from https://api.remove.bg to https://remove-bg-di.shortpixel.com
  • The API key in the X-Api-Key header, from your remove.bg key to your ShortPixel API key

You keep

  • The /v1.0/removebg and /v1.0/account endpoints
  • Parameter names and values: size, format, bg_color, channels and the rest
  • Binary or JSON (result_b64) responses, plus the X-Credits-Charged, X-Width, X-Height and X-Type headers
  • The {"errors": [...]} body and HTTP status codes, so your error handling and retries keep working

The change, in your language

Red lines are your remove.bg code. Green lines replace them. The copy button gives you the finished version.

Shell
curl -f -H "X-Api-Key: $REMOVE_BG_API_KEY" \curl -f -H "X-Api-Key: $SHORTPIXEL_API_KEY" \  -F "image_file=@photo.jpg" \  -F "size=auto" \  -o no-bg.png \  https://api.remove.bg/v1.0/removebg  https://remove-bg-di.shortpixel.com/v1.0/removebg
Python (requests)
import osimport requests with open("photo.jpg", "rb") as image:    response = requests.post(        "https://api.remove.bg/v1.0/removebg",        "https://remove-bg-di.shortpixel.com/v1.0/removebg",        files={"image_file": image},        data={"size": "auto"},        headers={"X-Api-Key": os.environ["REMOVE_BG_API_KEY"]},        headers={"X-Api-Key": os.environ["SHORTPIXEL_API_KEY"]},        timeout=120,    ) if response.status_code != 200:    raise RuntimeError(response.json()["errors"][0]["title"]) with open("no-bg.png", "wb") as out:    out.write(response.content)
Node.js 18+ (built-in fetch)
import { readFile, writeFile } from 'node:fs/promises'; const form = new FormData();form.append('image_file', new Blob([await readFile('photo.jpg')]), 'photo.jpg');form.append('size', 'auto'); const res = await fetch('https://api.remove.bg/v1.0/removebg', {const res = await fetch('https://remove-bg-di.shortpixel.com/v1.0/removebg', {  method: 'POST',  headers: { 'X-Api-Key': process.env.REMOVE_BG_API_KEY },  headers: { 'X-Api-Key': process.env.SHORTPIXEL_API_KEY },  body: form,}); if (!res.ok) {  const { errors } = await res.json();  throw new Error(errors[0].title);}await writeFile('no-bg.png', Buffer.from(await res.arrayBuffer()));
PHP (cURL extension)
<?php$ch = curl_init('https://api.remove.bg/v1.0/removebg');$ch = curl_init('https://remove-bg-di.shortpixel.com/v1.0/removebg');curl_setopt_array($ch, [    CURLOPT_POST           => true,    CURLOPT_RETURNTRANSFER => true,    CURLOPT_HTTPHEADER     => ['X-Api-Key: ' . getenv('REMOVE_BG_API_KEY')],    CURLOPT_HTTPHEADER     => ['X-Api-Key: ' . getenv('SHORTPIXEL_API_KEY')],    CURLOPT_POSTFIELDS     => [        'image_file' => new CURLFile('photo.jpg'),        'size'       => 'auto',    ],]);$body = curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);curl_close($ch); if ($status !== 200) {    $error = json_decode($body, true);    throw new RuntimeException($error['errors'][0]['title'] ?? "HTTP $status");}file_put_contents('no-bg.png', $body);

Plugins and SDKs

If your plugin, SDK or app lets you set the API address, enter https://remove-bg-di.shortpixel.com/v1.0 as the URL and your ShortPixel API key as the key. No code changes are needed.

Zapier, Make, n8n

Using an HTTP or webhook step to call remove.bg? Open that step, replace api.remove.bg with remove-bg-di.shortpixel.com in the URL, and paste your ShortPixel key into the X-Api-Key header. Leave the other fields as they are.

Compatibility reference

What your remove.bg request can send, and what comes back.

Request: POST /v1.0/removebg

ParameterValuesStatus
image_file, image_file_b64, image_urlOne image source per request. JPG, PNG or WebP, up to 22 MB and 50 megapixelsSupported
sizepreview (default), full, 50MP, auto. The older small, regular, medium, hd and 4k values work tooSupported
formatauto (default), png, jpg, webp, zip (returns color.jpg and an alpha.png mask)Supported
type, type_levelauto, person, product, animal, car, graphic, transportation. type_level: none, 1, 2, latestSupported
channelsrgba (finished image) or alpha (mask only)Supported
bg_colorHex code or color name, for example 81d4fa, fff or green. 4- and 8-digit hex codes add transparencySupported
bg_image_url, bg_image_fileBackground image, centered and resized to fill the canvasSupported
Accept: application/jsonReturns {"data": {"result_b64": "..."}} instead of a binary fileSupported

Request bodies can be multipart/form-data, application/x-www-form-urlencoded or application/json. Does your remove.bg integration use an option that isn't listed here, such as crop, roi or shadows? Test it with one image first, or ask us.

Response headers

X-Credits-ChargedCredits charged for the call
X-Width, X-HeightSize of the result, in pixels
X-TypeDetected foreground type (omitted when type_level=none)
Content-Typeimage/png, image/jpeg, image/webp or application/zip

Account balance

GET /v1.0/account returns your balance in the same data.attributes.credits shape as remove.bg, so balance checks and alerts keep working.

Errors

400Invalid parameters or image, e.g. missing_source, file_too_large, invalid_size
402Not enough credits
403Missing or invalid API key (auth_failed)
405Wrong HTTP method
429Too many requests. Honor Retry-After when present
5xxTemporary error. Retry with an increasing delay

Read the full API documentation

Why move to ShortPixel

Background removal is one more tool in an account that already handles your images.

No rewrite

Two values change. Your request building, response parsing, retries and tests stay as they are.

One account, every image tool

The same ShortPixel account also gives you image compression, WebP/AVIF conversion, upscaling and an image CDN.

Unlimited images, flat price

With the Unlimited AI plan, background removal has no per-image cost. The free plan includes 100 AI credits a month to test first.

Transparent usage

Every response tells you its cost in X-Credits-Charged, and /v1.0/account gives you the balance.

Support from people

Our team answers 24/7, for free and paying accounts alike. Stuck on the migration? Write to us.

Try it before you code

Drop a few of your own images into the free online background remover and check the results first.

Cheaper than paying per image

remove.bg charges for every image you process. With ShortPixel Unlimited AI, you pay one flat monthly price and remove backgrounds from as many images as you need.

remove.bg API

Pay per image

  • Every full-resolution image costs 1 credit
  • The bill grows with every image you process
  • Self-serve API shuts down on December 1, 2026
Best deal

ShortPixel Unlimited AI

$15.99/month

or $13.33/month billed yearly ($159.90/year)

  • Unlimited AI background removal
  • Unlimited AI upscaling, ALT text and image SEO
  • Unlimited image optimization and WebP/AVIF conversion
  • Unlimited websites and 500 GB CDN traffic a month
Get Unlimited AI

Not ready to upgrade? The free plan includes 100 AI credits a month, so you can test your integration first.

Migrate in four steps

  1. Get your API key

    Create a free ShortPixel account. Your key is in your account, under API Keys.

  2. Change the base URL

    Replace https://api.remove.bg with https://remove-bg-di.shortpixel.com.

  3. Swap the key

    Send your ShortPixel API key in the X-Api-Key header, ideally from an environment variable.

  4. Test, then switch

    Process a handful of real images, check the output and X-Credits-Charged, then deploy.

Questions about migrating

Yes. remove.bg is closing its standalone service, and its self-serve API stops accepting requests on December 1, 2026. After that, calls to api.remove.bg will no longer work, and unused pay-as-you-go credits expire. If you want to keep your current code, switch to ShortPixel: we accept the same requests, so only the base URL and the API key change.

Two values: the base URL (https://api.remove.bg becomes https://remove-bg-di.shortpixel.com) and the API key you send in the X-Api-Key header. The endpoint paths, parameter names, response format and error codes stay the same.

The image sources (image_file, image_file_b64, image_url), size including the older size names, format, type, type_level, channels, bg_color, bg_image_url and bg_image_file, plus JSON responses via Accept: application/json. The compatibility reference above lists the values. If you rely on another option, test it with one image or contact us.

Yes, if it lets you change the API address. Enter https://remove-bg-di.shortpixel.com/v1.0 as the URL and your ShortPixel API key as the key. In Zapier, Make or n8n, edit the URL and the X-Api-Key header of the HTTP step.

Background removal uses AI credits. The free plan includes 100 AI credits a month. They reset to 100 every month, whether you used them or not, so you can test your integration at no cost. For more, the Unlimited AI plan gives you unlimited AI credits, so you can remove backgrounds from as many images as you need for one flat monthly price, instead of paying per image. Every response includes an X-Credits-Charged header with the cost of that call, and GET /v1.0/account returns your balance.

After you sign up, the key is in your ShortPixel account, under API Keys. Keep it on your server and never put it in browser or mobile app code.

Yes. The free online background remover lets you upload a few images and compare the results before you change anything in production.

Two lines, and you're done

Create a free account, swap the URL and the key, and run your first image.

ShortPixel Knowledge Base
×