Build an iOS Shortcut That Removes Photo Backgrounds via API (Share Sheet, One Tap)
iOS can lift a subject from a photo with a long press, but the edge quality is aimed at stickers, and there is no way to script it into a workflow. The Shortcuts app can call an HTTP API directly, which turns the bgclear endpoint into a one-tap Share Sheet action: share any photo, get a clean transparent PNG back in Photos. No app to install, no computer involved. Here is the shortcut, action by action, plus the one thing to think about before sharing it with anyone.
In this guide
The shortcut, action by action
Open Shortcuts → + → name it "Remove Background". Then add these actions in order:
1. Receive [Images] input from [Share Sheet]
If there is no input: Select Photos (so it also works from the app icon)
2. Get Contents of URL
URL: https://www.bgclear.ai/api/v1/remove
Method: POST
Headers: Authorization = Bearer bgc_live_YOUR_KEY
Request Body: Form
image_file (File) = Shortcut Input ← the photo
size (Text) = preview ← free; "auto" or "full" costs 1 credit
format (Text) = png
3. Save to Photo Album ← input: Contents of URL (the PNG)
or: Quick Look, to preview before savingTurn on Show in Share Sheet in the shortcut's settings and set Share Sheet Types to Images. From then on: open any photo → Share → Remove Background → the cutout lands in Photos a few seconds later. Get a key on the API dashboard; the first key includes 10 free full-resolution credits.
Preview vs full resolution, and a white background
size=preview returns up to 800 px and is free without limit — plenty for chat stickers, profile pictures and quick mockups. For prints, listings and anything you will zoom, duplicate the shortcut as "Remove Background (HD)" with size=auto: one credit per image, full resolution up to 4 megapixels synchronously. Add an Ask for Input action if you prefer one shortcut that asks each time.
For a solid white background (ID photos, marketplace listings) add a form field bg_color = ffffff and set format = jpg; Photos will store a JPG. Add Resize Image before the request if you shoot 48 MP and want to stay under the 4 MP synchronous limit — 2500 px on the long edge is more than enough for a passport photo or a product tile.
Errors and the key question
If the API rejects the request, Get Contents of URL raises an error with the JSON body — add a Get Dictionary Value for error.message and Show Result so you see "insufficient_credits" instead of a generic failure. The two you will meet: 402 when the credits are gone (top up), 429 if you fire more than 60 requests a minute.
The key lives inside the shortcut. That is fine for a personal shortcut on your own devices, and iCloud syncs it privately. It is not fine for a shortcut you share: anyone who imports it can read the key and spend your credits. For a shortcut you distribute — to a team, a class, or publicly — point it at a small proxy endpoint you own (the Cloudflare Workers proxy is forty lines and free to run) and keep the key there. Rotate a leaked key from the dashboard; it takes effect immediately.
Cost and alternatives
Previews cost nothing; full-resolution images are one credit — $9 for 100, $39 for 500, $129 for 2,000; credits never expire and failed requests are never charged. If you do not want a shortcut at all, bgclear.ai in Safari does the same job free with no key, and the iPhone guide compares it with the built-in subject lift. Android users can build the same thing in Tasker or simply use the site; the automation guides for n8n, Zapier and Make cover desktop workflows.
Frequently asked questions
Does Get Contents of URL support file uploads?
Yes — set Request Body to Form and add a field of type File; pass the photo as its value. That produces the multipart request the API expects.
Why does the built-in iOS subject lift not replace this?
It is optimised for stickers and cannot be scripted or set to full resolution reliably; hair and fine edges are softer. The API returns the original resolution with a cleaner matte.
Is it safe to keep my API key in a shortcut?
For your own devices, yes. Never share a shortcut containing the key; use a proxy endpoint for shared shortcuts and rotate any key that leaks.
What does it cost per photo?
Preview size (≤800 px) is free and unlimited. Full resolution is one credit, $0.065–0.09 depending on pack, with no subscription.