Remove Background API : AI Background Remover for Images and Videos
Upload a photo or a clip and get the subject back without its background: a transparent PNG for images, a black-background mp4 for videos. Try it right here, then call the same model from your product with one key and one balance.
- One image or one video
- Transparent PNG, or MP4 on black
- Fixed price per task
- Same model through the API
Features
Key Remove Background API Features
Transparent PNG, original size
Send one image as image_url and get back a PNG with a transparent background at exactly the original width and height, ready to drop onto any color, layout or new scene.
Video background removal
Send video_url instead and the subject stays while everything around it turns solid black. The result is an mp4 with no transparency and no audio track, so plan your edit around a black backdrop.
Videos up to 3 minutes
Clips can run up to 3 minutes. The price is fixed per task, so a three-minute video costs the same as a three-second one or a single photo.
No prompt, no settings
There's nothing to tune: a Remove Background API request is model remove-background plus one link, which makes it easy to wire into any upload flow in your product.
Full file plus a preview
Each result comes as the original file at outputs[].url and a lighter preview at preview_url: a JPEG of up to 1024 pixels on the long side for images, a 600-pixel-wide h264 mp4 for videos.
Fast turnaround
An image takes about 30 seconds and a 10-second video about 40 seconds; a 30-second video takes about two minutes. Times are measured from creating the task to the finished result.
Overview
What Is the Remove Background API?
- Model ID
remove-background- Input
- One image or one video
- Video length
- Up to 180 s
- Price
- $0.0468 per task
The Remove Background API is an AI background remover you call over HTTP. You send a link to one image or one video, the model separates the main subject from everything behind it, and you get the subject back on its own. There is no prompt to write and no mask to draw: the file is the whole request.
On NanoAPI it's the model remove-background of the product remove_background. Images come back as transparent PNGs, the same size as the original, so they can go straight onto a product page, a slide or a design. Videos come back as mp4 files in which the background is solid black. Video output carries no alpha channel and no audio, which is worth knowing before you build on it.
Background removal runs on the same POST /v1/tasks endpoint, API key and prepaid balance as every other NanoAPI model. Each task returns exactly one result and costs one fixed price whatever the file, and a task that fails costs nothing: the reserved amount goes straight back to your balance.
Try the AI background remover in the studio at the top of this page, then call the Remove Background API at https://api.nanoapi.ai/v1 from your own app. Both use the same model at the same price, so what you see here is what your users get.
Pricing
Remove Background API Pricing
One fixed price per task, for images and videos alike: the length of the video doesn't change it, and a failed task is refunded in full.
| Price | |
|---|---|
| Per task | $0.0468 |
cost = the price per task, whatever the file
How it works
How to Use the Remove Background API
- 1
Step 1: Get your API key
Sign in to NanoAPI with Google and create a key on the API Keys page of the console. It authenticates every Remove Background API request, so keep it on your server.
- 2
Step 2: Top up your balance
Add funds on the Top up page of the console. The balance is prepaid in USD, never expires and is shared by every NanoAPI model, image and video alike.
- 3
Step 3: Create a task
Send POST /v1/tasks with model remove-background and either image_url or video_url: one public http(s) link that downloads directly. Send exactly one of the two; both or neither returns 400 invalid_request.
- 4
Step 4: Get the result
Receive the finished task once at your webhook_url, or poll GET /v1/tasks/{task_id} every 15 seconds or more. The cut-out is at outputs[].url: a PNG for an image, an mp4 for a video.
Why NanoAPI
Why Use the Remove Background API on NanoAPI
One key, every model
The same API key and balance call background removal, upscaling, outpainting, video reframing and the image and video generation models, all through POST /v1/tasks with one task object.
Fixed price, failures free
Every Remove Background API task costs the same, image or video, short or long. If the file can't be read or the task fails, the reserved amount goes back to your balance.
Webhooks or polling
Pass a webhook_url and receive the finished task once, signed to the Standard Webhooks spec (verifying is optional), or poll one task or a batch of task ids.
Safe retries and spend limits
Send an Idempotency-Key and a resent request returns the task it already created instead of charging twice. Cap each key's hourly, daily or total spending in the console.
A console for every request
See each request with its status, input, cost and result, your daily usage by product and every movement of your balance, and manage keys and the webhook secret.
Try online, then integrate
The studio on this page runs the same model at the same price, so you can test your own photos and clips before writing code. The docs also come as one llms.txt file for AI coding assistants.
Use cases
What You Can Build With the Remove Background API
Product photos for e-commerce
Turn supplier shots into clean transparent PNGs, then place them on white, on brand colors or in seasonal scenes for listings, ads and marketplaces.
Avatars and profile pictures
Let users upload a selfie and cut it out automatically for avatars, team pages, stickers or ID-style photos on a plain color.
One-click tools in your app
Add a background remover button to a photo editor, a slide maker or a print-on-demand flow: the user uploads, your server calls the Remove Background API, and the PNG lands on the canvas.
Subjects cut out of video
Pull a speaker, a dancer or a product out of a clip of up to 3 minutes and get it back on solid black, for short-form edits and dark-themed promos.
FAQ
Remove Background API FAQ
Can’t find what you need? Write to us.
01What is the Remove Background API?
An HTTP API that removes the background from an image or a video. On NanoAPI you send POST /v1/tasks with model remove-background and one image_url or video_url, then get the result by webhook or by polling: a transparent PNG for an image, a black-background mp4 for a video.
02How much does it cost to remove a background?
One fixed price per task, the same for a photo and for a video of any length up to 3 minutes. It's reserved when the task is created and charged when it succeeds; a failed task is refunded in full. The live price is in the table above, on the pricing page and in GET /v1/products.
03Do video results have a transparent background?
No. Video results are mp4 files in which the background is replaced by solid black, with no alpha channel and no audio track. Image results are different: they're PNGs with a real transparent background.
04How long can the video be?
Up to 3 minutes. A longer video fails when it's submitted for processing, with video_too_long, and the reserved amount is refunded in full.
05What do the results look like?
An image result is a PNG at the same width and height as the original. Every result also has a preview_url for showing it on a web page: a JPEG of up to 1024 pixels on the long side for images, a compressed 600-pixel-wide mp4 for videos. All links are public and don't expire.
06How long does background removal take?
About 30 seconds for an image. Videos depend on their length: about 40 seconds for a 10-second clip and about two minutes for a 30-second one. It can take longer when the service is busy.
07What happens if my file can't be used?
The file is read when the task runs. If it can't be downloaded or isn't an image or a video, the task fails with invalid_media; if moderation refuses it, with content_policy. Either way the reserved amount goes back to your balance. Use a public http(s) link that downloads directly.
08Can I try it online before integrating?
Yes. Sign in with Google and use the studio at the top of this page: it runs the same model at the same price as the Remove Background API and draws on the same balance, so you can check results and costs before you write any code.
Start Using the Remove Background API
Clean up a photo or a clip in the studio above, then bring the same AI background remover into your product with a single API call.