跳转到主要内容
POST
https://api.apimart.ai
/
v1
/
videos
/
generations
curl --request POST \
  --url https://api.apimart.ai/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "sora-2-preview",
    "prompt": "A majestic waterfall cascading down rocky cliffs, creating a beautiful rainbow in the mist",
    "duration": 8,
    "aspect_ratio": "landscape",
    "image_urls": ["https://example.com/reference-image.jpg"]
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01KG1Q38PBV1RJ2C033ZS9RYF7"
    }
  ]
}
curl --request POST \
  --url https://api.apimart.ai/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "sora-2-preview",
    "prompt": "A majestic waterfall cascading down rocky cliffs, creating a beautiful rainbow in the mist",
    "duration": 8,
    "aspect_ratio": "landscape",
    "image_urls": ["https://example.com/reference-image.jpg"]
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01KG1Q38PBV1RJ2C033ZS9RYF7"
    }
  ]
}

Authorizations

Authorization
string
必填
所有接口均需要使用Bearer Token进行认证获取 API Key:访问 API Key 管理页面 获取您的 API Key使用时在请求头中添加:
Authorization: Bearer YOUR_API_KEY

Body

model
string
默认值:"sora-2-preview"
必填
视频生成模型名称支持的模型:
  • sora-2-preview - 标准版
  • sora-2-pro-preview - Pro 版(支持更高分辨率)
示例:"sora-2-preview""sora-2-pro-preview"
prompt
string
必填
视频生成的文本描述详细描述您想要生成的视频内容,包括场景、动作、氛围等。示例:"A majestic waterfall cascading down rocky cliffs, creating a beautiful rainbow in the mist"
duration
integer
默认值:"4"
视频时长(秒)只支持以下时长值
  • 4 - 4秒视频
  • 8 - 8秒视频
  • 12 - 12秒视频
其他时长值会返回错误。示例:8
aspect_ratio
string
默认值:"landscape"
视频宽高比支持的格式:
  • landscape16:9 - 横屏 (16:9)
  • portrait9:16 - 竖屏 (9:16)
不支持 square (1:1) 方形视频。示例:"landscape"
resolution
string
默认值:"standard"
视频分辨率(仅 sora-2-pro-preview 支持)支持的值:
  • standard - 标准分辨率(竖屏 720x1280,横屏 1280x720)
  • high - 高分辨率(竖屏 1024x1792,横屏 1792x1024)
示例:"high"
image_urls
array<url>
用于图生视频的参考图像 URL 数组重要限制:只取第一张图片作为参考图当使用参考图片时,API 会自动检测图片的宽高比,并强制覆盖用户提供的 aspect_ratio 参数。解决方案
  • 如需精确控制输出视频的宽高比,请勿使用参考图片(纯文生视频)
  • 如必须使用参考图片,请确保参考图片本身是目标宽高比
示例:["https://example.com/reference-image.jpg"]限制:
  • 最大文件大小:10MB
  • 支持格式:.jpeg、.jpg、.png、.webp

Response

code
integer
响应状态码,成功时为 200
data
array
返回数据数组

计费说明

  • 计费方式:按视频时长(秒)计费
  • 具体价格:请参考 定价页面