REMOX API · V1.0 · ENGLISH

Background removal.
One API key.

Send an image from your server and receive a transparent PNG. This guide covers the pure-key background removal API.

POSThttps://api.remox.ai/v1.0/removebg

Make your first request

  1. Request API access and receive an issued pure API key. Keys and credits are provisioned by the provider; applying does not automatically create either.
  2. Store your key in a server environment variable named REMOX_API_KEY.
  3. Choose a JPG, PNG or static WebP within the size limits below, then run the example.
View integration examples →

Never embed your key in a public website or mobile app. Send requests through your own backend. Examples use a 75-second client timeout to allow for the API’s 60-second processing wait.

Authentication

Send X-API-Key: YOUR_REMOX_API_KEY on every request. No Secret is required for this API. Issued keys start with remox_live_ or remox_test_. The prefix alone does not guarantee a sandbox or free processing.

A key identifies its customer and credit balance. Do not send X-Subuid, X-Platform-User or X-RapidAPI-User. Existing Key + Secret credentials cannot be used here. Key rotation preserves the customer identity and balance; a revoked or expired key returns 403.

Code examples

cURL
# Set REMOX_API_KEY in your environment first.
curl 'https://api.remox.ai/v1.0/removebg' \
  -H "X-API-Key: $REMOX_API_KEY" \
  -H 'Idempotency-Key: image-0001' \
  -F 'image_file=@/path/to/input.jpg' \
  -F 'size=auto' \
  --max-time 75 --fail-with-body \
  -D response-headers.txt -o remox-result.png
# On non-2xx, the output file contains error JSON, not a PNG.

Examples use input.jpg with MIME image/jpeg. For PNG or WebP, update both the filename and MIME type. Use a unique Idempotency-Key for each new image, and retain it for retries.

Request reference

POST /v1.0/removebg · multipart/form-data. Let your HTTP library set the multipart boundary.

FieldRequiredAccepted value
image_fileYesBinary file: JPG, PNG or static WebP; up to 20 MiB. Longest side ≤1920 px, shortest side ≤1080 px.
sizeNoauto only (default). Other sizes are not supported.
response_formatNoimage (default) or json.

Idempotency-Key is an optional header: 8–128 characters using letters, digits, dots, underscores, colons or hyphens. Strongly recommended for reliable retries. File URLs, Base64 input and object erasure are not supported by this pure-key endpoint.

Successful responses

200 · PNG image (default)

The response body is the PNG itself, with Content-Type: image/png. Write the bytes to a file. Headers include X-Request-ID, X-Task-ID and, on creation, X-Idempotency-Key.

200 · JSON with the original result URL

Add response_format=json to the same multipart request. The API still waits for completion.

curl https://api.remox.ai/v1.0/removebg \
  -H "X-API-Key: $REMOX_API_KEY" \
  -H "Idempotency-Key: image-json-0001" \
  -F "image_file=@input.jpg" -F "size=auto" \
  -F "response_format=json" --max-time 75 --fail-with-body
{
  "requestId": "req_…",
  "taskId": "task_…",
  "data": {
    "result_url": "https://storage.example/result.png?signature=…&expires=…"
  }
}

The URL is returned intact, including its signed query parameters. Its upstream expiry can differ from the Worker’s result expiry. Download promptly. REMOX returns data.result_url, not Base64.

Timeouts, task status & safe retries

The Worker checks the AI task about every 300 ms during the synchronous wait. After up to 60 seconds it returns 504; that does not mean the task failed or was cancelled.

{
  "requestId": "req_…",
  "errors": [
    {
      "code": "sync_timeout",
      "title": "The task is still processing. Query or retry with the same Idempotency-Key."
    }
  ],
  "retryable": true,
  "taskId": "task_…",
  "idempotencyKey": "image-0001"
}
  1. If a taskId is available, query GET /v1.0/tasks/{taskId} with the same API key.
  2. When status is completed, download GET /v1.0/tasks/{taskId}/result, or add ?response_format=json.
  3. If there is no taskId, retry the original POST with exactly the same image bytes and Idempotency-Key. Respect Retry-After when present.
