章鱼哥AI接口文档

Muse

生成文字、参考图或首尾帧驱动的视频。

本系列支持的端点
  • muse创建POST https://zexapi.com/v1/videos
POSThttps://zexapi.com/v1/videos
鉴权 Authorization: Bearer YOUR_API_KEY

使用 API Key 进行 Bearer 鉴权。JSON 请求设置 Content-Type: application/json;Multipart 请求由客户端自动生成 boundary。

首尾帧选 muse-video-fl,不传 first_last_frame,也不使用 size。
  • 素材 URL 必须是无需登录、直接返回文件内容的地址。

Muse 视频生成接口文档

接口地址

POST /v1/videos

功能说明

支持 Muse 文生视频、图片参考生成,以及首帧、首尾帧生成。
文生视频、参考图片:使用 muse-video。参考图片的参数写法与 Seedance 相同。
首帧 / 首尾帧:使用 muse-video-fl。图片顺序写法与 Omni 首尾帧相同:第 1 张是首帧,第 2 张是尾帧。

当前模型

模型名支持模式时长seconds 取值
muse-video文生视频、图片参考10、20、30 秒"10"、"20"、"30"
muse-video-fl首帧、首尾帧10、20、30 秒"10"、"20"、"30"
两个模型的时长都由 seconds 指定,目前只支持 10、20、30 秒。宽高比只支持 16:9、9:16、1:1。

模式判定

模式模型传参方式
文生视频muse-video不传 images,或传空数组
参考图片muse-videoJSON 用 images;表单用可重复的 input_reference
首帧muse-video-fl只传 1 张图片
首尾帧muse-video-fl依次传首帧、尾帧,共 2 张图片
首尾帧由模型名决定,不要传 first_last_frame。muse-video-fl 只接受 1~2 张图片。

支持的参考内容

图片:JSON 通过 images 传递,表单通过可重复的 input_reference 传递。
muse-video 最多传 4 张参考图片。
多张图片按传入顺序编号为图片 1、图片 2。用途写在 prompt 里,例如“图片 1 是产品外观”“图片 2 是人物”。

请求方式

方式Content-Type参考素材字段
JSONapplication/jsonimages
表单multipart/form-data只使用可重复的 input_reference
JSON 中不要写 input_reference。表单中不要写 images。

请求头

参数名类型必填说明
Authorizationstring是Bearer YOUR_API_KEY
Content-Typestring是application/json 或 multipart/form-data

JSON 请求体说明

参数名类型必填说明
modelstring是muse-video 或 muse-video-fl
promptstring是视频生成提示词。参考图片时应说明每张图的用途
imagesstring[]否图片 URL 或完整 Base64 data URI。muse-video 最多 4 张;muse-video-fl 传 1~2 张,顺序为首帧、尾帧
aspect_ratiostring否16:9、9:16、1:1。不传时使用服务端默认值
resolutionstring否720p、1080p。不传时默认 720p
secondsstring是只支持 "10"、"20"、"30"
数组元素必须是文件直链或受支持的 data URI,不要写成 Markdown 链接:
错误:[https://example.com/ref.png](https://example.com/ref.png)
正确:https://example.com/ref.png

素材数量约定

首帧:images 传 1 张图片,模型为 muse-video-fl。
首尾帧:images 依次传首帧、尾帧,模型为 muse-video-fl。
参考图片:最多 4 张,模型为 muse-video。

表单字段说明

参数名类型必填说明
modelstring是muse-video 或 muse-video-fl
promptstring是视频生成提示词
input_reference可重复字段否图片的本地文件、URL 或受支持的 Base64;每张图重复传一次。muse-video 最多 4 张;muse-video-fl 只传 1~2 张
aspect_ratiostring否16:9、9:16、1:1
resolutionstring否720p 或 1080p,不传时默认 720p
secondsstring是"10"、"20" 或 "30"
顺序约定:
首尾帧:第 1 个 input_reference 为首帧,第 2 个为尾帧;只传 1 个时表示仅指定首帧。模型使用 muse-video-fl。
参考图片:按传入顺序作为参考图。模型使用 muse-video。

请求示例

文生视频(JSON)

curl -X POST "https://xxxxx.com/v1/videos" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "muse-video",
    "prompt": "清晨的森林中,一只白鹿从薄雾里缓慢走出,电影感运镜",
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "seconds": "10"
  }'

首帧(JSON)

curl -X POST "https://xxxxx.com/v1/videos" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "muse-video-fl",
    "prompt": "从这张图开始,镜头向前推进,人物自然转头看向镜头",
    "images": [
      "https://example.com/first.png"
    ],
    "aspect_ratio": "9:16",
    "resolution": "1080p",
    "seconds": "10"
  }'

首尾帧(JSON)

curl -X POST "https://xxxxx.com/v1/videos" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "muse-video-fl",
    "prompt": "从首帧自然过渡到尾帧,保持人物和产品外观一致",
    "images": [
      "https://example.com/first.png",
      "https://example.com/last.png"
    ],
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "seconds": "20"
  }'

