Claude Opus 5.5 已在 SeedRouter 上线

Model APIs

MAGI-2

View Markdown

SeedRouter 上 MAGI-2 文生视频、首尾帧图生视频及多模态参考生视频的异步 API 参考文档。

MAGI-2 是 Sand.ai 推出的 480B 原生音视频大模型。在 SeedRouter 上,它通过统一异步视频生成端点(POST /v1/videos/generations)开放三个公开模型 ID,并通过 GET /v1/tasks/{id} 轮询任务状态。

模型 ID模式必填输入
magi-2-text-to-video文生视频prompt(非空字符串,最多 15,000 个字符)
magi-2-image-to-video首帧 / 首尾帧图生视频image_urls(1–2 个公开 HTTP/HTTPS 图片 URL)
magi-2-reference-to-video多模态参考生视频image_urls、video_urls 或 audio_urls 至少提供一项

全部三条路由均输出 4 至 30 秒(整数)的 1080p MP4 视频,并可选生成同步对白、音效与配乐(默认 generate_audio: true)。

端点与鉴权

  • 提交任务: POST https://api.seedrouter.ai/v1/videos/generations
  • 轮询任务状态: GET https://api.seedrouter.ai/v1/tasks/{id}
  • 鉴权方式: Authorization: Bearer YOUR_API_KEY
  • Content-Type: application/json

请求参数

传入未定义字段将被拒绝,并返回 HTTP 400(invalid_request_error)。

参数类型默认值约束与说明
modelstring必填magi-2-text-to-video、magi-2-image-to-video 或 magi-2-reference-to-video。
promptstring—magi-2-text-to-video 必填;图生视频与参考生视频可选。传入时必须为非空字符串,且不超过 15,000 个字符。
image_urlsstring[]—公开 HTTP/HTTPS 图片 URL(不支持 Base64 或 data: URI,单张不超过 30 MB)。magi-2-text-to-video 不接受此字段;magi-2-image-to-video 需传入 1 张(首帧)或 2 张(首帧与尾帧);magi-2-reference-to-video 最多支持 10 张。
video_urlsstring[]—仅限 magi-2-reference-to-video。最多 5 个公开 HTTP/HTTPS MP4/MOV 参考视频(单个不超过 200 MB,单段 2–30 秒,总时长 ≤ 30 秒)。
audio_urlsstring[]—仅限 magi-2-reference-to-video。最多 5 段公开 HTTP/HTTPS WAV/MP3 参考音频(单段不超过 15 MB,单段 2–30 秒,总时长 ≤ 30 秒)。
durationinteger5请求输出的时长(秒),4 到 30 之间的整数。
qualitystring"1080p"输出分辨率,当前为 "1080p"。
aspect_ratiostring"16:9"可选 "16:9"、"9:16"、"1:1"、"4:3"、"3:4"、"21:9"。
generate_audiobooleantrue免费生成音画同步的对白、音效与配乐。设为 false 可输出无声视频。
seedinteger—可选随机种子(0 到 4294967295),用于复现生成结果。

调用示例

1. 文生视频

curl -X POST https://api.seedrouter.ai/v1/videos/generations \
  -H "Authorization: Bearer $SEEDROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "magi-2-text-to-video",
    "prompt": "Continuous 5-second tracking shot through a rainy Tokyo alley at dusk, neon reflections on wet asphalt, distant train rumble and footsteps",
    "duration": 5,
    "quality": "1080p",
    "aspect_ratio": "16:9",
    "generate_audio": true
  }'

2. 图生视频(首帧 / 首尾帧)

curl -X POST https://api.seedrouter.ai/v1/videos/generations \
  -H "Authorization: Bearer $SEEDROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "magi-2-image-to-video",
    "prompt": "The camera slowly pushes in as subtle natural motion brings the frame to life",
    "image_urls": [
      "https://example.com/first-frame.jpg"
    ],
    "duration": 5,
    "quality": "1080p",
    "aspect_ratio": "16:9",
    "generate_audio": true
  }'

3. 参考生视频

curl -X POST https://api.seedrouter.ai/v1/videos/generations \
  -H "Authorization: Bearer $SEEDROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "magi-2-reference-to-video",
    "prompt": "The same character walks through a sunlit street market, handheld tracking shot",
    "image_urls": [
      "https://example.com/character.jpg"
    ],
    "duration": 5,
    "quality": "1080p",
    "aspect_ratio": "16:9",
    "generate_audio": true
  }'

4. 轮询任务结果

curl https://api.seedrouter.ai/v1/tasks/task_xxxxxxxx \
  -H "Authorization: Bearer $SEEDROUTER_API_KEY"

提交任务后返回:

{
  "id": "task_xxxxxxxx",
  "model": "magi-2-text-to-video",
  "status": "processing",
  "created_at": 1764120000
}

当轮询状态变为 "status": "completed" 时,生成的 MP4 地址位于 output.video_url:

{
  "id": "task_xxxxxxxx",
  "model": "magi-2-text-to-video",
  "status": "completed",
  "created_at": 1764120000,
  "finished_at": 1764120095,
  "output": {
    "video_url": "https://static.seedrouter.ai/..."
  }
}

计费说明

全部三条 MAGI-2 路由均按 1080p 请求输出时长按秒计费(duration 范围 4 至 30 秒)。参考图、参考视频、参考音频及原生同步音频均不额外收费。失败的任务不扣费。

前往 MAGI-2 模型页面 查看当前实时按秒费率。