跳转到主要内容
POST
https://octopusx.ai
/
v1
/
videos
curl -X POST https://octopusx.ai/v1/videos \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "omni-fast-v2v",
    "prompt": "Edit the attached video into a visibly new version while preserving the original camera path, timing, subject motion, and shot continuity. Add a rainy cinematic night look with neon reflections. Output a newly generated video, not the uploaded source clip or its preview.",
    "video": "https://example.com/source.mp4",
    "seconds": "8",
    "aspect_ratio": "16:9",
    "resolution": "720p"
  }'
{
  "id": "video_abc123",
  "task_id": "video_abc123",
  "object": "video",
  "model": "omni-fast-v2v",
  "status": "queued",
  "progress": 0,
  "created_at": 1735689600,
  "video_url": ""
}

omni-fast-v2v

omni-fast-v2v 使用 JSON 请求体提交异步视频任务,适合把已有 MP4 作为参考视频进行编辑、延长或重生成。
  • 异步处理模式,提交后返回 idtask_id
  • 参考视频字段支持 videovideo_urlinput_video
  • 参考视频支持公网 MP4 URL 或 data:video/mp4;base64,...
  • 参考视频最大 15MB。
  • 不需要参考视频时,优先使用 omni-fast

方法与路径

POST /v1/videos

请求示例

curl -X POST https://octopusx.ai/v1/videos \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "omni-fast-v2v",
    "prompt": "Edit the attached video into a visibly new version while preserving the original camera path, timing, subject motion, and shot continuity. Add a rainy cinematic night look with neon reflections. Output a newly generated video, not the uploaded source clip or its preview.",
    "video": "https://example.com/source.mp4",
    "seconds": "8",
    "aspect_ratio": "16:9",
    "resolution": "720p"
  }'

响应示例

{
  "id": "video_abc123",
  "task_id": "video_abc123",
  "object": "video",
  "model": "omni-fast-v2v",
  "status": "queued",
  "progress": 0,
  "created_at": 1735689600,
  "video_url": ""
}

认证

使用 Bearer Token 鉴权:
Authorization: Bearer YOUR_API_KEY
所有请求示例都需要携带 Authorization Header。JSON 请求还需要携带:
Content-Type: application/json

Body

model
string
必填
固定传 omni-fast-v2v。示例:"omni-fast-v2v"
prompt
string
必填
视频编辑或生成提示词。建议说明保留哪些运动、镜头或主体,并明确要求输出新视频。示例:"Edit the attached video into a visibly new version"
video
string
参考视频。支持公网 MP4 URL 或 data:video/mp4;base64,...。与 video_urlinput_video 任选其一。示例:"https://example.com/source.mp4"
video_url
string
video 的兼容字段。未传 video 时可使用。示例:"https://example.com/source.mp4"
input_video
string
video 的兼容字段。未传 videovideo_url 时可使用。示例:"https://example.com/source.mp4"
seconds
string
输出时长。建议传字符串;推荐范围为 430 秒。示例:"8"
aspect_ratio
string
画面比例。示例值:"16:9""9:16"
resolution
string
分辨率字段。示例值:"720p""1080p""2k""4k"
first_image_url
string
兼容 omni-fast 的首帧图字段。没有参考视频时,建议直接使用 omni-fast。示例:"https://example.com/first-frame.jpg"
images
array<string>
兼容 omni-fast 的多参考图字段,最多 5 张。没有参考视频时,建议直接使用 omni-fast

Response

id
string
视频任务 ID。后续可用于 GET /v1/videos/{task_id} 查询。
task_id
string
视频任务 ID 的兼容字段。通常与 id 相同。
object
string
对象类型,通常为 video
model
string
本次任务使用的模型,例如 omni-fast-v2v
status
string
任务状态。常见值为 queuedin_progresscompletedfailed
progress
number
任务进度,常见范围为 0100
video_url
string
完成后的视频地址。
error
object
任务失败或接口错误时返回的错误对象,通常包含 messagecode

使用场景

公网 MP4 参考视频

{
  "model": "omni-fast-v2v",
  "prompt": "Extend this clip into a new cinematic shot with the same camera path.",
  "video": "https://example.com/source.mp4",
  "seconds": "8",
  "aspect_ratio": "16:9",
  "resolution": "720p"
}

本地 MP4 转 data URI

import base64
from pathlib import Path

source = Path("source.mp4")
if source.stat().st_size > 15 * 1024 * 1024:
    raise ValueError("参考视频最大 15MB")

video = "data:video/mp4;base64," + base64.b64encode(source.read_bytes()).decode("ascii")

使用 input_video 别名

{
  "model": "omni-fast-v2v",
  "prompt": "Regenerate the attached clip with brighter lighting and smoother motion.",
  "input_video": "https://example.com/source.mp4",
  "seconds": "8",
  "aspect_ratio": "16:9",
  "resolution": "720p"
}

注意事项

  • omni-fast 不支持参考视频;V2V 必须使用 omni-fast-v2v
  • 参考视频最大 15MB,过大时建议先压缩或转为公网 URL。
  • videovideo_urlinput_video 是同一类参考视频输入,推荐优先使用 video
  • 对于 data:video/mp4;base64,...,实际请求体会变大,请预留网络超时时间。
  • 完成后从返回的 video_url 获取生成的 MP4。

相关接口