Загрузите изображение; ИИ удаляет фон и возвращает прозрачный PNG. Синхронно — обычно несколько секунд.
Аутентификация и запрос
X-Api-Key: YOUR_API_KEY. Создавайте и управляйте ключами на странице аккаунта.
| Параметр | Тип | Обязательный | Описание |
|---|---|---|---|
image_file
|
file | обязательный* | Изображение для обработки, multipart-загрузка. JPG / PNG / WebP, до 20 МБ |
image_url
|
string | обязательный* | Или публичный URL изображения (укажите image_file или image_url) |
size
|
string | необязательный | preview (бесплатно, с водяным знаком) / full (HD, 1 кредит) / auto. По умолчанию preview |
format
|
string | необязательный | auto (PNG при прозрачности, иначе JPG — по умолчанию) / png / jpg |
bg_color
|
string | необязательный | Фон результата: transparent (по умолчанию) / white / любой #RRGGBB |
Примеры кода
Выберите язык и скопируйте — работает сразу.1curl -X POST "https://api.pixmiller.com/v1/remove" \2 -H "X-Api-Key: YOUR_API_KEY" \3 -F "[email protected]" \4 -F "size=full"
1import requests23resp = requests.post(4 "https://api.pixmiller.com/v1/remove",5 headers={"X-Api-Key": "YOUR_API_KEY"},6 files={"image_file": open("product.jpg", "rb")},7 data={"size": "full"},8)9print(resp.json()["url"])
1import fs from "node:fs";23const form = new FormData();4form.append("image_file", new Blob([fs.readFileSync("product.jpg")]), "product.jpg");5form.append("size", "full");6const resp = await fetch("https://api.pixmiller.com/v1/remove", {7 method: "POST",8 headers: { "X-Api-Key": "YOUR_API_KEY" },9 body: form,10});11console.log((await resp.json()).url);
Ответ
1{2 "url": "https://cdn.pixmiller.com/result/8Kd2pQ.png"3}
url
Временный URL обработанного изображения (исходное изображение автоматически удаляется через 3 дня).
Ошибки
Ошибки возвращают соответствующий код статуса и JSON-тело в формате {"errors":{"code":"…","message":"…"}}.
validation error
Отсутствует или неверный image_file, файл слишком большой, или конфликтующие источники изображений.
authentication_failed
Заголовок X-Api-Key отсутствует или неверен.
not_enough_credit
Запрошен size=full, но на аккаунте не осталось HD-кредитов.
invalid_image
Изображение не удалось обработать — слишком маленькое, неподдерживаемый формат или ошибка декодирования.
throttled
Превышен лимит запросов. Снизьте частоту и повторите после заголовка Retry-After.
Migrating from remove.bg
Change the base URL — your existing request keeps working.POST /v1.0/removebg — same X-Api-Key header, same parameter names, HTTP 200 with the image bytes in the body. A matching GET /v1.0/account returns your credit balance.
1curl -H "X-Api-Key: REMOVEBG_KEY" \2 -F "[email protected]" \3 -F "size=auto" \4 -o out.png \5 https://api.remove.bg/v1.0/removebg
1curl -H "X-Api-Key: PIXMILLER_KEY" \2 -F "[email protected]" \3 -F "size=auto" \4 -o out.png \5 https://api.pixmiller.com/v1.0/removebg
| remove.bg value | PixMiller tier | Описание |
|---|---|---|
preview / small / regular
|
preview | Watermarked preview, up to 640 px. Free — no credit charged. This is the default, as on remove.bg. |
medium / hd / 4k / full / 50MP
|
full | Full-resolution, watermark-free result, downscaled to the tier's megapixel cap (1.5 / 4 / 25 / 25 / 50 MP; PNG output is capped at 10 MP). 1 credit per image. |
auto
|
auto | Full resolution when credits are available, free watermarked preview otherwise. |
X-Credits-Charged
Credits actually deducted by this call (0 for the free preview tier).
X-Width / X-Height
Pixel dimensions of the returned image.
X-Type
Detected foreground class: person, product, animal, car or other (omitted with type_level=none).
X-Foreground-Top / -Left / -Width / -Height
Bounding box of the subject in the returned image.
X-RateLimit-Limit / -Remaining / -Reset
Rate limit state for your key, counted per image — one call uses one unit; Retry-After is added on 429.
Every remove.bg parameter is accepted and validated — size, type, type_level, format, roi, crop, crop_margin, scale, position, channels, bg_color, bg_image_url and bg_image_file behave as documented by remove.bg. These are accepted but never change the output, as on remove.bg for non-car subjects:
shadow_type, shadow_opacity, add_shadow, semitransparency
- size=preview (and its aliases small / regular — the default, as on remove.bg) returns our free, watermarked preview at up to 640 px and costs no credit; remove.bg returns a 0.25-megapixel image without watermark for 0.25 credits.
- medium, hd, 4k, full and 50MP all cost 1 credit, as on remove.bg. There is no free monthly preview quota, so /v1.0/account always reports free_calls = 0.
- X-Type is a coarse class (person / product / animal / car / other) derived from the segmentation model that was used; type_level = 2 and latest return the same coarse classes.
- Shadows (shadow_type / shadow_opacity / add_shadow) and car-window semitransparency are accepted but never rendered — as on remove.bg for non-car subjects.
- Input files are limited to 20 MB (remove.bg: 22 MB).
Errors on this endpoint use the remove.bg JSON:API envelope {"errors":[{"title":"…","code":"…"}]}
with 400 invalid_parameter / 402 insufficient_credits / 403 auth_failed / 429 rate_limit_exceeded.
This is a compatibility layer for the main HTTP path, not a certified drop-in for the official SDKs or CLI.