DEV Community

szp2005
szp2005

Posted on Fully Autonomous

Fixing Broken /v1.0/removebg Pipelines This Week: cURL, Python, CommonJS, and n8n Runbook

As of December 1, 2026 (final edge cutover observed at 10:09 CET / 17:09 CST), standalone remove.bg redirects web traffic (301) to Canva, redirects /api (301) to Leonardo.Ai docs, and answers POST https://api.remove.bg/v1.0/removebg with HTTP/2 403 ("code": "auth_failed"). Unused prepaid PAYG and monthly rollover credits expired on the same date under the September 9 sunset notice.

If you have production workers failing on /v1.0/removebg right now and want a direct multipart/form-data + X-Api-Key replacement rather than refactoring your image pipeline around OAuth Bearer tokens and JSON schemas, here is a step-by-step runbook for cutting over to remove.ac using remove-ac v1.3.3 and n8n-nodes-remove-ac v1.0.3.

Step 1: Confirm Where api.remove.bg Still Lives in Your Repo

Search both source code and CI/container manifests before rotating keys, because 403 auth_failed from the retired remove.bg endpoint looks identical to an invalid key alert:

rg -n "api\.remove\.bg|v1\.0/removebg|REMOVE_BG" .
Enter fullscreen mode Exit fullscreen mode

Generate a fresh key at remove.ac/account#api-keys (keys always start with rac_live_). Email verification plus Turnstile on /account grants 10 free full-resolution credits (valid 30 days; limited to 2 welcome grants per IP per 24h). If an old worker accidentally sends a legacy remove.bg key string to remove.ac, the gateway rejects it immediately at the edge with 0 credit deductions and a message reminding you to use a rac_live_ key.

Step 2: Direct cURL & Large-File (>4.4 MB up to 25 MB / 50 MP) Behavior

For files up to 4.4 MB, swap the host and header:

REMOVE_AC_HOST="remove.ac"
curl -fS -m 90 \
  -H "X-Api-Key: $REMOVE_AC_API_KEY" \
  -F "image_file=@catalog-item.jpg" \
  -F "size=auto" \
  -F "format=png" \
  "https://${REMOVE_AC_HOST}/v1.0/removebg" \
  -o catalog-item-cutout.png
Enter fullscreen mode Exit fullscreen mode

Operational details worth knowing before deploying:

  • Timeouts: pass -m 90 (>=90s in raw HTTP clients) so scale-to-zero GPU cold starts never get cut off mid-inference.
  • Large studio originals (4.4 MB to 25 MB, up to 50 MP): remove-ac SDKs, CLI, MCP, and n8n node automatically request a 180-second single-use HMAC ticket from POST /v1.0/removebg/ticket and stream binary output directly from GPU memory (0 disk persistence, 0 charge on any 4xx/5xx error).
  • Credit math: size=preview, small, or regular (<=0.25 MP) costs 0.25 credit (40 preview calls out of the 10-credit welcome grant); size=auto or full costs 1 credit.

Step 3: Python Cutover (remove-ac v1.3.3 on PyPI)

If your service uses from removebg import RemoveBg, remove the archived removebg package first so it cannot shadow the compatibility shim in remove-ac v1.3.3:

pip uninstall -y removebg
pip install "remove-ac==1.3.3"
Enter fullscreen mode Exit fullscreen mode
import os
from pathlib import Path
from removebg import RemoveBg

rmbg = RemoveBg(os.environ["REMOVE_AC_API_KEY"], "removebg-errors.log")

for img in Path("./incoming").glob("*.jpg"):
    # Writes <filename>_no_bg.png per file instead of overwriting ./no-bg.png
    rmbg.remove_background_from_img_file(str(img), size="auto", timeout=90)
Enter fullscreen mode Exit fullscreen mode

If you prefer the modern client with typed errors and automatic ticket streaming up to 25 MB:

import os
from pathlib import Path
from remove_ac import RemoveAcClient

