sora-2。
核心能力
- 文生视频 - 根据文本提示词生成视频
- 图生视频 - 使用图片作为首帧或参考
- 异步流程 - 提交任务后轮询获取结果
- 视频重混 - 根据源视频 URL 创建变体
输出规格
| 属性 | 取值 |
|---|---|
| 分辨率 | 480p, 720p, 1080p |
| 宽高比 | 16:9, 9:16, 1:1 |
| 时长 | 5, 10, 15, 20 s |
| 同步音频 | 支持 |
| 调用方式 | 异步任务 |
调用流程
1. POST /v1/video/generations -> task_id
2. GET /v1/video/generations/{task_id} -> status
3. When the task succeeds -> read the video URL
调用示例
文生视频
- cURL
- Python
curl "https://api.mixroute.ai/v1/video/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "A red square gently pulses on a clean white background",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}'
import requests
response = requests.post(
"https://api.mixroute.ai/v1/video/generations",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={'model': 'sora-2',
'prompt': 'A red square gently pulses on a clean white background',
'duration': 5,
'resolution': '720p',
'aspect_ratio': '16:9'},
)
print(response.json())
图生视频
curl "https://api.mixroute.ai/v1/video/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "Animate the reference image with a slow camera push-in",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"image_url": "https://example.com/reference.png"
}'
视频重混
curl "https://api.mixroute.ai/v1/video/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
"prompt": "Keep the composition while changing the lighting to a warm sunset",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"remix_url": "https://example.com/source.mp4"
}'
参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 固定为 sora-2。 |
prompt | string | 是 | 视频生成或重混指令。 |
duration | integer | 否 | 视频时长:5、10、15 或 20 秒。 |
resolution | string | 否 | 480p、720p 或 1080p。 |
aspect_ratio | string | 否 | 16:9、9:16 或 1:1。 |
image_url | string | 否 | 图生视频使用的参考图片 URL。 |
remix_url | string | 否 | 重混模式使用的源视频 URL。 |
输入模式
| 模式 | 输入 |
|---|---|
| 文生视频 | prompt |
| 图生视频 | prompt + image_url |
| 视频重混 | prompt + remix_url |