{"slug": "show-hn-drop-in-replacement-for-the-remove-bg-api-which-shuts-down-dec-1", "title": "Show HN: Drop-in replacement for the remove.bg API, which shuts down Dec 1", "summary": "AirGallery launched a drop-in replacement for the remove.bg API ahead of remove.bg's December 1 shutdown, offering a remove-background endpoint at airgallery.com/functions/v1/remove-background authenticated with a Bearer developer key. AirGallery also shipped a stateless Streamable HTTP Model Context Protocol server at airgallery.com/functions/v1/mcp-server, listed in the official MCP Registry as com.airgallery/airgallery, exposing 60 tools including 27 AI image tools such as remove_background, upscale_image and text_to_image. Developer keys are scoped to read, write and ai, with AI calls deducting credits and missing-scope requests returning 403.", "body_md": "[Back to Docs](https://airgallery.com/docs)\n\nDevelopers\n\n# AirGallery API & MCP\n\nProgrammatic access to every AirGallery capability — image generation, gallery management, credits, and social — over both a REST API and a Model Context Protocol server.\n\n## Quickstart\n\n1. Sign in to AirGallery and visit [/api-keys](https://airgallery.com/api-keys) to generate a developer key. Copy the`ag_…` value — it's shown once.\n2. Make sure you have credits at [/credits](https://airgallery.com/credits) if you plan to call AI tools.\n3. Call the REST API or wire the MCP server into your agent client.\n\n```\ncurl -X POST https://airgallery.com/functions/v1/remove-background \\\n  -H \"Authorization: Bearer ag_YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{ \"image\": \"data:image/png;base64,iVBORw0KG…\" }'\n```\n\n## Authentication\n\nEvery authenticated endpoint accepts a Bearer token in the `Authorization` header. Two token types are supported, and both work for every protected REST endpoint and MCP tool (creating, revoking and deleting API keys takes a JWT).\n\n### Developer API Key\n\nLong-lived, scoped (`read`, `write`, `ai`), revocable. Best for server-side integrations, automations, and MCP clients.\n\n`Authorization: Bearer ag_abc123…`\n### Supabase JWT\n\nShort-lived session token from `supabase.auth`. Best for first-party clients that already use Supabase Auth.\n\n`Authorization: Bearer eyJhbGciOiJIUzI1NiIs…`\n### Scopes\n\n- `read` Browse public gallery, view profiles, read your own data.\n- `write` Save/delete artworks, update profile, follow/like.\n- `ai` Run AI tools (deducts credits).\n\nMissing-scope calls return `403` with `{ \"error\": \"API key missing required scope: …\" }`. JWT-authenticated callers always have all scopes.\n\n## MCP Server\n\nAirGallery ships an MCP server (Model Context Protocol) over Streamable HTTP. Any MCP-compatible agent — Claude Desktop, Cursor, MCP Inspector, your own LLM app — can plug in and call the same tools that power the AirGallery UI.\n\nListed in the official MCP Registry as `com.airgallery/airgallery` and on Glama:\n\n### Endpoint\n\n```\nhttps://airgallery.com/functions/v1/mcp-server\n```\n\nTransport: stateless Streamable HTTP. Send JSON-RPC 2.0 messages with `POST`; replies come back as JSON or a short SSE stream (there is no standing GET stream). Also reachable at `https://airgallery.com/mcp`. Protocol versions 2025-03-26 and 2025-06-18; clients on newer versions are served 2025-06-18. Messages over 4.5 MB (large base64 images, upscale_image results) need the same server at `https://wgbduttegyrwiukjhubh.supabase.co/functions/v1/mcp-server`.\n\n### Available tools — 60 total\n\n#### Gallery (7)\n\n- list_public_artworks\n- search_artworks\n- get_artwork\n- list_my_artworks\n- save_artwork\n- update_artwork\n- delete_artwork\n\n#### Credits (4)\n\n- get_credit_balance\n- get_credit_costs\n- get_pricing_tiers\n- buy_credits\n\n#### Create (1)\n\n- create_image\n\n#### AI Image Tools (27)\n\n- remove_background\n- enhance_image\n- upscale_image\n- text_to_image\n- ai_replace\n- ai_expand\n- object_remover\n- colorize_image\n- cartoonize\n- style_transfer\n- relight_image\n- dslr_transform\n- photo_repair\n- old_photo_restore\n- ai_filters\n- retro_transform\n- polaroid_transform\n- headshot_generator\n- portrait_retouch\n- avatar_generator\n- meme_generator\n- product_studio\n- logo_mockup\n- poster_generator\n- aspect_ratio_change\n- generate_tags\n- studio_generate_layout\n\n#### Profile & Social (7)\n\n- get_my_profile\n- update_my_profile\n- get_user_profile\n- follow_user\n- unfollow_user\n- like_artwork\n- unlike_artwork\n\n#### Portfolios (4)\n\n- list_my_portfolios\n- get_portfolio\n- publish_portfolio\n- get_public_portfolio\n\n#### White-Label (2)\n\n- list_my_white_label_galleries\n- get_white_label_gallery\n\n#### Design Studio (8)\n\n- studio_list_documents\n- studio_get_document\n- studio_create_document\n- studio_add_frames\n- studio_add_elements\n- studio_update_objects\n- studio_delete_objects\n- studio_add_font\n\n### List tools over raw HTTP\n\n```\n# Initialize an MCP session\ncurl -X POST https://airgallery.com/functions/v1/mcp-server \\\n  -H \"Authorization: Bearer ag_YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": 1,\n    \"method\": \"tools/list\"\n  }'\n```\n\n## Connect from an MCP client\n\nAdd to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\\Claude\\claude_desktop_config.json` (Windows), then restart Claude Desktop.\n\n```\n{\n  \"mcpServers\": {\n    \"airgallery\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"mcp-remote\",\n        \"https://airgallery.com/functions/v1/mcp-server\",\n        \"--header\",\n        \"Authorization: Bearer ag_YOUR_API_KEY\"\n      ]\n    }\n  }\n}\n```\n\n## REST: AI Tool Endpoints\n\nEach AI tool is its own edge function under `https://airgallery.com/functions/v1/<name>`. All accept `POST` with a JSON body. All require auth (API keys need the `ai` scope) and consume credits; generate-tags is free the first time for one of your own untagged artworks. Credits are charged when the call starts and refunded automatically if it fails.\n\nairgallery.com accepts request and response bodies up to 4.5 MB. For larger images (up to 25 MB), and for `topaz-upscale`, which returns the full-size image inline, call the same function at `https://wgbduttegyrwiukjhubh.supabase.co/functions/v1/<name>` with the same headers and body.\n\n`/image-transform`\nCore multi-modal transform (powers Create); pick a model, cost depends on it\n\n`/remove-background`\nRemove image background (transparent PNG, or a solid colour with bg_color)\n\n`/enhance-image`\nGeneral clean-up, sharpen, denoise or fix lighting\n\n`/object-remover`\nRemove objects painted over in red\n\n`/ai-replace`\nReplace an area painted over in red with new content\n\n`/ai-expand`\nOutpaint / extend image boundaries\n\n`/ai-filters`\nApply artistic AI filters\n\n`/aspect-ratio`\nChange aspect ratio, filling new space with AI\n\n`/cartoonize`\nConvert photos to cartoon / anime\n\n`/colorize-image`\nAdd color to B&W photos\n\n`/dslr-transform`\nProfessional DSLR camera look\n\n`/headshot-generator`\nGenerate professional headshots\n\n`/logo-mockup`\nPlace a logo on realistic mockups\n\n`/meme-generator`\nMemes with custom text\n\n`/old-photo-restore`\nRestore vintage photographs\n\n`/photo-repair`\nFix blur, noise or low resolution\n\n`/polaroid-transform`\nClassic instant-photo effect\n\n`/portrait-retouch`\nEnhance and retouch portraits\n\n`/poster-generator`\nCreate poster / flyer layouts\n\n`/product-studio`\nE-commerce product photography\n\n`/relight-image`\nChange scene lighting\n\n`/retro-image`\nRetro/vintage film effects\n\n`/style-transfer`\nRepaint a photo in the style of a second image\n\n`/text-to-image`\nGenerate images from text\n\n`/topaz-upscale`\nTopaz AI upscaling, 1–6x or to an exact outputWidth / outputHeight\n\n`/studio-layout`\nDesign a layout from a brief: a frame and positioned text, shape and image layers for Design Studio\n\n`/avatar-generator`\nStylized AI avatars from a photo\n\n`/generate-tags`\nAuto-generate descriptive tags (free the first time for a saved artwork)\n\nImages can be passed as base64 data URIs (`data:image/png;base64,…`) or as HTTPS URLs. Responses return the result image (a data URI or URL) as `processedImage`, `image` or `generatedImage` depending on the tool; errors return `{ \"error\": \"…\" }`. The MCP tool descriptions list each tool's fields and allowed values.\n\n### image-transform models\n\nBody: `{ \"images\": [ …up to 5 ], \"customPrompt\": \"…\", \"preset\": \"none\", \"model\": \"nano-banana-2\" }`. Send images, a prompt, or both. Every model accepts reference images except `recraft-v4.1`` recraft-v4.1-flash`, which is text-to-image only (images return a 400, refunded). Also accepted over the API: `gpt-image-mini` (GPT Image 1 Mini, 3 cr).\n\n- `nano-banana-2` Nano Banana 23 cr\n- `nano-banana-2-lite` Nano Banana 2 Lite2 cr\n- `nano-banana-pro` Nano Banana Pro6 cr\n- `gpt-image-2.6-flare` GPT Image 2.6 Flare8 cr\n- `gpt-image-2.6-sunburst` GPT Image 2.6 Sunburst8 cr\n- `flux-3` FLUX 33 cr\n- `flux-3-klein` FLUX 3 Klein1 cr\n- `mai-image-2.7` MAI-Image 2.73 cr\n- `mai-image-2.7-flash` MAI-Image 2.7 Flash1 cr\n- `grok-imagine-2` Grok Imagine 2.04 cr\n- `seedream-5.5` Seedream 5.52 cr\n- `seedream-5-pro` Seedream 5.0 Pro2 cr\n- `muse-image` Muse Image1 cr\n- `minimax-h3` MiniMax H32 cr\n- `recraft-v4.1` Recraft V4.12 cr\n- `recraft-v4.1-flash` Recraft V4.1 Flash1 cr\n- `mai-image-2.6` MAI-Image 2.63 cr\n- `gpt-image-2.5-flare` GPT Image 2.5 Flare8 cr\n- `gpt-image-2.5-sunburst` GPT Image 2.5 Sunburst8 cr\n- `gpt-image` GPT Image 28 cr\n- `nano-banana` Nano Banana3 cr\n\n## remove.bg-compatible API\n\nremove.bg's website and self-service API close on December 1, 2026. To move code written for their API, change the URL to `POST https://airgallery.com/v1.0/removebg` and put an AirGallery `ag_…` key in the same `X-Api-Key` header. Each call costs 1 credit, refunded if it fails.\n\n- Input: `image_file` ,`image_file_b64` or`image_url` , as multipart form data, a urlencoded form or JSON.\n- `bg_color` (a hex like`81d4fa` or a color name) puts the subject on a solid color.`size` ,`type` ,`crop` and`channels` are accepted and ignored.`format` must be`auto` or`png` ;`bg_image_url` isn't supported.\n- Output: the PNG bytes, or `{ \"data\": { \"result_b64\": \"…\" } }` when you send`Accept: application/json` , with`X-Credits-Charged` ,`X-Width` and`X-Height` headers.\n- Errors use remove.bg's shape: `{ \"errors\": [{ \"title\": \"…\", \"code\": \"auth_failed\" }] }` .\n- Uploads over 4.5 MB: use `https://wgbduttegyrwiukjhubh.supabase.co/functions/v1/remove-background/v1.0/removebg` (up to 25 MB), or pass`image_url` .\n\n```\n# Before: https://api.remove.bg/v1.0/removebg with your remove.bg key\ncurl -H \"X-Api-Key: ag_YOUR_API_KEY\" \\\n  -F \"image_file=@photo.jpg\" \\\n  -F \"size=auto\" \\\n  -f https://airgallery.com/v1.0/removebg -o no-bg.png\n```\n\n## REST: Credits API\n\nSingle endpoint `POST https://airgallery.com/functions/v1/credits` — the operation is selected by an `action` field in the body. A missing or unknown action returns `400`.\n\nGet the authenticated user's credit balance.\n\nRequest:\n\n```\n{ \"action\": \"balance\" }\n```\n\nResponse:\n\n```\n{ \"balances\": [{ \"credit_type_id\": \"...\", \"credit_type_name\": \"AirGallery\", \"credit_type_symbol\": \"AG\", \"balance\": 42 }] }\n```\n\nRetrieve available credit packages and pricing. Public: no auth needed.\n\nRequest:\n\n```\n{ \"action\": \"pricing-tiers\" }\n```\n\nResponse:\n\n```\n{ \"pricing_tiers\": [{ \"id\": \"...\", \"name\": \"Starter\", \"price\": 5, \"credits\": 50, \"currency\": \"USD\" }] }\n```\n\nCreate a Stripe checkout session for purchasing credits. success_url and cancel_url are optional (default: /credits).\n\nRequest:\n\n```\n{ \"action\": \"checkout\", \"pricing_tier_id\": \"tier_xxx\", \"success_url\": \"https://…\", \"cancel_url\": \"https://…\" }\n```\n\nResponse:\n\n```\n{ \"url\": \"https://checkout.stripe.com/...\" }\n```\n\nRegister or sync the current user with the credits system. Grants the one-time signup credits on first call, except to disposable email addresses and past two new accounts per network per day (then welcome_credits is 0 and welcome_skipped is \"disposable_email\" or \"ip_limit\").\n\nRequest:\n\n```\n{ \"action\": \"sync-user\", \"name\": \"Jane Doe\" }\n```\n\nResponse:\n\n```\n{ \"success\": true, \"welcome_credits\": 10 }\n```\n\n## REST: API Key Management\n\nSingle endpoint `POST https://airgallery.com/functions/v1/api-keys` — selected by the `action` field. Use the [API Keys dashboard](https://airgallery.com/api-keys) for a UI, or call these directly to automate key rotation. An `ag_` key can list keys; creating, revoking and deleting them needs a signed-in session token (Supabase JWT), and an API key gets a `403`.\n\nCreate a new developer API key (max 10 active per user). Returned key shown only once. JWT-only.\n\nRequest:\n\n```\n{ \"action\": \"create\", \"name\": \"My App\", \"scopes\": [\"read\",\"write\",\"ai\"], \"expires_in_days\": 90 }\n```\n\nResponse:\n\n```\n{ \"success\": true, \"api_key\": \"ag_xxx…\", \"key_prefix\": \"ag_xxx…\", \"scopes\": [\"read\",\"write\",\"ai\"], \"expires_at\": \"2025-…\" }\n```\n\nList the caller's API keys (does not return the secret). Works for JWT or API-key callers.\n\nRequest:\n\n```\n{ \"action\": \"list\" }\n```\n\nResponse:\n\n```\n{ \"keys\": [{ \"id\": \"…\", \"name\": \"…\", \"key_prefix\": \"ag_…\", \"scopes\": [\"read\"], \"is_active\": true }] }\n```\n\nDisable an API key without deleting it. JWT-only — an API key cannot revoke siblings.\n\nRequest:\n\n```\n{ \"action\": \"revoke\", \"key_id\": \"uuid\" }\n```\n\nResponse:\n\n```\n{ \"success\": true }\n```\n\nPermanently delete an API key. JWT-only.\n\nRequest:\n\n```\n{ \"action\": \"delete\", \"key_id\": \"uuid\" }\n```\n\nResponse:\n\n```\n{ \"success\": true }\n```\n\n## Errors & Rate Limits\n\n### Rate Limits\n\nPer-IP, 5–120 requests/min depending on endpoint. `429` includes `Retry-After` in seconds.\n\n### Credit Deduction\n\nCredits are charged when a tool run starts and refunded automatically if it fails, so failed operations cost nothing.\n\n### Idempotency\n\nAI calls are not idempotent — outputs are non-deterministic. Cache responses client-side if you need stability.", "url": "https://wpnews.pro/news/show-hn-drop-in-replacement-for-the-remove-bg-api-which-shuts-down-dec-1", "canonical_source": "https://airgallery.com/api", "published_at": "2026-11-25 20:24:42+00:00", "updated_at": "2026-11-25 20:42:32.081558+00:00", "lang": "en", "topics": ["ai-tools", "ai-products", "agent-protocols", "developer-tools", "ai-agents"], "entities": ["AirGallery", "remove.bg", "Model Context Protocol", "Claude Desktop", "Cursor", "MCP Inspector", "Glama", "Supabase"], "also_reported_by": [], "takeaway": "Developers facing remove.bg's December 1 shutdown can point the same base64-image POST at AirGallery's remove-background endpoint with an ag_ Bearer key, and wire the same key into its 60-tool MCP server at airgallery.com/functions/v1/mcp-server.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/show-hn-drop-in-replacement-for-the-remove-bg-api-which-shuts-down-dec-1", "markdown": "https://wpnews.pro/news/show-hn-drop-in-replacement-for-the-remove-bg-api-which-shuts-down-dec-1.md", "text": "https://wpnews.pro/news/show-hn-drop-in-replacement-for-the-remove-bg-api-which-shuts-down-dec-1.txt", "jsonld": "https://wpnews.pro/news/show-hn-drop-in-replacement-for-the-remove-bg-api-which-shuts-down-dec-1.jsonld"}}