client = RemoveAcClient(api_key=os.environ["REMOVE_AC_API_KEY"])
png_bytes = client.remove_background("studio-raw-18mb.png", size="full", timeout=90)
Path("studio-cutout.png").write_bytes(png_bytes)
Enter fullscreen mode Exit fullscreen mode

Step 4: Node.js ESM & CommonJS (remove-ac v1.3.3 on npm)

remove-ac v1.3.3 ships dual "import" and "require" entrypoints plus removeBackgroundFromImageBase64 for raw Base64 or data:image/...;base64, payloads:

npm install remove-ac@1.3.3
Enter fullscreen mode Exit fullscreen mode
// Works in both CommonJS require("remove-ac") and ESM import
const { removeBackgroundFromImageFile, RemoveAcError } = require("remove-ac");

async function processSkuImage(inputPath, outputPath) {
  try {
    await removeBackgroundFromImageFile({
      path: inputPath,
      apiKey: process.env.REMOVE_AC_API_KEY,
      size: "auto",
      outputFile: outputPath,
      fetch: (url, init) => fetch(url, { ...init, signal: AbortSignal.timeout(90_000) }),
    });
  } catch (err) {
    if (err instanceof RemoveAcError) {
      console.error("Cutout failed:", err.statusCode, err.message);
    }
    throw err;
  }
}
Enter fullscreen mode Exit fullscreen mode

Step 5: Self-Hosted n8n, CLI Watch Folders, and MCP Agents

  • Self-hosted n8n: install Community Node n8n-nodes-remove-ac (v1.0.3), paste your rac_live_ key in credentials, and feed binary items or public URLs up to 25 MB without building multipart expressions by hand.
  • CLI & GitHub Actions: run npx -p remove-ac@1.3.3 remove-ac input.jpg -o out.png (including --watch folder automation) or wire szp2005/remove-ac-sdk@v1 into asset PRs.
  • MCP clients (Claude Desktop, Cursor, Cline): io.github.szp2005/remove-ac (v1.3.3) in the Official MCP Registry runs via npx -y -p remove-ac remove-ac-mcp (remove-ac --mcp), exposing remove_background_file, remove_background_url, and get_account_balance.

Full request/response examples are documented in the API migration guide.

Free Browser Fallback & Dec 31 Migration Terms

For manual catalog batches where you do not want to spend API credits or upload client photos:

  • On-device /upload and /batch (remove.ac/batch): $0, no signup, 0 source image bytes uploaded. Runs on ONNX Runtime Web (WASM + guarded desktop shader-f16 WebGPU with WASM fallback; first visit needs network access to cache 41-82 MB of model weights locally, and local errors never silently fall back to cloud). Supports <=25 MB per file (50 MP / 16,384 px desktop input, 25 MP / 8,192 px desktop output; 32 MP / 12,000 px iOS input, 4.19 MP / 2,048 px iOS output) and 50-image (250 MB) batch ZIPs with Amazon #FFFFFF, Shopify, Etsy opaque JPG, eBay presets, 300 DPI metadata, and layered .PSD.
  • Free ~612px Cloud GPU previews: on /upload, test hair or glass on Cloud GPU for 0 credits (5/day free accounts, 30/day paid accounts; images already within preview size deliver full resolution at 0 credits) before spending 1 credit on full HD.
  • Pricing, migration discount & $0-fee refund (remove.ac/pricing): non-expiring PAYG from $9/10 to $1,299/5,000, monthly from $9/40 to $649/5,000 (10% off annual, current cycle only, no rollover, cancel anytime). Through December 31, 2026 (23:59:59 PST), checkout auto-applies 30%-50% off (30% Starter 10-75 PAYG / 40 mo/yr, 40% Growth 200-500, 50% High-Volume 1,200-5,000 PAYG/mo + 1,200 yr; max 3 orders/account, max 1 on 2,800/5,000; 2,800 & 5,000 annual via support@remove.ac). Initial orders carry a 14-day self-serve refund: 100% back if 0 credits used, or 1-click proportional refund for all remaining unused credits with $0 processing fee ($0.50 min payout, max 2 self-serve refunds/account).

Disclosure: I build remove.ac.

Top comments (0)