> ## Documentation Index
> Fetch the complete documentation index at: https://docs.poyo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Bria RMBG 3.0

> Bria RMBG 3.0 API 去除单张图片的背景，返回与输入同尺寸的透明 PNG，可选用自然语言提示词指定要保留的内容。

> [!TIP]
>
> 1. 提交后会返回 `task_id`。如果提供了 `callback_url`，当任务状态变为 `finished` 或 `failed` 时，系统会向 `callback_url` 发送 POST 请求。
> 2. 无论是否提供 `callback_url`，都可以通过统一的[查询任务状态](https://docs.poyo.ai/zh/api-manual/task-management/status.md)接口获取结果。

使用 `bria-rmbg-3.0` 从照片中抠出主体，适用于商品上架图、头像、设计样机和合成素材。传入一张图片，返回一张同尺寸的透明 PNG。如果想要的不是最明显的主体，例如多保留一件物品，或只保留画面中的某一件东西，可以加一句简短的提示词。

## 模型

* **bria-rmbg-3.0** — 输入一张图片，输出一张透明背景的 PNG 抠图

## 功能

* 传入一张图片，即可自动抠出画面中最明显的主体。
* 按提示词抠图：在主体之外多保留某物、去掉某物，或只保留某一件。
* 保留区域是原图像素，只新增透明通道。
* 输出带透明通道的 PNG，宽高与输入图片相同。
* 支持 JPEG、PNG、WebP、GIF、AVIF、HEIC 和 HEIF 图片。

## 必填参数

* `image_urls`（字符串数组）：恰好 1 个可公开访问的 HTTP(S) 图片 URL（JPEG、PNG、WebP、GIF、AVIF、HEIC 或 HEIF）。

## 可选参数

* `prompt`（字符串）：用自然语言说明要保留的内容，最多 2,000 个字符。例如："the person with the mat and the plant"、"the woman at her desk without the lamp"、"only the chair"。`prompt` 留空时，模型保留照片中最明显的主体。

## 输出

任务完成后，[查询任务状态](https://docs.poyo.ai/zh/api-manual/task-management/status.md)和回调中的 `files` 包含一张带透明通道的 PNG 图片。背景为透明，宽高与输入图片相同。

```json theme={"dark"}
{
  "files": [
    {
      "file_url": "https://storage.poyo.ai/images/task-unified-1795564800-abcd1234/task-unified-1795564800-abcd1234.png",
      "file_type": "image"
    }
  ]
}
```

## 示例

### 细节边缘抠图

抠出蒲公英花球，连同正在飘散的种子一起保留：

```json theme={"dark"}
{
  "model": "bria-rmbg-3.0",
  "input": {
    "image_urls": ["https://storage.poyo.ai/models/bria-rmbg-3-0/examples/rmbg3-input-dandelion-3dfee980c4a6.png"]
  }
}
```

### 只保留商品

从街拍照片里只保留镂空针织开衫，可直接用作商品图：

```json theme={"dark"}
{
  "model": "bria-rmbg-3.0",
  "input": {
    "image_urls": ["https://storage.poyo.ai/models/bria-rmbg-3-0/examples/rmbg3-input-crochet-da4fe2ab38df.png"],
    "prompt": "only the crochet cardigan"
  }
}
```

### 带回调

抠出发丝被风吹起、围着轻薄丝巾的人像，并通过回调接收结果：

```json theme={"dark"}
{
  "model": "bria-rmbg-3.0",
  "callback_url": "https://your-domain.com/callback",
  "input": {
    "image_urls": ["https://storage.poyo.ai/models/bria-rmbg-3-0/examples/rmbg3-input-scarf-5b87af427ae2.png"]
  }
}
```

## 注意事项

* 每次请求处理一张图片，多张图片请分别提交。
* 请求通常在一分钟内完成；按提示词抠图比自动抠图耗时更长。


## OpenAPI

````yaml zh/api-manual/image-series/bria-rmbg-3-0.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: PoYo AI - Bria RMBG 3.0 API
  description: Bria RMBG 3.0 API 去除单张图片的背景，返回与输入同尺寸的透明 PNG，可选用自然语言提示词指定要保留的内容。
  version: 1.0.0
servers:
  - url: https://api.poyo.ai
    description: 生产环境
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Bria RMBG 3.0
      summary: 提交 Bria RMBG 3.0 任务
      description: Bria RMBG 3.0 抠图：输入一张图片，输出一张透明背景的 PNG 抠图。
      operationId: submitBriaRmbg30Task
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              fine-detail-cutout:
                summary: 细节边缘抠图
                value:
                  model: bria-rmbg-3.0
                  input:
                    image_urls:
                      - >-
                        https://storage.poyo.ai/models/bria-rmbg-3-0/examples/rmbg3-input-dandelion-3dfee980c4a6.png
              keep-only-product:
                summary: 只保留商品
                value:
                  model: bria-rmbg-3.0
                  input:
                    image_urls:
                      - >-
                        https://storage.poyo.ai/models/bria-rmbg-3-0/examples/rmbg3-input-crochet-da4fe2ab38df.png
                    prompt: only the crochet cardigan
              with-callback:
                summary: 带回调
                value:
                  model: bria-rmbg-3.0
                  callback_url: https://your-domain.com/callback
                  input:
                    image_urls:
                      - >-
                        https://storage.poyo.ai/models/bria-rmbg-3-0/examples/rmbg3-input-scarf-5b87af427ae2.png
      responses:
        '200':
          description: 任务提交成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: 请求参数无效
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 未授权：API Key 无效
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      additionalProperties: false
      properties:
        model:
          type: string
          enum:
            - bria-rmbg-3.0
          description: Bria RMBG 3.0 模型标识。
        callback_url:
          type: string
          format: uri
          description: 可选的 Webhook URL，用于任务完成或失败时的通知。
        input:
          type: object
          additionalProperties: false
          required:
            - image_urls
          description: 去除一张图片的背景。任务返回一个透明背景的 PNG 文件，宽高与输入图片相同。
          properties:
            image_urls:
              type: array
              minItems: 1
              maxItems: 1
              items:
                type: string
                format: uri
              description: >-
                需要抠图的图片 URL，必须恰好 1 个，且必须是数组。URL 必须是可公开访问的 HTTP 或 HTTPS 地址，指向
                JPEG、PNG、WebP、GIF、AVIF、HEIC 或 HEIF 图片。
              example:
                - >-
                  https://storage.poyo.ai/models/bria-rmbg-3-0/examples/rmbg3-input-dandelion-3dfee980c4a6.png
            prompt:
              type: string
              maxLength: 2000
              description: >-
                可选，用自然语言说明要保留的内容，最多 2000 个字符。可以在主体之外多保留某物（"the person with the
                mat and the plant"）、去掉某物（"the woman at her desk without the
                lamp"），或只保留某一件（"only the chair"）。`prompt` 留空时，模型保留照片中最明显的主体。
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
          description: >-
            业务状态码。`200` 表示成功，其他值都表示请求失败。请务必检查这个字段：部分参数校验错误会以 HTTP 200 返回，响应体里的
            `code` 为 `400`。


            - `200`：成功

            - `400`：请求参数无效

            - `401`：API Key 缺失或无效

            - `402`：积分不足

            - `403`：没有权限

            - `404`：资源不存在

            - `408`：请求超时

            - `429`：请求频率超限

            - `500`：服务器内部错误

            - `502`：上游服务错误

            - `503`：服务暂不可用


            详见[错误码](/zh/api-manual/error-codes)。
          enum:
            - 200
            - 400
            - 401
            - 402
            - 403
            - 404
            - 408
            - 429
            - 500
            - 502
            - 503
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-unified-1794470400-abcd1234
              description: 任务唯一标识，用于查询任务状态
            status:
              type: string
              enum:
                - not_started
                - running
                - finished
                - failed
              example: not_started
              description: >-
                任务状态。提交后立即返回时始终为
                `not_started`。后续状态请通过[查询任务状态](/zh/api-manual/task-management/status)接口或
                `callback_url` 获取。


                - `not_started`：排队中，等待处理

                - `running`：生成中

                - `finished`：已完成，结果在 `files` 或 `output` 中

                - `failed`：失败，详情见 `error_message`
            created_time:
              type: string
              format: date-time
              example: '2026-11-12T10:30:00'
              description: 任务创建时间，ISO 8601 格式
    ErrorResponse:
      type: object
      required:
        - code
        - error
      properties:
        code:
          type: integer
          example: 400
          enum:
            - 200
            - 400
            - 401
            - 402
            - 403
            - 404
            - 408
            - 429
            - 500
            - 502
            - 503
          description: >-
            业务状态码。`200` 表示成功，其他值都表示请求失败。请务必检查这个字段：部分参数校验错误会以 HTTP 200 返回，响应体里的
            `code` 为 `400`。


            - `200`：成功

            - `400`：请求参数无效

            - `401`：API Key 缺失或无效

            - `402`：积分不足

            - `403`：没有权限

            - `404`：资源不存在

            - `408`：请求超时

            - `429`：请求频率超限

            - `500`：服务器内部错误

            - `502`：上游服务错误

            - `503`：服务暂不可用


            详见[错误码](/zh/api-manual/error-codes)。
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
              example: Invalid request parameters
            type:
              type: string
              example: invalid_request_error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        所有 API 接口都需要 Bearer Token 认证。


        创建 API Key：登录 PoYo，进入 **仪表盘 → API
        密钥**（[poyo.ai/zh/dashboard/api-key](https://poyo.ai/zh/dashboard/api-key)），点击创建
        Key。


        在请求头中添加：


        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.