API guide · deadline 1 December 2026
Migrating from the remove.bg API
The remove.bg self-service API stops accepting requests on 1 December 2026. Here are the remove.bg parameters mapped to their Deep-Image equivalents, and the same call before and after.
Create a free account and copy your key from My profile → API. Every sample on this page was run against the live API.
At a glance
Endpoint
POST api.remove.bg
POST deep-image.ai
Auth header
X-Api-Key:
x-api-key:
Response
image bytes
{"status": "complete",
JSON with a result URL
The one change every integration needs: remove.bg answers with the image file, Deep-Image answers with JSON and the image is at result_url.
remove.bg
200 OK · image/png
Deep-Image
200 OK · application/json
{
"status": "complete",
"job": "c59857c0-…",
"result_url": "https://…/no-bg.png"
}Synchronous · closest to remove.bg
POST/rest_api/process_result
Waits for the job (up to about 25 seconds) and returns result_url. If it takes longer, status is not complete: poll the result.
Asynchronous · batches
POST/rest_api/process
Answers at once with a job id. Add "webhooks": {"complete": "https://…"} to get the result posted to you.
Polling
GET/rest_api/result/{job}
Returns the job status and, once complete, its result_url.
Base URL https://deep-image.ai/rest_api. Send JSON, or multipart form data with the image in any file field and the other parameters as a JSON string in a field named parameters.
Parameter mapping
Request
Auth and how the image is sent
X-Api-Key headerx-api-key headerSame header; use your Deep-Image API key.
image_filemultipart file field (any name)Send other parameters as JSON in a multipart field called parameters.
image_urlurlAny public image URL.
image_file_b64urlAs a data URL: "data:image/jpeg;base64,…".
Background
What happens to the background
typebackground.removeauto → "auto", person → "human", product / car / animal / transportation → "item".
bg_colorbackground.colorHex with a leading # ("#81d4fa") or a colour name ("white").
bg_image_urlbackground.replaceURL of the new background image.
Output
Format, framing and size
formatoutput_format"png", "jpg" or "webp". Use "png" or "webp" to keep transparency.
crop + crop_marginfit: {"crop": "item"} + paddingpadding in pixels (40) or percent ("10%").
sizewidth / heightOutput is always full resolution. Set width or height to resize; a larger value upscales in the same call.
Before and after
Remove the background from a local file and save a transparent PNG. Pick your language.
curl -H "X-Api-Key: $REMOVE_BG_API_KEY" \
-F "image_file=@photo.jpg" \
-F "size=auto" \
-f https://api.remove.bg/v1.0/removebg -o no-bg.pngrm -f job.json
curl -sf https://deep-image.ai/rest_api/process_result \
-H "x-api-key: $DEEP_IMAGE_API_KEY" \
-F "image=@photo.jpg" \
-F 'parameters={"background": {"remove": "auto"}, "output_format": "png"}' \
-o job.json
if [ ! -s job.json ]; then
echo "Request failed" >&2
elif [ "$(jq -r .status job.json)" = "complete" ]; then
curl -sf -o no-bg.png "$(jq -r .result_url job.json)"
else
echo "Still processing, poll GET /rest_api/result/$(jq -r .job job.json)"
fiimport os
import requests
response = requests.post(
"https://api.remove.bg/v1.0/removebg",
headers={"X-Api-Key": os.environ["REMOVE_BG_API_KEY"]},
files={"image_file": open("photo.jpg", "rb")},
data={"size": "auto"},
)
response.raise_for_status()
with open("no-bg.png", "wb") as out:
out.write(response.content)import json
import os
import requests
with open("photo.jpg", "rb") as image:
response = requests.post(
"https://deep-image.ai/rest_api/process_result",
headers={"x-api-key": os.environ["DEEP_IMAGE_API_KEY"]},
files={"image": image},
data={"parameters": json.dumps({
"background": {"remove": "auto"},
"output_format": "png",
})},
)
response.raise_for_status()
job = response.json()
if job["status"] == "complete":
result = requests.get(job["result_url"])
result.raise_for_status()
with open("no-bg.png", "wb") as out:
out.write(result.content)
else:
print("Still processing, poll GET /rest_api/result/" + job["job"])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 response = await fetch("https://api.remove.bg/v1.0/removebg", {
method: "POST",
headers: { "X-Api-Key": process.env.REMOVE_BG_API_KEY },
body: form,
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
await writeFile("no-bg.png", Buffer.from(await response.arrayBuffer()));import { readFile, writeFile } from "node:fs/promises";
const form = new FormData();
form.append("image", new Blob([await readFile("photo.jpg")]), "photo.jpg");
form.append("parameters", JSON.stringify({
background: { remove: "auto" },
output_format: "png",
}));
const response = await fetch("https://deep-image.ai/rest_api/process_result", {
method: "POST",
headers: { "x-api-key": process.env.DEEP_IMAGE_API_KEY },
body: form,
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
const job = await response.json();
if (job.status === "complete") {
const result = await fetch(job.result_url);
if (!result.ok) throw new Error(`download failed: ${result.status}`);
await writeFile("no-bg.png", Buffer.from(await result.arrayBuffer()));
} else {
console.log(`Still processing, poll GET /rest_api/result/${job.job}`);
}Remove the background and upscale
remove.bg has no upscaling. Add width or height to a background removal request and the cutout is upscaled in the same job, for 1 credit. A percentage such as "400%" scales relative to the input.
curl -s https://deep-image.ai/rest_api/process_result \
-H "x-api-key: $DEEP_IMAGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://deep-image.ai/api-example2.jpg",
"background": {"remove": "auto"},
"width": 2048,
"output_format": "png"
}'{
"status": "complete",
"job": "c59857c0-c0a3-11f1-a1a1-9638fcd7d474",
"result_url": "https://neuroapi-store.s3…/0254be37-….png"
}Asynchronous with a webhook
Your app
POSTs to /rest_api/process with webhooks.complete.
Deep-Image
Answers at once with a job id, then processes the image.
Your webhook
Receives job, status and result_url.
Download
Fetch result_url and store the image.
curl -s https://deep-image.ai/rest_api/process \
-H "x-api-key: $DEEP_IMAGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://deep-image.ai/api-example2.jpg",
"background": {"remove": "auto", "color": "#ffffff"},
"output_format": "jpg",
"webhooks": {"complete": "https://example.com/deep-image-webhook"}
}'{
"job": "ff4620ba-c0a3-11f1-ac5a-a63afc00aaa0",
"status": "complete",
"result_url": "https://neuroapi-store.s3…/result.jpg",
"data": { … the parameters you sent … }
}No public endpoint?
Skip the webhook and poll the job with its job id until status is complete, then download result_url.
curl -s https://deep-image.ai/rest_api/result/$JOB \
-H "x-api-key: $DEEP_IMAGE_API_KEY"Need a hand?
Our support team helps with migrations: send us your current remove.bg call and we will reply with the Deep-Image equivalent. Full API reference: documentation.deep-image.ai. Comparing providers? See Deep-Image vs remove.bg.
remove.bg, Photoroom, Canva and Leonardo.Ai are trademarks of their respective owners. Deep-Image is not affiliated with or endorsed by them. Competitor prices and limits were checked on 5 October 2026 and may change.