NoBG API
Background removal you can script. Previews are free. HD costs 1 credit per image (videos are billed by length).
Send an image or video, get a cutout back.
POST /api/remove-background?mode=preview|hd
Content-Type: multipart/form-data
Body: file=<image|video>Images use Pixelcut through fal.ai. Extractor query params are ignored and are no longer a supported option. Videos can include video_background and video_output.
curl -sS \
-F "file=@./input.jpg" \
"https://nobg.dev/api/remove-background?mode=preview" \
| jq -r '.imageBase64' \
| base64 --decode > out.pngcurl -sS \
-H "Authorization: Bearer $NOBG_API_KEY" \
-F "file=@./input.mp4" \
"https://nobg.dev/api/remove-background?mode=preview&video_background=Transparent&video_output=auto" \
| jq '{durationSeconds,billedSeconds,creditsRequired,videoBackground,videoOutput}'Video preview is quote-only: it returns duration and credit estimate, but does not process the video.
For automation, use an API key in the Authorization header.
export NOBG_API_KEY="nobg_..."
curl -sS \
-H "Authorization: Bearer $NOBG_API_KEY" \
-F "file=@./input.jpg" \
"https://nobg.dev/api/remove-background?mode=hd" \
| jq -r '.imageBase64' \
| base64 --decode > out-hd.pngcurl -sS \
-H "Authorization: Bearer $NOBG_API_KEY" \
-F "file=@./input.mp4" \
"https://nobg.dev/api/remove-background?mode=hd&video_background=Transparent&video_output=auto" \
| jq -r '.video.proxyUrl' \
| xargs -I{} curl -L "{}" -o out.webmVideo HD requires authentication and enough credits for the returned billed duration. Use video_background=White (or Green) with video_output=mp4_h264 for a solid-background MP4.
{
"mediaType": "image",
"imageBase64": "....",
"contentType": "image/png",
"isHighRes": true,
"isAuthenticated": true
}{
"mediaType": "video",
"quoteOnly": true,
"durationSeconds": 4.12,
"billedSeconds": 5,
"creditsRequired": 39,
"videoBackground": "Transparent",
"videoOutput": "webm_vp9",
"isHighRes": false,
"isAuthenticated": true
}{
"mediaType": "video",
"quoteOnly": false,
"durationSeconds": 4.12,
"billedSeconds": 5,
"creditsRequired": 39,
"videoBackground": "Transparent",
"videoOutput": "webm_vp9",
"video": {
"url": "https://…",
"contentType": "video/webm"
},
"isHighRes": true,
"isAuthenticated": true
}Billing model
Previews are free. HD costs 1 credit per image. Video background removal costs credits based on billed duration (returned as creditsRequired). Buy credit packs on pricing.
Use keys for scripts, CI jobs, and integrations. Keys are shown once.
Sign in to generate an API key.
Sign in