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>Optional params: extractor (images), video_background and video_output (videos).
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 (no processing). Video processing requires authentication (cookie session or API key) to control costs.
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.webmUse video_background=White (or Green) with video_output=mp4_h264 for a solid-background MP4. Transparent output uses video_output=auto (server picks a compatible codec).
{
"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