Skip to main content
POST
/
v1
/
remove-bg
POST /v1/remove-bg — Remove Backgrounds via API
curl --request POST \
  --url https://api.example.com/v1/remove-bg \
  --header 'Content-Type: application/json' \
  --data '
{
  "image": "<string>"
}
'
{
  "success": true,
  "image_url": "<string>",
  "request_id": "<string>",
  "credits_used": 123
}

Documentation Index

Fetch the complete documentation index at: https://docs.artnex.app/llms.txt

Use this file to discover all available pages before exploring further.

The /v1/remove-bg endpoint detects and removes the background from any image, returning a transparent PNG. Use it to isolate subjects for compositing, e-commerce product photos, profile images, or any workflow that requires a clean cutout.

Endpoint

POST https://api.artnex.ai/v1/remove-bg

Request parameters

image
string
required
The image from which to remove the background. Provide either:
  • A publicly accessible HTTPS URL pointing to the image, or
  • A base64-encoded image string with a data URI prefix (e.g., data:image/jpeg;base64,...).
Supported input formats: JPEG, PNG, WebP. Maximum file size: 10 MB. The response is always a PNG with an alpha channel.

Response fields

success
boolean
required
true when the request completed successfully.
image_url
string
required
Direct HTTPS URL to the transparent PNG output. Available for 24 hours; download promptly if you need to keep the result.
request_id
string
Unique identifier for this request.
credits_used
integer
Credits deducted from your account balance. Background removal costs 10 credits per request.

Credit cost

OperationCredits
Background removal10

Example requests

curl --request POST \
  --url https://api.artnex.ai/v1/remove-bg \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "image": "https://example.com/product-on-table.jpg"
  }'

Example response

{
  "success": true,
  "image_url": "https://cdn.artnex.ai/removebg/req_rbg_abc123xyz/output.png",
  "request_id": "req_rbg_abc123xyz",
  "credits_used": 10
}

Error codes

HTTP statusError codeCause
400missing_imageThe image field is absent
400invalid_image_formatThe image format is not supported or the file is corrupt
400image_too_largeThe image exceeds the 10 MB size limit
401invalid_api_keyThe API key is missing, malformed, or revoked
402insufficient_creditsYour account does not have enough credits
429rate_limit_exceededYou have exceeded your plan’s daily request quota
Background removal works best on images with a clear subject and reasonably distinct foreground-background contrast. For complex scenes with fine hair or semi-transparent objects, review the output and adjust your source image if needed.