Bria RMBG 3.0 API
bria/rmbg-v3.0/remove-backgroundBria RMBG 3.0 API 把照片主体抠出来,返回与输入同尺寸的透明 PNG,毛发、皮毛和细小细节都保留柔和边缘。还可以用一句话提示词说明要保留什么。Bria RMBG 3.0 API 每张图固定 3.6 积分($0.018)。
获取 API Key拖拽文件、粘贴剪贴板素材,或输入 URL。 恰好一张源图(公开 HTTP(S) URL)。
1/1 个素材
预计费用: 3.6 credits · $0.0180
每张固定 3.6 积分,提交时扣除,任务失败全额退还。
REST API
快速开始
以下流程提交一个合法的 Bria RMBG 3.0 Remove Background 请求,取得 task_id,并在异步任务结束后读取结果文件 URL。
连接 Vidgo API
创建 API Key,仅保存在服务端,并通过 Authorization: Bearer VIDGO_API_KEY 发送。
- 端点
- POST
https://api.vidgo.ai/api/generate/submit - 认证
- Authorization: Bearer VIDGO_API_KEY
提交一个任务
向统一提交端点发送当前模型 ID 与 input 对象。input 只能包含本端点参数表列出的字段,其他字段会返回 400。
curl --request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "bria/rmbg-v3.0/remove-background",
"input": {
"image_urls": [
"https://cdn.vidgo.ai/apis/models/bria/rmbg-v3.0/remove-background/v1/01/input.jpg"
],
"prompt": "Keep the white puppy and the glass fishbowl with the goldfish."
}
}'等待结果
读取 data.task_id,仅在 not_started 或 running 时继续轮询;finished 与 failed 都必须停止。
查询状态
GET https://api.vidgo.ai/api/generate/status/{task_id}建议每 2–5 秒查询一次,并对 429/5xx 退避。也可在顶层提供 callback_url,在任务进入终态时接收回调。
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "task-example",
"status": "not_started",
"created_time": "2026-11-03T08:00:00"
}
}{
"code": 200,
"data": {
"task_id": "task-example",
"status": "finished",
"created_time": "2026-11-03T08:00:00",
"progress": 100,
"files": [
{
"file_url": "https://example.com/result.png",
"file_type": "image"
}
]
}
}完整可运行轮询示例
展开后可查看同一 payload 的端到端脚本,包含业务 code、缺失 task_id、失败状态、异常状态和网络错误处理。
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "bria/rmbg-v3.0/remove-background",
"input": {
"image_urls": [
"https://cdn.vidgo.ai/apis/models/bria/rmbg-v3.0/remove-background/v1/01/input.jpg"
],
"prompt": "Keep the white puppy and the glass fishbowl with the goldfish."
}
}
JSON
)
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
TASK_ID=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.data.task_id // .task_id // empty')
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
while true; do
STATUS_RESPONSE=$(curl --silent --show-error --fail-with-body \
--url "https://api.vidgo.ai/api/generate/status/$TASK_ID" \
--header "Authorization: Bearer $VIDGO_API_KEY")
STATUS=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.data.status // .status // empty')
case "$STATUS" in
finished)
printf '%s' "$STATUS_RESPONSE" | jq -r '(.data.files // .files // [])[]?.file_url'
break
;;
failed)
printf '%s' "$STATUS_RESPONSE" | jq -r '.data.error_message // .error_message // "Generation failed"' >&2
exit 1
;;
not_started|running)
sleep 2
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
done请求参数
下表仅列出 input 对象内的公开字段。顶层 model 与可选 callback_url 请参考快速开始示例。
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| input.image_urls | string[] | 是 | – | 恰好一张源图,数组中放一个公开的 HTTP(S) URL。 |
| input.prompt | string | 否 | – | 最多 2,000 个字符,用平实的话说明要保留什么,例如 "Keep the person and the bicycle"。空白提示词会被忽略。 |
响应字段
提交响应返回任务标识;状态响应在任务结束时提供结果文件或失败信息。
| 字段 | 类型 | 说明 |
|---|---|---|
| code | integer | 业务返回码,0 或 200 表示成功。 |
| message | string | 可选的人类可读响应信息。 |
| data.task_id | string | 提交成功后用于查询状态的唯一任务 ID。 |
| data.status | string | not_started、running、finished 或 failed。 |
| data.created_time | string | 任务创建时间。 |
| data.progress | integer | 状态响应中的 0–100 进度值。 |
| data.files[] | array | finished 时按返回顺序排列的生成文件。 |
| data.files[].file_url | string | 生成文件(.png)的直接 URL。 |
| data.files[].file_type | string | 结果文件类型为 image。 |
| data.error_message | string | null | failed 状态的可读失败原因。 |
任务生命周期
只有前两个状态可继续轮询;finished 与 failed 均为终态。
not_started已接收并排队,等待执行。
running正在生成,可以继续轮询。
finished成功终态,验证 files 并读取文件 URL。
failed失败终态,读取 error_message 并停止;预扣积分会全部退还。
轮询与错误处理
- 认证使用有效的 VIDGO_API_KEY,将密钥保存在服务端,并通过 Bearer 认证发送请求。
- 参数校验400 表示模型 ID、字段、枚举、长度、数量或尺寸不符合本端点契约,包括传入其他端点的字段。
- 轮询间隔从 2–5 秒开始;对 429 和 5xx 使用指数退避,并设置总超时。
- 终态finished 后读取 files 中的文件 URL;failed 后读取 error_message。两种状态均结束轮询。
- 回调在顶层提供公开 callback_url;服务会在 finished 或 failed 后 POST 任务对象。
- 网络错误区分请求超时、网络失败和任务失败;仅在安全时重试同一查询。
模型规格
| 规格 | 取值 | 说明 |
|---|---|---|
| 模型 | bria/rmbg-v3.0/remove-background | Bria RMBG 3.0 Remove Background |
| 输入 | image_urls(1 张)+ 可选 prompt | 公开 HTTP(S) 图片 URL;prompt 最多 2,000 个字符 |
| 输出 | 1 张透明 PNG | 宽高与输入相同 |
| 价格 | 3.6 积分($0.018) | 每张固定 |
Bria RMBG 3.0 API 常见问题
Bria RMBG 3.0 API 是什么?
Bria RMBG 3.0 API 让开发者调用 RMBG 3.0,这是 Bria AI 第三代背景移除模型,也是其首个基于生成式基础模型构建的版本。在 Vidgo 上,它接收一个图片 URL 和可选提示词,返回与输入同尺寸的透明 PNG。你可以通过 API 调用,也可以在上方体验区直接试用。
Bria RMBG 3.0 API 多少钱?
每张图 3.6 积分($0.018),带不带提示词价格相同。任务失败全额退还。
Bria RMBG 3.0 API 的提示词有什么用?
提示词用平实的话说明要保留什么,最多 2,000 个字符。示例中 "Keep the white puppy and the glass fishbowl with the goldfish" 在杂乱的门廊上保留了这两个物体。提示词为可选,价格始终是 3.6 积分。
Bria RMBG 3.0 API 返回什么输出?
一张与输入宽高相同的透明背景 PNG;928×1152 的示例照片返回了 928×1152 的 PNG。
Bria RMBG 3.0 API 处理毛发和皮毛的效果如何?
Bria 表示 RMBG 3.0 在其基准测试的毛发与皮毛类别中平均排名最好,萨摩耶示例也把逆光的毛保留为柔和边缘。
每次请求可以发送几张图?
每次请求恰好一张图。批量处理时每张照片提交一个任务,每个任务 3.6 积分。



