NoBG API

Background removal you can script. Previews are free. HD costs 1 credit per image (videos are billed by length).

Sign in
Quickstart

Send an image or video, get a cutout back.

Beta
Endpoint
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).

Preview (free)
curl -sS \
  -F "file=@./input.jpg" \
  "https://nobg.dev/api/remove-background?mode=preview" \
  | jq -r '.imageBase64' \
  | base64 --decode > out.png
Video quote
curl -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.

HD

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.png
curl -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.webm

Use 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).

Response
{
  "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
}
API keys

Use keys for scripts, CI jobs, and integrations. Keys are shown once.

Sign in to generate an API key.

Sign in