Skip to main content

Remove BG

Purpose​

Removes the background from an uploaded image and returns a transparent PNG. This is the same feature as the web app's "Remove BG" page.

Credit cost: 1

Method and Path​

POST /public/v1/image-tune/remove-background

Authentication​

See the Authentication page. Bearer token is required.

Required Headers:

Authorization: Bearer {your_api_key}

Request Fields​

Send the request as multipart/form-data.

Field NameTypeRequiredDescription
imagefileYesImage whose background is removed (PNG or JPEG)

Response​

Success Response (200 OK):

{
"job_id": "uuid-string"
}
FieldTypeDescription
job_idstringUnique identifier for the created job. Use Get Job Status to retrieve results

Error / Validation Rules​

ConditionHTTP StatusError Message
Image is not a valid PNG or JPEG file400"Invalid image file"
Invalid API key401"Invalid API key"
Missing field422Validation error

Async Job Behavior​

This endpoint creates an asynchronous job. It immediately returns a job_id, and background removal runs in the background.

Polling Method:

  1. Save the job_id received in the response
  2. Poll GET /public/v1/job/{job_id} to check status
  3. When status becomes Succeed, check the result image in image_urls

Status Flow: Pending → Succeed or Failed

Example Request​

cURL:

curl -X POST "https://api.aetherforgeai.com/public/v1/image-tune/remove-background" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "image=@/path/to/character.png"