Upload an image; the AI removes the background and returns a transparent PNG. Synchronous — usually a few seconds.
Authentication & request
X-Api-Key: YOUR_API_KEY request header. Create and manage keys on your account page.
| Parameter | Type | Required | Description |
|---|---|---|---|
image_file
|
file | required* | Image to process, multipart upload. JPG / PNG / WebP, up to 20MB |
image_url
|
string | required* | Or a public image URL (provide one of image_file / image_url) |
size
|
string | optional | preview (free, watermarked) / full (HD, 1 credit) / auto. Default preview |
format
|
string | optional | auto (PNG if transparent, otherwise JPG — default) / png / jpg |
bg_color
|
string | optional | Result background: transparent (default) / white / any #RRGGBB |
Code samples
Pick a language and copy — runs as-is.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);
Response
1{2 "url": "https://cdn.pixmiller.com/result/8Kd2pQ.png"3}
url
Temporary URL of the processed image (the underlying image is auto-deleted after 3 days).
Errors
Errors return the matching status code and a JSON body shaped like {"errors":{"code":"…","message":"…"}}.
validation error
Missing or invalid image_file, file too large, or conflicting image sources.
authentication_failed
The X-Api-Key header is missing or invalid.
not_enough_credit
size=full was requested but the account has no HD credits left.
invalid_image
The image could not be processed — too small, unsupported, or failed to decode.
throttled
Rate limit exceeded. Slow down and retry after the Retry-After header.