Skip to main content

Developers

Remove backgrounds from your own code

Create an API key in your account, then call PixRemove from a script, a pipeline or your product. API runs use the same credits as the website.

  • 1 credit per image
  • Failed runs are free
  • Full-resolution transparent PNG

JavaScript SDK

For Node.js, Bun, Deno and Cloudflare Workers. One call uploads the image, waits for the result and returns a transparent PNG.

npm install @pixremove/sdk import { PixRemove } from '@pixremove/sdk'; const pixremove = new PixRemove({ apiKey: process.env.PIXREMOVE_API_KEY });const { data } = await pixremove.removeBackground(imageBytes);// data = transparent PNG bytes

Command line

Cut out a whole folder without writing code. Running it again skips the images already done. Used remove.bg’s command line tool? This replaces it.

export PIXREMOVE_API_KEY=pr_...npx @pixremove/cli ./photos -o ./cutouts
POST /api/v1/upload               # image bytesPOST /api/v1/remove-background    # start the runGET  /api/v1/tasks/:id            # until it succeedsGET  /api/v1/tasks/:id/cutout     # transparent PNG

Try it on your own images

Get an API key