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.
api.remove.bg stop working. Switch here with a two-line change and keep your code.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>
Your requests stay as they are. Only the address and the credentials change.
https://api.remove.bg to https://remove-bg-di.shortpixel.comX-Api-Key header, from your remove.bg key to your ShortPixel API key/v1.0/removebg and /v1.0/account endpointssize, format, bg_color, channels and the restresult_b64) responses, plus the X-Credits-Charged, X-Width, X-Height and X-Type headers{"errors": [...]} body and HTTP status codes, so your error handling and retries keep workingRed lines are your remove.bg code. Green lines replace them. The copy button gives you the finished version.
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
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)
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$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);
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.
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.
What your remove.bg request can send, and what comes back.
POST /v1.0/removebg| Parameter | Values | Status |
|---|---|---|
image_file, image_file_b64, image_url | One image source per request. JPG, PNG or WebP, up to 22 MB and 50 megapixels | Supported |
size | preview (default), full, 50MP, auto. The older small, regular, medium, hd and 4k values work too | Supported |
format | auto (default), png, jpg, webp, zip (returns color.jpg and an alpha.png mask) | Supported |
type, type_level | auto, person, product, animal, car, graphic, transportation. type_level: none, 1, 2, latest | Supported |
channels | rgba (finished image) or alpha (mask only) | Supported |
bg_color | Hex code or color name, for example 81d4fa, fff or green. 4- and 8-digit hex codes add transparency | Supported |
bg_image_url, bg_image_file | Background image, centered and resized to fill the canvas | Supported |
Accept: application/json | Returns {"data": {"result_b64": "..."}} instead of a binary file | Supported |
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.
X-Credits-Charged | Credits charged for the call |
X-Width, X-Height | Size of the result, in pixels |
X-Type | Detected foreground type (omitted when type_level=none) |
Content-Type | image/png, image/jpeg, image/webp or application/zip |
GET /v1.0/account returns your balance in the same
data.attributes.credits shape as remove.bg, so balance checks and alerts keep working.
400 | Invalid parameters or image, e.g. missing_source, file_too_large, invalid_size |
402 | Not enough credits |
403 | Missing or invalid API key (auth_failed) |
405 | Wrong HTTP method |
429 | Too many requests. Honor Retry-After when present |
5xx | Temporary error. Retry with an increasing delay |
Background removal is one more tool in an account that already handles your images.
Two values change. Your request building, response parsing, retries and tests stay as they are.
The same ShortPixel account also gives you image compression, WebP/AVIF conversion, upscaling and an image CDN.
With the Unlimited AI plan, background removal has no per-image cost. The free plan includes 100 AI credits a month to test first.
Every response tells you its cost in X-Credits-Charged, and /v1.0/account gives you the balance.
Our team answers 24/7, for free and paying accounts alike. Stuck on the migration? Write to us.
Drop a few of your own images into the free online background remover and check the results first.
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.
Pay per image
$15.99/month
or $13.33/month billed yearly ($159.90/year)
Not ready to upgrade? The free plan includes 100 AI credits a month, so you can test your integration first.
Create a free ShortPixel account. Your key is in your account, under API Keys.
Replace https://api.remove.bg with https://remove-bg-di.shortpixel.com.
Send your ShortPixel API key in the X-Api-Key header, ideally from an environment variable.
Process a handful of real images, check the output and X-Credits-Charged, then deploy.
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.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.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.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.X-Credits-Charged header with the cost of that call, and GET /v1.0/account returns your balance.Create a free account, swap the URL and the key, and run your first image.