Remove an image's background with DeepAI's API
DeepAI's background remover API cuts the subject out of one image per request, for product photos, profile images and composites. Each image costs $0.01. Send POST https://deepai.pay.zeroclick.io/zcj/wnwzyd8oac2y/api/background-remover with the image's URL in image and a free agent credential from auth.md, pay the 402 price quote over x402 or MPP and retry, then read output_url for the cutout.
At a glance
- Endpoint:
POST https://deepai.pay.zeroclick.io/zcj/wnwzyd8oac2y/api/background-remover, one image per request - Body:
{"image": "<image URL>"}as JSON, or the file asimageinmultipart/form-data.imageis the only field, and it is required. - Price: $0.01
- Credential: an agent credential on every call, paid retries included, sent as
Authorization: Bearer <token>, or asZC-Agent-Authorization: Bearer <token>beside an MPP payment. Registering one at auth.md is free and can be anonymous, and its steps leave the access token inACCESS_TOKEN, as the examples below use. - Payment: each request answers with a 402 price quote, paid from a wallet over x402 or MPP.
- Response: JSON with
id, the job identifier, andoutput_url, the link to the image with the background removed - Limits: one image per call, with no batch field. Card pays a single call only at $0.50 or more.
- Full purchase flow: buyer skill
Remove the background from one image
Send the image's URL. The example image is a public-domain NASA photo:
curl -sS -X POST https://deepai.pay.zeroclick.io/zcj/wnwzyd8oac2y/api/background-remover \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H 'Content-Type: application/json' \ -d '{"image": "https://images-assets.nasa.gov/image/PIA23882/PIA23882~medium.jpg"}'The storefront answers with a 402 price quote for $0.01.
Pay the quote with an x402 or MPP client and retry the identical request with the proof attached and the same bearer. The buyer skill and How to pay have the steps for each rail.
Read the response:
{"id": "<job id>", "output_url": "<link to the image with the background removed>"}The example request above paid $0.01, and its response held a string
idand a stringoutput_url. Each paid response also carries azc-billingheader withchargedUsdfor that request.
In a pipeline, this step comes after an image is generated or edited, with one request per image.
Choose the input and the way to pay
| Condition | Send |
|---|---|
| The image is at a URL | Content-Type: application/json with {"image": "<url>"} |
| The image is a local file | multipart/form-data with the file as image, for example -F 'image=@photo.jpg' |
| Condition | Pay with |
|---|---|
| Paying from a wallet, per image | Pay-as-you-go: one 402 per image over x402 or MPP |
| Paying by card, or drawing from a prepaid balance | Credits, a prepaid balance from $0.50 (from $0.50 by card) that calls draw down |
Buying Credits uses the same credential; the buyer skill has the steps. On a balance, zc-billing reports chargedUsd and remainingCreditUsd.
A batch costs the number of images times the per-image price. For example, 100 product photos cost $1.
Limits
- One image per request. A set of 40 photos is 40 requests, and each pays its own 402.
- The request takes
imageand nothing else. There are no options for the output. - Card pays a pay-as-you-go call only when that call costs $0.50 or more. Below that amount, pay on a wallet rail or draw from Credits.
- Free reads, such as
GET https://deepai.pay.zeroclick.io/zcj/wnwzyd8oac2y/manifest.jsonandGET https://deepai.pay.zeroclick.io/zcj/wnwzyd8oac2y/services/background-remover, show the live price before you call.
Errors
| Status or code | Meaning | Action |
|---|---|---|
402 with a payment block and no reason | The per-image price quote | Pay it and retry the same request, or stop |
400 invalid_request | The body is malformed | Fix the JSON. image is required. |
settlement_failed | The payment did not settle. settlementReason says why, such as insufficient_funds. | Fix the wallet, then send a fresh request for a new 402 |
409 payment_request_mismatch | A payment was reused for a different request | Request and pay a fresh 402 for each image |
payment_consumed | That payment was already spent | Check whether the earlier request delivered before you pay again |
usage_exhausted | The Credits balance is used up | Top up with POST https://deepai.pay.zeroclick.io/zcj/wnwzyd8oac2y/extend and {"amountUsd": "..."} |
401 bearer_required | The call carried no agent credential | Register at auth.md and retry with the bearer |
After a paid call is forwarded, an error from DeepAI's own API arrives with DeepAI's status code and body. The error reference lists every storefront code.
Frequently asked questions
Does DeepAI's background removal API need an API key?
No DeepAI account or API key, but every call carries a free agent credential from auth.md, registered once and anonymously if you like. Each pay-as-you-go call is then paid at the request with an x402 or MPP 402.
How much does it cost to remove the background from an image?
$0.01. A batch costs the image count times that price, so 50 images cost $0.50, and the 402 states the exact amount before each payment.
Can I remove backgrounds from several images in one request?
No. The endpoint takes one image per request, so a batch is a series of requests, each with its own 402 or its own draw on a Credits balance.
Can I pay for a background removal by card?
Card pays a pay-as-you-go call only at $0.50 or more. For smaller calls, pay on a wallet rail, or buy Credits by card from $0.50 and let each cutout draw down the balance.
Can I upload an image file instead of a URL?
Yes. Send multipart/form-data with the file in the image field. The price and the response are the same as for a URL.
Keep reading
- Buyer skill: the full purchase flow
- How to pay: the 402, x402, MPP, card and Credits
- Background remover service: live prices by plan
- Background remover API reference: the request and response schemas
- Error reference: every code and how to react