Skip to content

Extract Object

Integrate

Model id bria/extract-object
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/bria/extract-object?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "yellow hammer"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

This request: $0.02 20 API credits Run it on this page

Get API key
Bria AI · Image

Your first result goes here

Build a request below and run it with your API key. Outputs are copied to our storage, kept forever or 7 days for free.

Build a request

Controls are generated from the model schema. The code and the price update as you change them.

Object to act on, described in natural language, such as 'the red car'.

Advanced image · autocrop · remove_background
image_url default https://bria-datasets...
Drop a file, or

Source image supplied through a public URL, raw base64-encoded image bytes, or a base64 data URI such as data:image/png;base64,... .

POST /run/bria/extract-object?wait=20 quote → $0.02
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/bria/extract-object?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "yellow hammer"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Run this request

Your key stays in this browser: it is sent only to the Doitong API and saved (localStorage) only if you tick Remember. Get an API key

About Extract Object

Finds the object described in `prompt` within the image from `image_url` and returns it on a transparent background, together with the segmentation mask. `autocrop` tightens the canvas to the object. `remove_background` refines the cutout edge with background removal instead of using the segmentation mask alone. If nothing matches, the full input image is returned.

Parameters

Send either the canonical name or the native name, not both. Canonical names

NameType DefaultAllowed Description
image_urloptional image
Typeurl · image
Defaulthttps://bria-datasets.s3.amazonaws.com/object-extraction/tools_construction_flatlay.jpg
Source image supplied through a public URL, raw base64-encoded image bytes, or a base64 data URI such as data:image/png;base64,... .
promptoptional
Typestring
Defaultyellow hammer
Object to act on, described in natural language, such as 'the red car'.
autocropoptional
Typeboolean
Defaultfalse
Crop the output canvas to fit the extracted object.
remove_backgroundoptional
Typeboolean
Defaultfalse
Cutout alpha refinement switch. The default, False, skips salient-object matting and takes alpha directly from SAM segmentation, making processing faster and helping preserve text, logos, or graphics that RMBG might trim excessively. Set True to refine alpha using RMBG background removal.
required Canonical name, also accepted

File parameters take a public https:// URL, a data: URI up to 10 MB, or the file_url of an upload. Files

Output

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "bria/extract-object",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 20,
    "usd": "0.02",
    "charged": 20,
    "refunded": 0
  },
  "input": {
    "prompt": "yellow hammer"
  },
  "output": {
    "image": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768
    },
    "mask": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768
    }
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Your files, your choiceEvery outputs[].url is a copy on our storage: kept forever (paid per GB-month) or 7 days for free, by your account setting or ?storage=.
Same shape on every modeltype, url, content_type, width, height and duration, for images, video and audio alike. output is the model’s own result object.
Fields of output
image
object {url, content_type, file_name, file_size, width, height}Full source image if the prompt finds no matching object; otherwise, an RGBA result with the extracted object surrounded by transparency.
mask
object {url, content_type, file_name, file_size, width, height}Extraction mask whose no-match fallback depends on the input: RGBA images supply their alpha channel, while all other images produce an entirely white mask.

More models: Image Editing

For AI agents: this page as Markdown is at https://doitong.com/en-US/developers/models/bria/extract-object.md. All models and guides: https://doitong.com/developers/llms.txt