Sora 2 Image to Video API
openai/sora-2/image-to-videoSora 2(Image to Video)将静态首帧参考图转化为带原生同步音效的 720p 动态视频,支持 4 至 20 秒固定时长与 16:9 或 9:16 画幅。它能够在严格继承原图主体容貌、服饰纹理与空间布光的同时,赋予画面逼真的物理运动与环境音场。
openai/sora-2/image-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/image-to-video 并传入 prompt 与 image_urls。
REQUEST_BODY=$(cat <<'JSON'
{
"model": "openai/sora-2/image-to-video",
"input": {
"prompt": "The elderly man by the cottage window smiles gently and blinks, warm afternoon light shifting softly across his face, subtle natural movement. Natural sound: a soft breath, distant birdsong through the window, a faint clock tick. Realistic motion, no text, no logos.",
"duration": 4,
"aspect_ratio": "16:9",
"image_urls": [
"https://cdn.vidgo.ai/apis/models/openai/sora-2/image-to-video/v1/01/input.png"
]
}
}
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-i2v-918230",
"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/image-to-video",
"input": {
"prompt": "The elderly man by the cottage window smiles gently and blinks, warm afternoon light shifting softly across his face, subtle natural movement. Natural sound: a soft breath, distant birdsong through the window, a faint clock tick. Realistic motion, no text, no logos.",
"duration": 4,
"aspect_ratio": "16:9",
"image_urls": [
"https://cdn.vidgo.ai/apis/models/openai/sora-2/image-to-video/v1/01/input.png"
]
}
}
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 个字符。 |
| image_urls | array | 必填 | — | 包含恰好 1 个图片 URL 的数组,支持 JPEG、PNG 或 WebP,≤10MB。 |
| 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 请检查密钥有效性。
- 图片校验确保 image_urls 数组包含恰好 1 个可公网访问的图片 URL,图片小于 10MB 且为支持格式。
- 轮询频次建议初始轮询间隔设为 2–3 秒,随着任务持续可逐步放缓,避免高频请求。
- Webhook 回调支持在提交请求顶层配置 callback_url,成片完成后系统将主动推送任务结果。
端点规格
| 规格项 | 取值 | 说明 |
|---|---|---|
| 输入方式 | 文本 + 单张图片 | 通过 prompt 描述动态,image_urls 提供 1 张必填首帧图片。 |
| 输出形式 | MP4 视频(含原生音频) | 异步任务执行完毕后返回成片视频链接。 |
| 可选时长 | 4 / 8 / 12 / 16 / 20 秒 | 默认预设为 4 秒。 |
| 画幅比例 | 16:9 / 9:16 | 默认预设为 16:9。 |
| 原生分辨率 | 720p | 横屏 1280x720,竖屏 720x1280。 |
| 图片格式与大小 | JPEG / PNG / WebP,≤ 10MB | 必须提供恰好 1 个有效的公网访问 URL。 |
| 计费基准 | 按时长阶梯计费 | 4s=48, 8s=96, 12s=144, 16s=192, 20s=240 积分。 |
关联模型端点
Sora 2 Image to Video API — 常见问题
Sora 2 Image to Video API 是什么?
Sora 2 Image to Video 是 OpenAI 研发用于图像生成视频的模型。它以单张静态参考图为动作起始点,结合文本提示词直接生成 720p 分辨率、包含动作与环境音效的原生同步视频。基于 OpenAI 的多模态扩散架构,它在严格保留原图主体特征、色彩光影与空间构图的同时,赋予画面逼真的物理动态。你可以通过 API 进行程序化调用,也可以在上方体验区直接在线试用。
Sora 2 图生视频如何保持原图主体特征一致?
模型深度提取首帧图像中的人脸轮廓、服装纹理与环境构图作为底层约束。建议上传清晰度高、主体明确的高质量素材,并在提示词中聚焦于动作轨迹与运镜指令,避免与原图既有特征相冲突的叙述。
Sora 2 图生视频支持上传几张参考图?
Sora 2 Standard 图生视频端点严格支持输入恰好 1 张首帧参考图片。模型将该图片作为视频的第一帧和主体外观基准向后动态展开,输入数组中包含超过 1 张图片将返回校验错误。
Sora 2 图生视频能为静止图片生成音效吗?
能。模型具有原生音画联合理解机制,能够基于首帧图片中的场景氛围(如森林、雨夜城市、咖啡馆)和提示词动作,自动合成高度匹配的原生环境音与动作音轨,无需后置音频制作。
Sora 2 图生视频单次最长支持多少秒?
单次调用支持生成最长 20 秒视频,提供 4、8、12、16 与 20 秒五档精确时长选择(体验区默认预设为 4 秒)。固定时长让开发者可以在提交前准确预估积分用量并合理安排动态节奏。
Sora 2 图生视频支持哪些图片格式?
支持 JPEG、PNG 和 WebP 等常见图片格式,单张文件大小上限为 10MB。图片需存放于可通过公网直接访问的 HTTP 或 HTTPS 链接上,以便服务端高效拉取解析。
需要自适应画幅与 1080p 时该选哪个端点?
推荐选择 Sora 2 Pro Image to Video 旗舰端点。Pro 旗舰版支持 auto 画幅比例(根据原图指导输出比例),并提供 720p、1024p 和 1080p 超清分辨率选择,适合专业商业交付。















