# 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/9e00g6chd3t6/api/background-remover` with the image's URL in `image`, 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/9e00g6chd3t6/api/background-remover`, one image per request
- **Body:** `{"image": "<image URL>"}` as JSON, or the file as `image` in `multipart/form-data`. `image` is the only field, and it is required.
- **Price:** $0.01
- **Payment:** each request answers with a 402 price quote, paid from a wallet over x402 or MPP. No account or API key is needed.
- **Response:** JSON with `id`, the job identifier, and `output_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](https://deepai.pay.zeroclick.io/zcj/9e00g6chd3t6/SKILL.md)

## Remove the background from one image

1. Send the image's URL. The example image is a public-domain NASA photo:

   ```bash
   curl -sS -X POST https://deepai.pay.zeroclick.io/zcj/9e00g6chd3t6/api/background-remover \
     -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.

2. Pay the quote with an x402 or MPP client and retry the identical request with the proof attached. The [buyer skill](https://deepai.pay.zeroclick.io/zcj/9e00g6chd3t6/SKILL.md) and [How to pay](https://deepai.pay.zeroclick.io/zcj/9e00g6chd3t6/payment.md) have the steps for each rail.

3. Read the response:

   ```json
   {"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 `id` and a string `output_url`. Each paid response also carries a `zc-billing` header with `chargedUsd` for 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 needs an agent credential from [auth.md](https://deepai.pay.zeroclick.io/zcj/9e00g6chd3t6/auth.md); [the buyer skill](https://deepai.pay.zeroclick.io/zcj/9e00g6chd3t6/SKILL.md) 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 `image` and 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/9e00g6chd3t6/manifest.json` and `GET https://deepai.pay.zeroclick.io/zcj/9e00g6chd3t6/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/9e00g6chd3t6/extend` and `{"amountUsd": "..."}` |
| `401 bearer_required` | A Credits purchase was sent without an agent credential | Register at [auth.md](https://deepai.pay.zeroclick.io/zcj/9e00g6chd3t6/auth.md), or pay per image |

After a paid call is forwarded, an error from DeepAI's own API arrives with DeepAI's status code and body. [The error reference](https://deepai.pay.zeroclick.io/zcj/9e00g6chd3t6/errors.md) lists every storefront code.

## Frequently asked questions

### Does DeepAI's background removal API need an API key?

No. Each pay-as-you-go call is paid at the request with an x402 or MPP 402, and no account or upstream key is involved. Only a Credits purchase needs an agent credential, which the storefront issues through its identity document.

### 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](https://deepai.pay.zeroclick.io/zcj/9e00g6chd3t6/SKILL.md): the full purchase flow
- [How to pay](https://deepai.pay.zeroclick.io/zcj/9e00g6chd3t6/payment.md): the 402, x402, MPP, card and Credits
- [Background remover service](https://deepai.pay.zeroclick.io/zcj/9e00g6chd3t6/services/background-remover): live prices by plan
- [Background remover API reference](https://deepai.pay.zeroclick.io/zcj/9e00g6chd3t6/services/background-remover/openapi.json): the request and response schemas
- [Error reference](https://deepai.pay.zeroclick.io/zcj/9e00g6chd3t6/errors.md): every code and how to react

---

Updated 2026-10-16. All DeepAI guides: https://deepai.pay.zeroclick.io/guides.md. Storefront: https://deepai.pay.zeroclick.io/zcj/9e00g6chd3t6/llms.txt.
