curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "poyo-ai/video-background-removal",
"input": {
"video_url": "https://example.com/dancer.mp4",
"background_color": "Transparent",
"output_container_and_codec": "webm_vp9",
"preserve_audio": true
}
}
'
{
"code": 200,
"data": {
"task_id": "task-unified-1793176000-example",
"status": "not_started",
"created_time": "2026-10-28T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "validation_error"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "validation_error"
}
}AI 工具
视频背景移除
移除视频背景,返回透明或纯色背景的结果。
POST
/
api
/
generate
/
submit
curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "poyo-ai/video-background-removal",
"input": {
"video_url": "https://example.com/dancer.mp4",
"background_color": "Transparent",
"output_container_and_codec": "webm_vp9",
"preserve_audio": true
}
}
'
{
"code": 200,
"data": {
"task_id": "task-unified-1793176000-example",
"status": "not_started",
"created_time": "2026-10-28T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "validation_error"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "validation_error"
}
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
模型
- poyo-ai/video-background-removal — 移除一个视频的背景
必填参数
video_url(string):源视频 URL。
可选参数
output_container_and_codec(string):mp4_h265、mp4_h264、webm_vp9、mov_h265、mov_proresks、mkv_h265、mkv_h264、mkv_vp9或gif。preserve_audio(boolean):是否保留源音轨。background_color(string):Transparent、Black、White、Gray、Red、Green、Blue、Yellow、Cyan、Magenta或Orange。区分大小写。
输出
任务完成后,files 中返回一个视频,file_type: video,按请求的 output_container_and_codec 编码。
示例
- 透明背景,输出 WebM — 设置
video_url、background_color、output_container_and_codec、preserve_audio。 - 绿幕,输出 MP4 — 设置
video_url、background_color、output_container_and_codec。
注意事项
- 省略的可选字段使用供应商默认值。
- 如需透明结果,请将
Transparent与支持 Alpha 通道的容器搭配使用,例如webm_vp9或mov_proresks。 - PoYo 在提交前会读取视频时长。如果无法确定时长,提交会失败。
授权
所有 API 接口都需要 Bearer Token 认证。
创建 API Key:登录 PoYo,进入 仪表盘 → API 密钥(poyo.ai/zh/dashboard/api-key),点击创建 Key。
在请求头中添加:
Authorization: Bearer YOUR_API_KEY
请求体
application/json
响应
任务提交成功
Show child attributes
Show child attributes