# BGRemover.dev — LLM & AI Agent Documentation # Standard: llms.txt (llmstxt.org) # Last updated: 2026-02-23 # For: AI agents, LLMs, code assistants building integrations > BGRemover is a professional AI-powered background removal API. > The API accepts images (JPEG, PNG, WebP) and returns transparent PNG files. > Powered by BiRefNet (state-of-the-art neural architecture), same technology used by remove.bg. > Privacy-first — images are never stored beyond 24 hours for free users. ## Quick Start The BGRemover API is a REST API. Authentication uses an API key passed as a Bearer token. Base URL: https://bgremover.dev/api ### Authentication All API calls require an `Authorization` header: ``` Authorization: Bearer YOUR_API_KEY ``` Get your API key at: https://bgremover.dev/dashboard/api-keys --- ## Core Endpoint ### Remove Background **POST** `https://bgremover.dev/api/v1/remove-bg` Remove the background from any image. Returns a transparent PNG. **Request (multipart/form-data):** - `file` — image file (JPEG, PNG, WebP, BMP, TIFF) — max 30MB **Response:** `image/png` — RGBA transparent PNG **Response Headers:** - `X-Processing-Time` — seconds taken - `X-Model` — AI model used (e.g. `birefnet-general`) - `X-Pipeline` — processing pipeline version **Example — cURL:** ```bash curl -X POST https://bgremover.dev/api/v1/remove-bg \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@photo.jpg" \ --output result.png ``` **Example — Python:** ```python import requests def remove_background(image_path: str, api_key: str) -> bytes: """Remove background from image using BGRemover API.""" with open(image_path, 'rb') as f: response = requests.post( 'https://bgremover.dev/api/v1/remove-bg', headers={'Authorization': f'Bearer {api_key}'}, files={'file': f}, timeout=60 ) response.raise_for_status() return response.content # PNG bytes # Usage png_bytes = remove_background('product.jpg', 'YOUR_API_KEY') with open('product_transparent.png', 'wb') as f: f.write(png_bytes) ``` **Example — JavaScript/Node.js:** ```javascript import fs from 'fs'; import FormData from 'form-data'; import fetch from 'node-fetch'; async function removeBackground(imagePath, apiKey) { const form = new FormData(); form.append('file', fs.createReadStream(imagePath)); const response = await fetch('https://bgremover.dev/api/v1/remove-bg', { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, ...form.getHeaders(), }, body: form, }); if (!response.ok) throw new Error(`Error ${response.status}: ${await response.text()}`); return Buffer.from(await response.arrayBuffer()); // PNG bytes } // Usage const pngBuffer = await removeBackground('product.jpg', 'YOUR_API_KEY'); fs.writeFileSync('product_transparent.png', pngBuffer); ``` **Example — TypeScript:** ```typescript async function removeBackground(file: File, apiKey: string): Promise { const form = new FormData(); form.append('file', file); const res = await fetch('https://bgremover.dev/api/v1/remove-bg', { method: 'POST', headers: { Authorization: `Bearer ${apiKey}` }, body: form, }); if (!res.ok) throw new Error(`BGRemover API error: ${res.status}`); return res.blob(); // PNG Blob } ``` **Example — PHP:** ```php true, CURLOPT_POST => true, CURLOPT_HTTPHEADER => ["Authorization: Bearer $apiKey"], CURLOPT_POSTFIELDS => ['file' => new CURLFile($imagePath)], ]); $result = curl_exec($curl); if (curl_getinfo($curl, CURLINFO_HTTP_CODE) !== 200) { throw new RuntimeException('BGRemover API error: ' . $result); } return $result; // PNG bytes } $png = removeBackground('product.jpg', 'YOUR_API_KEY'); file_put_contents('product_transparent.png', $png); ``` --- ## Batch Processing Endpoint **POST** `https://bgremover.dev/api/v1/remove-bg/batch` Process up to 10 images in one request. **Request (multipart/form-data):** - `files` — multiple image files (up to 10) **Response (application/json):** ```json { "results": [ { "filename": "photo1.jpg", "success": true, "data": "data:image/png;base64,..." }, { "filename": "photo2.jpg", "success": false, "error": "File too large" } ], "model_used": "birefnet-general" } ``` **Example — Python batch:** ```python import requests def remove_backgrounds_batch(image_paths: list[str], api_key: str) -> list[dict]: files = [('files', (path, open(path, 'rb'), 'image/jpeg')) for path in image_paths] response = requests.post( 'https://bgremover.dev/api/v1/remove-bg/batch', headers={'Authorization': f'Bearer {api_key}'}, files=files, timeout=120 ) response.raise_for_status() return response.json()['results'] ``` --- ## Usage & Rate Limits | Plan | Images/day | Max file size | API access | |------|-----------|---------------|------------| | Free | 1 | 30MB | ✗ | | Pro | Unlimited | 30MB | ✓ | | Business | Unlimited | 30MB | ✓ Priority | --- ## Error Codes | Status | Meaning | |--------|---------| | 200 | Success — PNG returned | | 400 | Invalid file type or too large | | 401 | Missing or invalid API key | | 429 | Rate limit exceeded — upgrade plan | | 500 | Processing error — retry | | 504 | Timeout — image too complex, try smaller | --- ## Common Use Cases for AI Agents ### E-commerce Product Photography Remove white/cluttered backgrounds from product photos for online stores. ### Profile Picture Tool Auto-remove photo backgrounds for social media profile pictures. ### Document ID Photo Remove backgrounds from ID/passport photos automatically. ### Thumbnail Generator Create transparent thumbnails for YouTube/social media. ### Design Workflow Automation Integrate background removal into design pipelines (Figma plugins, automation scripts). --- ## SDK Installation (Community) ```bash # Python pip install bgremover-sdk # coming soon # npm / Node.js npm install @bgremover/sdk # coming soon ``` --- ## Webhook Support BGRemover supports webhooks for async processing (Pro plan). Send a `webhook_url` form field to receive results asynchronously. --- ## API Status Check real-time API status: https://bgremover.dev/api/health ```bash curl https://bgremover.dev/api/health # {"status":"ok","model":"birefnet-general","version":"4.0.0","pipeline":"ultra-quality"} ``` --- ## Links - Homepage: https://bgremover.dev - Pricing: https://bgremover.dev/pricing - Dashboard: https://bgremover.dev/dashboard - API Keys: https://bgremover.dev/dashboard/api-keys - Full docs: https://bgremover.dev/docs - Support: support@bgremover.dev --- *BGRemover is powered by BiRefNet — the same neural architecture used by leading commercial tools. Privacy-first, no permanent storage.*