Sora 2 Text to Video API
openai/sora-2/text-to-videoSora 2(Text to Video)将文本提示词转化为带原生立体声音效的 720p 高清视频,支持 4 至 20 秒固定时长与 16:9 或 9:16 画幅。它能够在严格遵循提示词物理规律与运镜轨迹的同时,呈现连贯的动作交互与拟真环境音场。
openai/sora-2/text-to-video
请选择其他模型继续创作

Seedance 2.5
ByteDance Seed's Seedance 2.5 video model with separate text-to-video, start/end-frame image-to-video, and multimodal reference-to-video API workflows at 480p, 720p, or 1080p for 4 to 30 seconds.
起价
$0.140
每输出秒

MiniMax H3
MiniMax H3 on Vidgo API with separate text-to-video, start/end-frame image-to-video, and multimodal reference-to-video workflows at fixed 2K output.
起价
$0.105
每秒

Seedance 2.0
ByteDance Seedance 2.0 Standard and Fast video generation with text, ordered start/end frames, or multimodal image, video, and audio references.
起价
$0.100
每输出秒

Hailuo 2.3
MiniMax's Hailuo 2.3 video model for realistic human motion, expressive characters, and text-to-video or first-frame guided generation at 768p and 1080p.
起价
$0.175
每个视频