curl https://api.remox.ai/v1.0/tasks/TASK_ID \
  -H "X-API-Key: $REMOX_API_KEY" --fail-with-body
{
  "requestId": "req_…",
  "taskId": "task_…",
  "status": "completed",
  "progress": null,
  "pollAfterMs": 2000,
  "result": {
    "downloadPath": "/v1.0/tasks/task_…/result",
    "mimeType": "image/png",
    "expiresAt": "2026-10-17T00:00:00.000Z"
  }
}

Status values: creating, queued, processing, completed, failed, timed_out. Status reads return 200 even for a failed task; inspect status and the errors array. Follow pollAfterMs (normally 2000 ms) for client status queries. The task reconciliation deadline is 35 minutes.

The same idempotency key and image reuse one task and one charge. Switching between image and JSON does not create another charge. Different image bytes with the same key return 409.

Account, limits & credits

GET /v1.0/account returns customer quota and a credits object. Its available, reserved and consumed fields help you check the current balance. Request, hourly and concurrent-task limits are configured per customer.

curl https://api.remox.ai/v1.0/account \
  -H "X-API-Key: $REMOX_API_KEY" --fail-with-body

Credits are reserved when a task is created, consumed once on success, and released when it fails or reaches its task deadline. A synchronous 504 alone does not release the reservation. Key creation and reading your account do not automatically grant credits. The current cost depends on the provider’s configured credit price.

HTTP status & error codes

Non-2xx API responses contain an errors array with code and title. Use the code for program logic. Keep requestId for troubleshooting; never log your API key.

{
  "requestId": "req_…",
  "retryable": false,
  "errors": [
    {
      "code": "invalid_credentials",
      "title": "Invalid API key."
    }
  ]
}
HTTPError codeMeaning / next step
400invalid_request, invalid_fileUse multipart form data with one non-empty image_file. Omit unsupported or duplicate fields.
400invalid_size, invalid_response_formatUse size=auto and response_format=image or json.
400invalid_idempotency_key, invalid_subjectUse an 8–128 character idempotency key (letters, digits, . _ : -). Omit subject/user headers.
402insufficient_creditsTop up unexpired credits before creating a new task.
403invalid_credentialsThe key is missing, invalid, disabled, revoked or expired. Check your issued pure API key.
403platform_disabled, platform_paused, scope_deniedCustomer access is disabled/paused or the key lacks permission. Contact the provider.
404not_found, upload_not_foundEndpoint/task is unknown, inaccessible to this customer, or the upload expired.
409idempotency_conflictThis key was used for different image bytes. Use a new key for a different image.
409result_not_readyThe task is not complete. Query its status before downloading.
410task_expired, result_expiredThe task or download is no longer available. Task retention is 90 days; Worker results expire after 7 days.
413file_too_largeMaximum image file size: 20 MiB (20 × 1024 × 1024 bytes).
415invalid_image, animated_image_unsupportedUse a valid JPG, PNG or static WebP with the matching MIME type.
422image_dimensions_exceededResize before upload: longest side ≤1920 px and shortest side ≤1080 px. The API does not resize for you.
429rate_limit_exceeded, hourly_quota_exhausted, inflight_limit_exceededRespect Retry-After when supplied. Limits depend on your customer configuration.
502upload_failed, upstream_rejected, upstream_unavailableUpstream upload or AI service failed. Check task state before retrying.
502create_result_unknown, remote_service_error, invalid_result, result_unavailable, task_failed, task_timeoutSubmission is uncertain, processing failed, the PNG is invalid/unavailable, or the task timed out. Inspect task status; do not blindly create a duplicate.
503service_not_configured, credit_price_not_configured, server_errorService configuration or a temporary internal error. Retain requestId and contact support if persistent.
504sync_timeoutThe synchronous wait ended after up to 60 seconds. The task may still be running; recover with taskId or the same Idempotency-Key.

retryable is true for 429 and 5xx responses. Always combine it with the error code and task state: an uncertain submission must not be retried as a brand-new task. Read Retry-After when supplied.

Compatibility & scope

The image_file + size=auto request and errors array follow familiar remove.bg conventions. This is not a drop-in implementation of all remove.bg options. response_format and data.result_url are REMOX extensions; image_url, result_b64, shadow, refine and background editing parameters are not supported here.

This page documents pure-key background removal only. Website object erasure and the separate Key + Secret / RapidAPI gateway use different routes and contracts.

Request an API key →