tavus-video-gen

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Tavus Video Generation Skill

Tavus 视频生成 Skill

Generate personalized AI videos with replicas speaking your script.
使用Tavus Replica朗读你的脚本,生成个性化AI视频。

Quick Start

快速开始

bash
curl -X POST https://tavusapi.com/v2/videos \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "replica_id": "rfe12d8b9597",
    "script": "Hey there! Welcome to our product demo."
  }'
Response:
json
{
  "video_id": "1e30440cf9",
  "status": "queued"
}
bash
curl -X POST https://tavusapi.com/v2/videos \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "replica_id": "rfe12d8b9597",
    "script": "Hey there! Welcome to our product demo."
  }'
响应:
json
{
  "video_id": "1e30440cf9",
  "status": "queued"
}

Full API Options

完整API参数选项

bash
curl -X POST https://tavusapi.com/v2/videos \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "replica_id": "rfe12d8b9597",
    "script": "Your script text here",
    "video_name": "Product Demo v1",
    "callback_url": "https://your-webhook.com/video-ready",
    "background_url": "https://example.com/landing-page",
    "background_source_url": "https://s3.../background.mp4",
    "watermark_url": "https://s3.../logo.png",
    "fast": false,
    "transparent_background": false
  }'
bash
curl -X POST https://tavusapi.com/v2/videos \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "replica_id": "rfe12d8b9597",
    "script": "Your script text here",
    "video_name": "Product Demo v1",
    "callback_url": "https://your-webhook.com/video-ready",
    "background_url": "https://example.com/landing-page",
    "background_source_url": "https://s3.../background.mp4",
    "watermark_url": "https://s3.../logo.png",
    "fast": false,
    "transparent_background": false
  }'

Parameters

参数说明

ParamDescription
replica_id
Required. Stock or custom replica ID
script
Text for replica to speak (use this OR audio_url)
audio_url
Pre-recorded audio (.wav/.mp3) for replica to lip-sync
video_name
Display name
callback_url
Webhook for completion/error
background_url
Website URL to record as background
background_source_url
Video file URL for background
watermark_url
PNG/JPEG logo overlay
fast
Quick render (disables some features)
transparent_background
WebM with alpha (requires
fast: true
)
ParamDescription
replica_id
必填项。官方预设或自定义的Replica ID
script
让Replica朗读的脚本文本(使用该参数或
audio_url
二选一)
audio_url
预录制的音频文件(.wav/.mp3格式),用于Replica唇形同步
video_name
视频显示名称
callback_url
视频完成/出错时触发的Webhook地址
background_url
作为视频背景的网站URL(将录制该页面内容)
background_source_url
作为视频背景的视频文件URL
watermark_url
作为水印的PNG/JPEG格式Logo地址
fast
快速渲染模式(会禁用部分功能)
transparent_background
生成带透明通道的视频(需开启
fast: true

Using Audio Instead of Script

使用音频替代脚本

json
{
  "replica_id": "rfe12d8b9597",
  "audio_url": "https://s3.../narration.mp3"
}
Supported formats:
.wav
,
.mp3
json
{
  "replica_id": "rfe12d8b9597",
  "audio_url": "https://s3.../narration.mp3"
}
支持的格式:
.wav
.mp3

Background Options

背景选项

Website Background

网站背景

Records a scrolling website as the background:
json
{
  "background_url": "https://example.com/landing-page"
}
录制滚动的网站页面作为视频背景:
json
{
  "background_url": "https://example.com/landing-page"
}

Video Background

视频背景

Uses a video file:
json
{
  "background_source_url": "https://s3.../promo-bg.mp4"
}
使用视频文件作为背景:
json
{
  "background_source_url": "https://s3.../promo-bg.mp4"
}

Transparent Background

透明背景

For compositing in video editors:
json
{
  "fast": true,
  "transparent_background": true
}
Outputs
.webm
with alpha channel.
适用于视频编辑软件后期合成:
json
{
  "fast": true,
  "transparent_background": true
}
输出带Alpha通道的
.webm
格式视频。

Check Video Status

查看视频状态

bash
curl https://tavusapi.com/v2/videos/{video_id} \
  -H "x-api-key: YOUR_API_KEY"
Status values:
queued
,
generating
,
ready
,
error
,
deleted
When ready:
json
{
  "status": "ready",
  "hosted_url": "https://videos.tavus.io/video/xxx",
  "download_url": "https://stream.mux.com/.../high.mp4",
  "stream_url": "https://stream.mux.com/xxx.m3u8"
}
bash
curl https://tavusapi.com/v2/videos/{video_id} \
  -H "x-api-key: YOUR_API_KEY"
状态值说明:
queued
(排队中)、
generating
(生成中)、
ready
(已就绪)、
error
(出错)、
deleted
(已删除)
视频就绪时的响应:
json
{
  "status": "ready",
  "hosted_url": "https://videos.tavus.io/video/xxx",
  "download_url": "https://stream.mux.com/.../high.mp4",
  "stream_url": "https://stream.mux.com/xxx.m3u8"
}

Webhook Callback

Webhook回调

On completion:
json
{
  "video_id": "1e30440cf9",
  "status": "ready",
  "hosted_url": "https://videos.tavus.io/video/1e30440cf9",
  "download_url": "...",
  "stream_url": "..."
}
On error:
json
{
  "video_id": "xxx",
  "status": "error",
  "status_details": "Error message here"
}
视频完成时的回调内容:
json
{
  "video_id": "1e30440cf9",
  "status": "ready",
  "hosted_url": "https://videos.tavus.io/video/1e30440cf9",
  "download_url": "...",
  "stream_url": "..."
}
视频出错时的回调内容:
json
{
  "video_id": "xxx",
  "status": "error",
  "status_details": "Error message here"
}

Scripting Best Practices

脚本撰写最佳实践

  • Keep under 5 minutes for quality/engagement
  • Write conversationally (speak out loud to test)
  • Use punctuation to indicate pauses
  • Clear structure: intro → body → CTA
  • Break long content into multiple videos
  • 时长控制在5分钟以内,保证视频质量与用户参与度
  • 采用口语化表达(可以念出来测试流畅度)
  • 使用标点符号来标记停顿
  • 清晰的结构:开场介绍 → 主体内容 → 行动号召(CTA)
  • 将长内容拆分为多个视频

List & Delete Videos

视频列表与删除

bash
undefined
bash
undefined

List all videos

列出所有视频

curl https://tavusapi.com/v2/videos -H "x-api-key: YOUR_API_KEY"
curl https://tavusapi.com/v2/videos -H "x-api-key: YOUR_API_KEY"

Delete video

删除指定视频

curl -X DELETE https://tavusapi.com/v2/videos/{video_id}
-H "x-api-key: YOUR_API_KEY"
undefined
curl -X DELETE https://tavusapi.com/v2/videos/{video_id}
-H "x-api-key: YOUR_API_KEY"
undefined