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.
/api/jobs/{id}/segmentX-API-Key. Keep your key on your server; never embed it in a public website.Request parameters
pointsarrayrequiredOrdered [x, y] stroke coordinates inside the image. Include both ends and sample evenly along the path.
radiusnumberBrush 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.
modestringdefault: eraseIntended editor action. Both modes return the same detected boundary, without an extra erase margin; the caller subtracts or restores the mask.
eraserestoreResponse
200 · Success{
"binary": "PNG selection mask"
}Errors use a structured error.code and error.message. See error handling →