Skip to content

Omni 视频生成 ​

调用 生成文生视频、图生视频、首尾帧和多参考图视频。

http
POST /v1/videos

当前可用模型 ​

请求头 ​

名称类型必填说明
string是请求身份认证。使用 Bearer Token,示例值:。
string是请求内容类型,必须设置为 。

请求体 ​

名称类型必填说明
string是模型名称,可选值见上方「当前可用模型」。
string是视频提示词。示例:。
string否视频时长。建议传字符串;推荐范围为 到 秒。示例:。
string否画面比例。示例值:、。
string否分辨率字段。示例值:、、、。
string否首帧图。传入后进入首帧图生视频模式。支持公网 URL 或 。示例:。
string否尾帧图。需要配合 使用。示例:。
array<string>否多参考图列表,最多 5 张。支持公网 URL 或 。示例:。

请求示例 ​

bash
curl -X POST https://octopusx.ai/v1/videos \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '
{
  "model": "omni-fast",
  "prompt": "Ocean waves gently rolling onto a sandy beach at golden hour, cinematic, warm sunlight",
  "seconds": "8",
  "aspect_ratio": "16:9",
  "resolution": "720p"
}'
bash
curl -X POST https://octopusx.ai/v1/videos \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '
{
  "model": "omni-fast",
  "prompt": "The scene comes alive with gentle wind and drifting clouds",
  "first_image_url": "https://example.com/first-frame.jpg",
  "seconds": "8",
  "aspect_ratio": "16:9",
  "resolution": "720p"
}'
bash
curl -X POST https://octopusx.ai/v1/videos \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '
{
  "model": "omni-fast",
  "prompt": "Create a smooth transition from the first frame to the last frame.",
  "first_image_url": "https://example.com/first-frame.jpg",
  "last_image_url": "https://example.com/last-frame.jpg",
  "seconds": "8",
  "aspect_ratio": "16:9",
  "resolution": "720p"
}'
bash
curl -X POST https://octopusx.ai/v1/videos \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '
{
  "model": "omni-fast",
  "prompt": "Use the first image as the character reference and the second image as the visual style reference. Create a cozy cafe conversation scene.",
  "images": [
    "https://example.com/character.jpg",
    "https://example.com/style.jpg"
  ],
  "seconds": "8",
  "aspect_ratio": "16:9",
  "resolution": "720p"
}'

响应示例 ​

json
{
  "id": "video_abc123",
  "task_id": "video_abc123",
  "object": "video",
  "model": "omni-fast",
  "status": "queued",
  "progress": 0,
  "created_at": 1735689600,
  "video_url": ""
}
json
{
  "id": "video_abc123",
  "task_id": "video_abc123",
  "object": "video",
  "model": "omni-fast",
  "status": "completed",
  "progress": 100,
  "created_at": 1735689600,
  "completed_at": 1735689900,
  "video_url": "https://example.com/results/omni-fast.mp4"
}
json
{
  "id": "video_abc123",
  "task_id": "video_abc123",
  "object": "video",
  "model": "omni-fast",
  "status": "failed",
  "progress": 100,
  "error": {
    "message": "upstream task failed",
    "code": "task_failed"
  }
}
json
{
  "error": {
    "message": "field model is required",
    "type": "invalid_request_error",
    "param": "model",
    "code": "invalid_request_error"
  }
}
json
{
  "error": {
    "message": "invalid token",
    "type": "invalid_request_error",
    "code": "invalid_api_key"
  }
}
json
{
  "error": {
    "message": "insufficient quota",
    "type": "insufficient_quota",
    "code": "insufficient_quota"
  }
}
json
{
  "error": {
    "message": "rate limit exceeded",
    "type": "rate_limit_error",
    "code": "rate_limit_exceeded"
  }
}
json
{
  "error": {
    "message": "internal server error",
    "type": "server_error",
    "code": "server_error"
  }
}

响应字段 ​

名称类型说明
string视频任务 ID。后续可用于查询任务。
string视频任务 ID 的兼容字段。通常与 相同。
string对象类型,通常为 。
string本次任务使用的模型,例如 。
string任务状态。常见值为 、、、。
number任务进度,常见范围为 到 。
string完成后的视频地址。
object任务失败或接口错误时返回的错误对象,通常包含 和 。

相关接口 ​