REST API v1 · Official reference

RemoveTo API Documentation

Official reference for the RemoveTo REST API v1: signed upload URL, remove-bg, credits and jobs.

Active Base URLhttps://api.removeto.com/v1

Introduction

The RemoveTo API exposes a three-step flow for removing the background from an image. The «/v1/*» routes are served by our cloud infrastructure; automatic processing, credits and encrypted temporary storage are managed centrally.

A job identifies each image. The binary upload uses a signed upload URL, so the file goes directly to encrypted temporary storage without passing through your server. The cutout uses exactly 1 credit and returns two temporary URLs: one to display the image and one to download it.

Authentication and security

Open /dashboard#keys with your account, create a key and copy it at creation time: that is the only time it is shown in plain text. You can revoke it from the same dashboard; revoked keys stop authenticating immediately.

Keys start with rmv_live_ and are sent in the x-api-key header. Internally only their SHA-256 hash is stored. Key management routes and job listings require a web session (Authorization: Bearer <token>) and reject API keys.

x-api-key: rmv_live_...
  • ✓Never expose x-api-key in frontend code, browsers, mobile apps or repositories. Call the API from your server or cloud infrastructure under your control.
  • ✓The signed upload URL must not be published either: anyone who has it can write that object for 5 minutes.
  • ✓The service only accepts origins allowed by configuration; an unauthorized Origin receives 403 FORBIDDEN_ORIGIN.
  • ✓Store the key in a server environment variable, for example REMOVETO_API_KEY, and rotate/revoke it if you suspect a leak.
Generate or revoke a key at /dashboard#keys →

3-step flow

  1. 1POST /v1/upload-url

    Create the job

    With your x-api-key and the file metadata. It responds 201 with job_id and upload_url.

    • • upload_url is a signed upload URL with a 5 min TTL (expires_in: 300)
    • • allowed content_type: image/png | image/jpeg | image/webp
    • • file_size: from 1 to 15728640 bytes (15 MB)
  2. 2PUT <upload_url>

    Upload the image

    Binary request to encrypted temporary storage with the file body and the same Content-Type declared in step 1.

    • • No x-api-key header: the URL is already signed
    • • Declare the same Content-Type: it defines the stored type
    • • Do not reuse the URL: it expires after 5 min
  3. 3POST /v1/remove-bg

    Process with AI

    Send { job_id }. The service claims the job atomically, charges 1 credit and starts automatic processing.

    • • result_url: inline preview for <img>
    • • download_url: same image with Content-Disposition: attachment
    • • Both URLs expire in 15 min (900 s)

Sequence: POST /v1/upload-url → PUT <upload_url> → POST /v1/remove-bg

Endpoint reference

All routes accept and return JSON, except the binary upload to encrypted temporary storage. Errors follow the format { error: { code, message } }.

GET/v1/creditsx-api-key or Bearer

Check the balance and authentication source of the current account.

Headers

  • x-api-key: rmv_live_... (or Authorization: Bearer <token>)

Response

{
  "user_id": "user-uuid",
  "source": "api",
  "balance": 3
}
  • •source is api when x-api-key is used and web when a session token is used.

Possible errors

  • 401 MISSING_CREDENTIALS / INVALID_API_KEY / INVALID_TOKEN
get-credits.sh
curl https://api.removeto.com/v1/credits \
  -H "x-api-key: rmv_live_..."
POST/v1/upload-urlx-api-key or Bearer

Create a job in pending_upload status and return the signed URL to upload the file.

Headers

  • x-api-key: rmv_live_...
  • Content-Type: application/json

Body

{
  "content_type": "image/png",
  "file_size": 420000,
  "output_format": "png"
}

Response

201 Created
{
  "job_id": "9f1c2e78-3a4b-4c6d-8e9f-0a1b2c3d4e5f",
  "upload_url": "https://<signed-url>/...",
  "expires_in": 300,
  "storage_key": "<internal-reference>"
}
  • •content_type: image/png | image/jpeg | image/webp.
  • •file_size: integer from 1 to 15728640 bytes.
  • •output_format: png | webp (png by default).
  • •Maximum 5 pending_upload jobs per user in a 5 min window.

Possible errors

  • 400 INVALID_CONTENT_TYPE / INVALID_FILE_SIZE / INVALID_OUTPUT_FORMAT
  • 402 INSUFFICIENT_CREDITS
  • 429 TOO_MANY_PENDING_UPLOADS
post-upload-url.sh
curl -X POST https://api.removeto.com/v1/upload-url \
  -H "x-api-key: rmv_live_..." \
  -H "Content-Type: application/json" \
  -d '{"content_type":"image/png","file_size":420000,"output_format":"png"}'
PUT<upload_url>None (signed URL)

Upload the image bytes to encrypted temporary storage using the signed URL.

Headers

  • Content-Type: image/png (the same content_type from step 1)

Body

<file binary: image/png, image/jpeg or image/webp>

Response

200 OK from temporary storage (no JSON body).
  • •Do not send x-api-key or Authorization in this request.
  • •Content-Type is not included in the signature: use the same declared value to keep the correct object type.
  • •The signature expires after 5 minutes; if it expires, create a new job with /v1/upload-url.

Possible errors

  • 403 if the signature expired or the object is no longer available
put-put-upload.sh
curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: image/png" \
  --data-binary "@./product.png"
POST/v1/remove-bgx-api-key or Bearer

Segment the image with AI, charge 1 credit atomically and sign the result URLs.

Headers

  • x-api-key: rmv_live_...
  • Content-Type: application/json

Body

{
  "job_id": "9f1c2e78-3a4b-4c6d-8e9f-0a1b2c3d4e5f"
}

Response

{
  "job_id": "9f1c2e78-3a4b-4c6d-8e9f-0a1b2c3d4e5f",
  "status": "completed",
  "result_url": "https://<signed-url>/...",
  "download_url": "https://<signed-url>/...",
  "width": 1024,
  "height": 1024,
  "format": "png",
  "credits_remaining": 4
}
  • •Only the first attempt moves to processing: retrying with the same job_id returns 409 and does not charge again.
  • •Any error after the charge (processing, temporary storage or data) refunds 1 credit idempotently with reference refund:<job_id>.
  • •Recommendation: use a 90–120 s client timeout to cover the duration of automatic processing.

Possible errors

  • 400 INVALID_JOB_ID / OBJECT_NOT_UPLOADED
  • 402 INSUFFICIENT_CREDITS
  • 404 JOB_NOT_FOUND (unknown UUID or one that belongs to another account)
  • 409 INVALID_JOB_STATUS (already processed or in progress)
  • 413 FILE_TOO_LARGE
  • 502 ENGINE_ERROR (credit refunded automatically)
post-remove-bg.sh
curl -X POST https://api.removeto.com/v1/remove-bg \
  -H "x-api-key: rmv_live_..." \
  -H "Content-Type: application/json" \
  -d '{"job_id":"9f1c2e78-3a4b-4c6d-8e9f-0a1b2c3d4e5f"}'
GET/v1/jobs?limit=15Web session only (Bearer)

List the user's jobs, newest first.

Headers

  • Authorization: Bearer <session_token>

Response

{
  "jobs": [
    {
      "id": "9f1c2e78-3a4b-4c6d-8e9f-0a1b2c3d4e5f",
      "source": "api",
      "status": "completed",
      "output_format": "png",
      "error_code": null,
      "credits_charged": 1,
      "created_at": "2026-11-29T03:58:00.000Z",
      "completed_at": "2026-11-29T03:59:00.000Z"
    }
  ],
  "limit": 15,
  "offset": 0,
  "total": 1
}
  • •Query: limit (0–50, default 20) and offset (integer >= 0, default 0). ?limit=15 is a valid example.
  • •With x-api-key this endpoint returns 403 FORBIDDEN_AUTH_METHOD: it requires a web session.
  • •Internal file storage keys are never exposed.

Possible errors

  • 400 INVALID_PAGINATION
  • 403 FORBIDDEN_AUTH_METHOD
get-jobs.sh
curl https://api.removeto.com/v1/jobs?limit=15 \
  -H "Authorization: Bearer <session_token>"
GET/v1/jobs/:idx-api-key or Bearer

Check a job's status and regenerate its temporary URLs if it is completed.

Headers

  • x-api-key: rmv_live_... (or Authorization: Bearer <token>)

Response

{
  "job_id": "9f1c2e78-3a4b-4c6d-8e9f-0a1b2c3d4e5f",
  "status": "completed",
  "format": "png",
  "width": 1024,
  "height": 1024,
  "credits_charged": 1,
  "error_code": null,
  "created_at": "2026-11-29T03:58:00.000Z",
  "completed_at": "2026-11-29T03:59:00.000Z",
  "result_url": "https://<signed-url>/...",
  "download_url": "https://<signed-url>/..."
}
  • •result_url and download_url are reissued with a 15 min TTL when the job is completed.
  • •The id must be a valid UUID and belong to the authenticated account.

Possible errors

  • 400 INVALID_JOB_ID
  • 404 JOB_NOT_FOUND
get-job-by-id.sh
curl https://api.removeto.com/v1/jobs/9f1c2e78-3a4b-4c6d-8e9f-0a1b2c3d4e5f \
  -H "x-api-key: rmv_live_..."

End-to-end quickstart

Complete example of the 3 steps with a ./product.png file. Replace the example key with a real key created in the dashboard.

remove-to-quickstart
# 1. Create a job and get a signed upload_url (5 min TTL)
API="https://api.removeto.com/v1"
KEY="rmv_live_..."   # your key, never in the browser
FILE="./product.png"
MIME="image/png"
SIZE=$(wc -c < "$FILE" | tr -d " ")
BODY="{\"content_type\":\"$MIME\",\"file_size\":$SIZE,\"output_format\":\"png\"}"

UPLOAD_JSON=$(curl -sS -X POST "$API/upload-url" \
  -H "x-api-key: $KEY" -H "Content-Type: application/json" \
  -d "$BODY")
JOB_ID=$(printf '%s' "$UPLOAD_JSON" | jq -r .job_id)
UPLOAD_URL=$(printf '%s' "$UPLOAD_JSON" | jq -r .upload_url)

# 2. Upload the binary to temporary storage (same Content-Type, no x-api-key)
curl -sS -X PUT "$UPLOAD_URL" -H "Content-Type: $MIME" \
  --data-binary "@$FILE" -o /dev/null -w "upload HTTP %{http_code}\n"

# 3. AI cutout (1 credit; 120 s timeout)
curl -sS --max-time 120 -X POST "$API/remove-bg" \
  -H "x-api-key: $KEY" -H "Content-Type: application/json" \
  -d "{\"job_id\":\"$JOB_ID\"}"

Error codes and limits

HTTPCodeMeaning
400INVALID_JOB_ID, OBJECT_NOT_UPLOADED, INVALID_CONTENT_TYPE, INVALID_FILE_SIZE, INVALID_OUTPUT_FORMAT, INVALID_PAGINATIONValidation: invalid UUID, file not uploaded, unsupported MIME/size/format or pagination out of range.
401MISSING_CREDENTIALS, INVALID_API_KEY, INVALID_TOKENMissing credential, revoked key or invalid session token.
402INSUFFICIENT_CREDITSInsufficient balance: 1 image = 1 credit.
403FORBIDDEN_AUTH_METHOD, FORBIDDEN_ORIGINThe endpoint requires a web session, or the Origin is not allowlisted.
404JOB_NOT_FOUNDThe job does not exist or does not belong to the account.
409INVALID_JOB_STATUSThe job is already processing, completed or failed; it cannot be processed twice.
413FILE_TOO_LARGEThe uploaded object exceeds 15728640 bytes (15 MB).
429TOO_MANY_PENDING_UPLOADSMaximum 5 pending_upload jobs per user every 5 minutes.
502ENGINE_ERRORAutomatic processing failed: the credit is refunded automatically.
500INTERNAL_ERROR, PENDING_CHECK_FAILED, JOB_CREATE_FAILED, JOB_LOOKUP_FAILED, CREDIT_ERROR, JOB_UPDATE_FAILED, PROCESSING_FAILED, JOB_LIST_FAILEDInternal service or data failure; no duplicate charge is created.

Integration best practices

Cutout timeout: 90–120 s

The service waits up to 90 s for automatic processing and the web client uses 120 s. A new image may take a little longer; configure your client with a 90–120 s timeout on /v1/remove-bg so it does not give up early.

Do not store result URLs

result_url and download_url are signatures with a 15 min TTL and temporary files are automatically deleted after 24 h. Download the file and store it in your own storage if you need to keep it.

Declare the same Content-Type in both steps

Content-Type is not part of the upload signature, but it does determine the type used to store the object. Use the same value in /v1/upload-url and in the PUT.

Retries and errors

On 502 ENGINE_ERROR the credit has already been returned: create a new job (the previous one becomes failed). Retries on the same job_id while it is in progress return 409, with no double charge.

Batch processing (concurrency)

The API has no separate batch endpoint. To process catalogs or e-commerce images, run the standard 3-step flow (upload-url → PUT → remove-bg) with 2 to 3 concurrent jobs. Anti-429 rule: do not request 10 upload-url calls together; the limit is 5 pending_upload jobs every 5 minutes. Complete each item's cycle inside 2–3 parallel tasks: because remove-bg releases pending_upload immediately, you can process dozens or hundreds of images in a row at the same price (1 image = 1 credit).

async function pool(items, limit, task) {
  const queue = [...items];
  await Promise.all(
    Array.from({ length: limit }, async () => {
      while (queue.length) await task(queue.shift());
    }),
  );
}

// 1 image = 1 credit; each task completes upload-url → PUT → remove-bg
await pool(files, 3, async (file) => {
  const upload = await createUploadUrl(file);
  await putFile(upload.upload_url, file);
  return removeBackground(upload.job_id);
});

Ready to integrate?

Create your key and check your balance before processing your first image.