tavus-video-gen
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTavus 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
参数说明
| Param | Description |
|---|---|
| Required. Stock or custom replica ID |
| Text for replica to speak (use this OR audio_url) |
| Pre-recorded audio (.wav/.mp3) for replica to lip-sync |
| Display name |
| Webhook for completion/error |
| Website URL to record as background |
| Video file URL for background |
| PNG/JPEG logo overlay |
| Quick render (disables some features) |
| WebM with alpha (requires |
| Param | Description |
|---|---|
| 必填项。官方预设或自定义的Replica ID |
| 让Replica朗读的脚本文本(使用该参数或 |
| 预录制的音频文件(.wav/.mp3格式),用于Replica唇形同步 |
| 视频显示名称 |
| 视频完成/出错时触发的Webhook地址 |
| 作为视频背景的网站URL(将录制该页面内容) |
| 作为视频背景的视频文件URL |
| 作为水印的PNG/JPEG格式Logo地址 |
| 快速渲染模式(会禁用部分功能) |
| 生成带透明通道的视频(需开启 |
Using Audio Instead of Script
使用音频替代脚本
json
{
"replica_id": "rfe12d8b9597",
"audio_url": "https://s3.../narration.mp3"
}Supported formats: ,
.wav.mp3json
{
"replica_id": "rfe12d8b9597",
"audio_url": "https://s3.../narration.mp3"
}支持的格式:、
.wav.mp3Background 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 with alpha channel.
.webm适用于视频编辑软件后期合成:
json
{
"fast": true,
"transparent_background": true
}输出带Alpha通道的格式视频。
.webmCheck Video Status
查看视频状态
bash
curl https://tavusapi.com/v2/videos/{video_id} \
-H "x-api-key: YOUR_API_KEY"Status values: , , , ,
queuedgeneratingreadyerrordeletedWhen 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"状态值说明:(排队中)、(生成中)、(已就绪)、(出错)、(已删除)
queuedgeneratingreadyerrordeleted视频就绪时的响应:
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
undefinedbash
undefinedList 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"
-H "x-api-key: YOUR_API_KEY"
undefinedcurl -X DELETE https://tavusapi.com/v2/videos/{video_id}
-H "x-api-key: YOUR_API_KEY"
-H "x-api-key: YOUR_API_KEY"
undefined