curl -X POST "https://t.ato2.nodesms.com/v1/video/generations" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora",
"prompt": "A cute cat playing in the garden",
"duration": 5,
"width": 1280,
"height": 720
}'
import requests
response = requests.post(
"https://t.ato2.nodesms.com/v1/video/generations",
headers={"Authorization": "Bearer sk-xxxxx"},
json={
"model": "sora",
"prompt": "A cute cat playing in the garden",
"duration": 5,
"width": 1280,
"height": 720,
},
)
print(response.json())
{
"task_id": "string",
"status": "string"
}
{
"error": {
"message": "string",
"type": "string",
"param": null,
"code": null
}
}
创建视频生成任务
提交视频生成任务,支持文生视频和图生视频。返回任务 ID,可通过 GET 接口查询任务状态。
POST
/
v1
/
video
/
generations
curl -X POST "https://t.ato2.nodesms.com/v1/video/generations" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora",
"prompt": "A cute cat playing in the garden",
"duration": 5,
"width": 1280,
"height": 720
}'
import requests
response = requests.post(
"https://t.ato2.nodesms.com/v1/video/generations",
headers={"Authorization": "Bearer sk-xxxxx"},
json={
"model": "sora",
"prompt": "A cute cat playing in the garden",
"duration": 5,
"width": 1280,
"height": 720,
},
)
print(response.json())
{
"task_id": "string",
"status": "string"
}
{
"error": {
"message": "string",
"type": "string",
"param": null,
"code": null
}
}
请求头
string
必填
使用 Bearer Token 认证。格式:
Authorization: Bearer sk-xxxxxx请求体
格式:application/json
string
模型/风格 ID
string
文本描述提示词
string
图片输入(URL 或 Base64)
number
视频时长(秒)
integer
视频宽度
integer
视频高度
integer
视频帧率
integer
随机种子
integer
生成视频数量
string
响应格式
string
用户标识
响应
200 成功创建视频生成任务
格式:application/json
string
任务 ID
string
任务状态
400 请求参数错误
格式:application/json
curl -X POST "https://t.ato2.nodesms.com/v1/video/generations" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora",
"prompt": "A cute cat playing in the garden",
"duration": 5,
"width": 1280,
"height": 720
}'
import requests
response = requests.post(
"https://t.ato2.nodesms.com/v1/video/generations",
headers={"Authorization": "Bearer sk-xxxxx"},
json={
"model": "sora",
"prompt": "A cute cat playing in the garden",
"duration": 5,
"width": 1280,
"height": 720,
},
)
print(response.json())
{
"task_id": "string",
"status": "string"
}
{
"error": {
"message": "string",
"type": "string",
"param": null,
"code": null
}
}
最后修改于 2026年10月28日
此页面对您有帮助吗?