apyhub

Remove Background from Images API

Hosted on ApyHub

What it does

Background Remover removes the background from an image and returns either a PNG download or a signed file URL. Send a raster image directly as multipart form data, or provide an image_url to fetch the source image first.

Use the multipart endpoints when you already have the file in hand, and the URL endpoints when the image lives elsewhere. In both cases, you can choose the output mode with the output query parameter. The download variants return binary PNG data, while the link variants return a response object containing data as a URI.

This is a good fit for product photos, profile pictures, catalog imagery, and any workflow that needs a clean cutout without building background-removal logic yourself. You can place the result on a transparent canvas, layer it into a design, or pass the signed URL to downstream storage and delivery steps.

Background Remover keeps the API surface small: one required input image, one optional output selector, and a predictable response shape. That makes it straightforward to wire into upload flows, batch image pipelines, and internal tools that need consistent background-free assets.

▣ ENDPOINT 01 / 04
POST
Remove image background
https://api.eu.apyhub.com/apyhub/remove-background-from-images/multi-part/download

QUICKSTART

GUIDE

Quickstart

Upload an image to remove its background and download the result.

curl -X POST "https://api.eu.apyhub.com/apyhub/remove-background-from-images/multi-part/download" \
  -H "apy-token: $APY_TOKEN" \
  -F "image=@/path/to/image.jpg"

What you'll get back

Returns a binary file (string with format: binary) containing the processed image.

TRY ITLIVE · 1000 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
Input raster image.

About this endpoint

What it does

Removes the background from the uploaded raster image and returns the processed result as a PNG download. The request sends the input image as multipart form data; the response is a binary file.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOptional output name value. No format constraints are declared beyond being a string.

Request Body

ParameterTypeMandatoryDescription
imageStringYesInput raster image, provided as binary upload.

Response

Returns a binary file response. The output schema is a single String with format: binary, so the success payload is the processed image file rather than a JSON object.

ParameterTypeMandatoryDescription
binary fileStringYesProcessed image content returned as a download.

Query parameters

Name
Type
Description
outputOPTIONAL
string

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 02 / 04
POST
Remove image background
https://api.eu.apyhub.com/apyhub/remove-background-from-images/multi-part/link

QUICKSTART

GUIDE

Quickstart

Upload an image URL to remove its background and return the result link.

curl -X POST "https://api.eu.apyhub.com/apyhub/remove-background-from-images/multi-part/link" \
  -H "apy-token: $APY_TOKEN" \
  -F "image=@/path/to/image.jpg"

What you'll get back

Returns a JSON object with a data string field containing a URI to the processed image.

{
  "data": "https://example.com/processed-image.png"
}
TRY ITLIVE · 1000 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*

About this endpoint

What it does

Removes the background from an uploaded image sent as multipart form data and returns a JSON object containing a URI in data. The request also accepts an optional output query parameter.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOutput name/identifier. Example: my-invite.

Request Body

ParameterTypeMandatoryDescription
imageStringYesImage file to process. Format: binary.

Response

Returns a JSON object with a data string field containing a URI. The success response schema is an object with one top-level field: data (String).

ParameterTypeMandatoryDescription
dataStringNoURI returned by the endpoint. Format: URI.

Query parameters

Name
Type
Description
outputOPTIONAL
string

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 03 / 04
POST
Remove image background
https://api.eu.apyhub.com/apyhub/remove-background-from-images/url/download

QUICKSTART

GUIDE

Quickstart

Send the source image URL to remove its background and download the result.

curl -X POST "https://api.eu.apyhub.com/apyhub/remove-background-from-images/url/download" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"image_url":"https://assets.apyhub.com/samples/background-sample.jpeg"}'

What you'll get back

Returns a binary file response (string with format: binary) containing the processed image.

TRY ITLIVE · 1000 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
URL mode for remove-background only. Requires `image_url`.
Source image URL.

About this endpoint

What it does

Fetches an image from the URL you provide, removes its background, and returns the resulting file as binary PNG data.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOptional output name.

Request Body

ParameterTypeMandatoryDescription
image_urlStringYesSource image URL. Must be a URI.

Response

Returns a binary file response containing the processed image in PNG format.

Query parameters

Name
Type
Description
outputOPTIONAL
string

Body

Name
Type
Description
bodyREQUIRED
object
URL mode for remove-background only. Requires `image_url`.
▣ ENDPOINT 04 / 04
POST
Remove image background
https://api.eu.apyhub.com/apyhub/remove-background-from-images/url/link

QUICKSTART

GUIDE

Quickstart

Remove the background from an image by sending its source URL.

curl -X POST "https://api.eu.apyhub.com/apyhub/remove-background-from-images/url/link" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"image_url":"https://assets.apyhub.com/samples/background-sample.jpeg"}'

What you'll get back

Returns a JSON object with a data string field containing the output image URI.

{
  "data": "https://..."
}
TRY ITLIVE · 1000 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
URL mode for remove-background only. Requires `image_url`.
Source image URL.

About this endpoint

What it does

Fetches an image from the image_url provided in the request body, removes its background, and returns a JSON object containing a data URI string for the result.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOptional output identifier.

Request Body

ParameterTypeMandatoryDescription
image_urlStringYesSource image URL. Must be a URI.

Response

Returns a JSON object with a data string field containing a URI. This is the success payload for the endpoint.

ParameterTypeMandatoryDescription
dataStringNoURI of the processed result.

Query parameters

Name
Type
Description
outputOPTIONAL
string

Body

Name
Type
Description
bodyREQUIRED
object
URL mode for remove-background only. Requires `image_url`.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.