---
description: Clearcut smart brush. Learn how to remove image backgrounds, manage jobs and work with credits in your application.
title: Smart Brush | Clearcut
image: https://clearcut.sh/og/docs.png
---

GUIDES

[Quick start](https://clearcut.sh/docs)[Authentication](https://clearcut.sh/docs/authentication)[Credits & billing](https://clearcut.sh/docs/credits)[Limits & retries](https://clearcut.sh/docs/limits)[Examples](https://clearcut.sh/docs/examples)[Errors](https://clearcut.sh/docs/errors)

API REFERENCE

[POSTRemove a background](https://clearcut.sh/docs/remove-background)[GETremove.bg account info](https://clearcut.sh/docs/removebg-account)[POSTCreate an image job](https://clearcut.sh/docs/create-job)[GETGet a job](https://clearcut.sh/docs/get-job)[GETList images](https://clearcut.sh/docs/list-jobs)[DELETEDelete an image](https://clearcut.sh/docs/delete-job)[GETDownload a result](https://clearcut.sh/docs/download)[POSTExport an edited image](https://clearcut.sh/docs/export)[POSTUpload a background](https://clearcut.sh/docs/background)[POSTExport a ZIP batch](https://clearcut.sh/docs/batch-export)[POSTCopy a batch background](https://clearcut.sh/docs/batch-background)[POSTSmart Brush](https://clearcut.sh/docs/smart-brush)[POSTGenerate a scene](https://clearcut.sh/docs/generate-scene)[GETCredit balance](https://clearcut.sh/docs/account)[POSTRetry a failed image](https://clearcut.sh/docs/retry-job)[GETRecent usage](https://clearcut.sh/docs/usage)[Download OpenAPI](https://clearcut.sh/openapi.json)

API reference / Smart Brush

# Smart Brush

Select a region or object with 1–32 stroke points in original image coordinates. Selection balances model confidence with the painted stroke; it can extend to detected boundaries beyond the brush. Returns a PNG selection mask; the caller applies it to the editor. Uses 1 credit per request.

POST`/api/jobs/{id}/segment`

Authenticate with `X-API-Key`. Keep your key on your server; never embed it in a public website.

## Request parameters

`points`array**required**

Ordered \[x, y\] stroke coordinates inside the image. Include both ends and sample evenly along the path.

`radius`number

Brush radius in original-image pixels, greater than zero and at most the longest image edge. Defaults to 2% of the longest edge. Used to rank selection candidates against the painted area.

`mode`stringdefault: erase

Intended editor action. Both modes return the same detected boundary, without an extra erase margin; the caller subtracts or restores the mask.

`erase` `restore`

## Response

200 · Success

{
  "binary": "PNG selection mask"
}

Errors use a structured `error.code` and `error.message`. [See error handling →](https://clearcut.sh/docs/errors)

## Example request

Replace IMAGE\_ID with your job ID. This example calls the endpoint shown here.

cURLPythonNode.js

```
curl https://clearcut.sh/api/jobs/IMAGE_ID/segment \
  -X POST -H "X-API-Key: $CLEARCUT_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"points":[[100,100]],"mode":"erase"}' -o selection.png
```

[More examples →](https://clearcut.sh/docs/examples)

Need help?

Prefer email? [support@clearcut.sh](mailto:support@clearcut.sh)

Smart Brush | Clearcut

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://clearcut.sh/#organization","name":"Clearcut","url":"https://clearcut.sh","logo":"https://clearcut.sh/apple-touch-icon.png","email":"support@clearcut.sh","description":"An independent image background removal service operated by chern0.dev.","contactPoint":{"@type":"ContactPoint","email":"support@clearcut.sh","contactType":"customer support"}},{"@type":"WebSite","@id":"https://clearcut.sh/#website","url":"https://clearcut.sh","name":"Clearcut","description":"Remove image backgrounds with Clearcut. Get 30 free credits every month for the website and API. Full-resolution downloads, no watermark. Packs from $3.","inLanguage":"en","publisher":{"@id":"https://clearcut.sh/#organization"}}]}
```