首尾帧 · 本地文件(表单)

curl -X POST "https://xxxxx.com/v1/videos" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "model=muse-video-fl" \
  -F "prompt=从首帧自然过渡到尾帧,保持人物和产品外观一致" \
  -F "input_reference=@/path/to/first_frame.jpg" \
  -F "input_reference=@/path/to/last_frame.jpg" \
  -F "aspect_ratio=1:1" \
  -F "resolution=720p" \
  -F "seconds=30"

参考图(JSON)

curl -X POST "https://xxxxx.com/v1/videos" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "muse-video",
    "prompt": "图片 1 是产品,图片 2 是人物,图片 3 是场景;生成一支统一风格的广告",
    "images": [
      "https://example.com/product.png",
      "https://example.com/person.png",
      "https://example.com/scene.png"
    ],
    "aspect_ratio": "16:9",
    "resolution": "1080p",
    "seconds": "20"
  }'

本地参考图(表单)

curl -X POST "https://xxxxx.com/v1/videos" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "model=muse-video" \
  -F "prompt=图片 1 作为产品参考,图片 2 作为人物参考" \
  -F "input_reference=@/path/to/product.png" \
  -F "input_reference=@/path/to/person.png" \
  -F "aspect_ratio=16:9" \
  -F "resolution=720p" \
  -F "seconds=10"

响应参数

任务处理中

{
  "id": "task_xxxxxxxxxxxxx",
  "object": "video",
  "model": "muse-video",
  "status": "in_progress",
  "progress": 10,
  "created_at": 1791320000
}
完成态视频地址位于顶层 url 和 video_url,两者值相同。
参数名类型说明
idstring任务 ID
objectstring固定值 video
modelstring实际使用的模型名称
statusstringqueued、in_progress、completed、failed
progressnumber任务进度,0~100
created_atnumber创建时间戳(秒)
completed_atnumber完成时间戳(秒,仅完成态)
urlstring视频直链(仅完成态)
video_urlstring与 url 同值(仅完成态)
errorobject失败信息,通常包含 code、message

提交成功

{
  "id": "task_xxxxxxxxxxxxx",
  "object": "video",
  "model": "muse-video",
  "status": "queued",
  "progress": 0,
  "created_at": 1791320000
}

任务完成

{
  "id": "task_xxxxxxxxxxxxx",
  "object": "video",
  "model": "muse-video",
  "status": "completed",
  "progress": 100,
  "created_at": 1791320000,
  "completed_at": 1791320060,
  "url": "https://example.com/output.mp4",
  "video_url": "https://example.com/output.mp4"
}

任务失败

{
  "id": "task_xxxxxxxxxxxxx",
  "object": "video",
  "model": "muse-video-fl",
  "status": "failed",
  "progress": 0,
  "created_at": 1791320000,
  "error": {
    "code": "invalid_request",
    "message": "请求参数不符合模型能力限制"
  }
}

查询任务状态

GET /v1/videos/{task_id}
curl -X GET "https://xxxxx.com/v1/videos/task_xxxxxxxxxxxxx" \
  -H "Authorization: Bearer YOUR_API_KEY"
queued / in_progress 时继续轮询;completed 时读取顶层 url 或 video_url;failed 时读取 error.message。

注意事项

1.
seconds 必须使用字符串,目前只支持 "10"、"20"、"30"。两个模型都用这个字段指定时长,时长不写进模型名。
2.
aspect_ratio 只支持 16:9、9:16、1:1。分辨率用 resolution,取值为 720p 或 1080p。不要改用 size,也不要传 first_last_frame。
3.
首帧和首尾帧必须使用 muse-video-fl。JSON 用 images,表单用重复的 input_reference。第 1 张是首帧,第 2 张是尾帧;只有 1 张时表示仅指定首帧。
4.
文生视频和参考图片使用 muse-video。JSON 中图片用 images;表单只有可重复的 input_reference。
5.
muse-video 最多传 4 张参考图片。muse-video-fl 只接受 1~2 张图片。
6.
JSON 数组中只能填写文件直链或受支持的 data URI,不能填写 Markdown 链接表达式。
7.
所有 URL 都必须是无需登录、可直接返回文件内容的公网直链。
8.
接口为异步接口,提交成功后需轮询 GET /v1/videos/{task_id}。

接口地址

POST /v1/videos

视频调试参数说明

先选择生成方式,再选择型号。参考图片与首尾帧为独立用法,切换用法后显示对应素材输入。JSON 使用 images 数组;表单使用重复的 input_reference 文件字段。

请求示例:文生视频(表单上传)

curl --request POST 'https://zexapi.com/v1/videos' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --form-string 'model=muse-video' \
  --form-string 'prompt=生成自然连贯的视频' \
  --form-string 'resolution=720p' \
  --form-string 'seconds=10'