Remove background

by Rembg

rembg/remove-background

Remove an image background.

Billed per
image
Price
Price: —
Provider
Rembg
Timeout
2 min

Overview

Submits an image to the background removal service and returns a generated PNG image URL after completion.

A generated PNG image URL and provider information.

Input

These go in the input object of the run request.

FieldTypeRequiredDescription
imagestringYesPublic image URL or image data URI.

Requests up to 14 MB.

Example

Use your own API key and a saved idempotency key for each new job. Replace image or media placeholders with your own publicly reachable HTTPS URLs. Keep the same key and request body when recovering a timeout.

# Set once per job; reuse this key and the identical body after a timeout.
: "${AGENTSKY_IDEMPOTENCY_KEY:?Set a unique, saved key for this job}"
curl --fail-with-body https://gateway.agentsky.dev/v1/run \
  -H "authorization: Bearer $AGENTSKY_API_KEY" \
  -H "content-type: application/json" \
  -H "Idempotency-Key: $AGENTSKY_IDEMPOTENCY_KEY" \
  -d '{"provider":"rembg","endpoint":"remove-background","input":{"image":"https://example.com/photo.png"}}'
# If status is READY/RUNNING, poll GET /v1/runs/{runId} with the same API key.

Pricing

— per image using your plan when signed in. Read the final customer charge from price.amount.value after the run finishes. A RUNNING response is not the final bill.

Questions