Kling 3.0
Kuaishou's most advanced video model with native 4K/60fps output, multi-shot storyboarding, multilingual audio, and character consistency for up to 3 people.
起价
$0.135
每秒
已下线:此模型不再接受生成请求,以下 API 资料仅供历史参考。
REST API
快速开始
配置 API Key,提交生成指令,轮询获取 720p 视频与原生音频成片。
第一步:配置 API 鉴权
在请求头中携带 Authorization: Bearer <VIDGO_API_KEY> 完成身份验证。
- 任务提交端点
- POST
https://api.vidgo.ai/api/generate/submit - 鉴权请求头
- Authorization: Bearer VIDGO_API_KEY
第二步:提交文生视频任务
向 /api/generate/submit 发起 POST 请求,指定 model 为 openai/sora-2/text-to-video 并传入 input 参数。
REQUEST_BODY=$(cat <<'JSON'
{
"model": "openai/sora-2/text-to-video",
"input": {
"prompt": "An astronaut riding a horse across the surface of Mars, red dust blowing in the wind, dramatic sunset on the horizon, cinematic wide shot, slow motion, detailed space suit reflections, epic atmosphere, volumetric lighting, smooth camera tracking. Audio: wind howling, horse hooves on gravel, radio static breathing.",
"duration": 4,
"aspect_ratio": "16:9"
}
}
JSON
)
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")
CODE=$(printf '%s' "$RESPONSE" | jq -r '.code // empty')
if [ "$CODE" != "0" ] && [ "$CODE" != "200" ]; then
printf 'API error: %s
' "$RESPONSE" >&2
exit 1
fi
printf '%s
' "$RESPONSE"第三步:轮询获取生成结果
使用 task_id 查询进度;not_started 或 running 时继续轮询,finished 或 failed 时停止。成功后读取 data.files[].file_url,失败时读取 data.error_message。
状态查询端点
GET https://api.vidgo.ai/api/generate/status/{task_id}使用 task_id 查询进度;not_started 或 running 时继续轮询,finished 或 failed 时停止。成功后读取 data.files[].file_url,失败时读取 data.error_message。
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "task-sora2-t2v-849120",
"status": "running",
"created_time": "2026-09-17T10:00:00Z"
}
}{
"code": 200,
"data": {
"task_id": "task-unified-...",
"status": "finished",
"files": [
{
"file_url": "https://storage.vidgo.ai/generated/video.mp4",
"file_type": "video"
}
],
"created_time": "2026-08-22T10:00:00Z",
"progress": 100,
"error_message": null
}
}完整代码示例
展开查看包含鉴权、提交、轮询与终态判断的自动化脚本代码。
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "openai/sora-2/text-to-video",
"input": {
"prompt": "An astronaut riding a horse across the surface of Mars, red dust blowing in the wind, dramatic sunset on the horizon, cinematic wide shot, slow motion, detailed space suit reflections, epic atmosphere, volumetric lighting, smooth camera tracking. Audio: wind howling, horse hooves on gravel, radio static breathing.",
"duration": 4,
"aspect_ratio": "16:9"
}
}
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')
BUSINESS_CODE=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Submit failed:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
START_TIME=$(date +%s)
POLL_DELAY=2
while true; do
if [ $(( $(date +%s) - START_TIME )) -ge 600 ]; then
printf 'Timed out after 600 seconds
' >&2
exit 1
fi
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')
BUSINESS_CODE=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.code // empty')
if [ "$BUSINESS_CODE" != "0" ] && [ "$BUSINESS_CODE" != "200" ]; then
printf 'Status request failed:
%s
' "$STATUS_RESPONSE" >&2
exit 1
fi
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 "$POLL_DELAY"
if [ "$POLL_DELAY" -lt 10 ]; then POLL_DELAY=$((POLL_DELAY + 1)); fi
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
done请求参数
向 /api/generate/submit 提交时需传递的 input 参数配置:
| 字段 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| prompt | string | 必填 | — | 生成提示词,去除首尾空格后至少包含 1 个字符。 |
| duration | integer | 可选 | 4 | 视频时长(秒),支持 4, 8, 12, 16, 20。 |
| aspect_ratio | string | 可选 | 16:9 | 画幅比例,支持 16:9 或 9:16。 |
响应字段
提交任务成功后返回的数据结构,以及状态查询接口响应:
| 字段 | 类型 | 描述 |
|---|---|---|
| code | integer | 业务状态码,200 表示成功。 |
| message | string | 业务返回消息或异常描述。 |
| data.task_id | string | 全局唯一的异步任务标识流水号。 |
| data.status | string | 当前状态:not_started(排队中)、running(生成中)、finished(已完成)、failed(失败)。 |
| data.created_time | string | 任务创建时间(ISO 8601 格式)。 |
| data.files[] | array | 任务成功生成的文件列表。 |
| data.files[].file_url | string | 成片 MP4 文件的持久化下载与播放链接。 |
| data.error_message | string | null | 任务失败时的详细错误说明。 |
任务状态流转
轮询过程中,依据 data.status 判断任务执行阶段:
not_started任务已被系统受理入队,正等待计算节点分配。
running正在执行扩散模型视频降噪与音轨渲染,持续轮询此状态。
finished生成成功,从 data.files[0].file_url 读取成片链接,终止轮询。
failed任务执行异常终止,读取 data.error_message 查看原因并终止轮询。
轮询与重试建议
- 身份认证请求头必须携带 Bearer API Key,若收到 401 请检查密钥有效性。
- 参数校验收到 400 时核对 prompt 长度、duration 取值与 aspect_ratio 枚举范围。
- 轮询频次建议初始轮询间隔设为 2–3 秒,随着任务持续可逐步放缓,避免高频请求。
- Webhook 回调支持在提交请求顶层配置 callback_url,成片完成后系统将主动推送任务结果。
端点规格
| 规格项 | 取值 | 说明 |
|---|---|---|
| 输入方式 | 纯文本 | 通过 prompt 描述场景、主体、运镜与声音。 |
| 输出形式 | MP4 视频(含原生音频) | 异步生成成片,任务完成后提供下载播放链接。 |
| 可选时长 | 4 / 8 / 12 / 16 / 20 秒 | 默认预设为 4 秒。 |
| 画幅比例 | 16:9 / 9:16 | 默认预设为 16:9。 |
| 原生分辨率 | 720p | 横屏 1280x720,竖屏 720x1280。 |
| 计费基准 | 按时长阶梯计费 | 4s=48, 8s=96, 12s=144, 16s=192, 20s=240 积分。 |
关联模型端点
Sora 2 Text to Video API — 常见问题
Sora 2 Text to Video API 是什么?
Sora 2 Text to Video 是 OpenAI 研发用于文本生成视频的模型。它根据文本提示词直接生成 720p 分辨率、包含动作与环境音效的原生同步视频,支持专业镜头运动与多画幅构图。基于 OpenAI 的多模态扩散架构,它在严格遵循真实物理规律与时空连贯性的同时,呈现生动的视觉细节与拟真音场。你可以通过 API 进行程序化调用,也可以在上方体验区直接在线试用。
Sora 2 文生视频能生成原生音轨吗?
能。模型在渲染画面的同时原生合成同步音轨,无需后置音频生成工具。在提示词中描写对白氛围、环境风雨声、脚步声或机械运转声,模型即可直接在成片 MP4 中内嵌贴合动作节拍的立体声音效。
Sora 2 文生视频单次最长支持多少秒?
单次调用最长支持生成 20 秒视频,提供 4、8、12、16 与 20 秒五档精确时长选择(体验区默认预设为 4 秒)。固定时长档位能够帮助开发者和制片团队在提交前精准计算任务预算并规划镜头衔接。
Sora 2 文生视频的分辨率是多少?
Sora 2 Standard 标准版固定输出 720p 分辨率。选择 16:9 画幅时为 1280x720,选择 9:16 画幅时为 720x1280,充分满足日常创意原型、社交媒体分发与多平台视频制作需求。
如何通过提示词控制 Sora 2 文生视频的运镜?
建议在提示词中独立使用明确的摄影机运动术语,例如“缓慢推进(slow push-in)”、“低机位平移跟踪(low-angle tracking shot)”或“环绕运镜(orbital camera movement)”,配合光影与速度描述,模型会精准遵循指令调度视角。
Sora 2 文生视频适合制作 9:16 竖屏内容吗?
适合。在参数中指定 aspect_ratio 为 9:16,模型会自动以 720x1280 竖屏构图生成画面。在提示词中重点规划纵向构图层次与主体走位,非常契合移动端短视频与故事类内容呈现。
需要 1080p 画质时该选择哪个 Sora 2 端点?
若项目需要 1080p 全高清输出,推荐选择 Sora 2 Pro Text to Video 旗舰端点。Pro 旗舰版提供 720p、1024p 和 1080p 选项,具备更细腻的画面质感、更丰富的光影层次与影视级动态表现。















