/VIDEO/magi-2
视频
Sand AI

MAGI-2 API

Generate 4–30 second 1080p videos with synchronized sound from text, first and last frames, or image, video and audio references.

  • 文本转视频
  • 图像转视频

起价

$0.114

每秒输出

10 个参数 · 1 种价格选项

MAGI-2 API 价格

选项每秒价格
1080p$0.114
1curl -X POST https://api.api-stock.com/api/v1/generation/create \
2 -H "Authorization: Bearer $API_STOCK_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "model": "magi-2",
6 "input": {
7 "duration": 5,
8 "resolution": "1080p",
9 "generateAudio": true
10 }
11 }'

参数

名称类型必填默认值描述
promptstring否—Describe the scene, motion and sound. Required in text and reference modes.
durationnumber否5Clip length in whole seconds.
resolutionstring否1080pOutput resolution.以下之一:1080p
aspectRatiostring否—Output aspect ratio for text and reference modes. Defaults to 16:9. Omit it when using firstFrameImage.以下之一:16:9, 9:16, 1:1, 4:3, 3:4, 21:9
generateAudioboolean否trueGenerate a synchronized soundtrack. This setting does not change the price.
firstFrameImagestring否—Public HTTPS URL of the first frame. The video follows its aspect ratio. Cannot be combined with reference media.
lastFrameImagestring否—Public HTTPS URL of the last frame. Requires firstFrameImage.
imageUrlsstring[]否—Public HTTPS URLs of up to 10 reference images.
videoUrlsstring[]否—Public HTTPS URLs of up to 5 reference videos. Each is 2–30 seconds, with at most 30 seconds in total.
audioUrlsstring[]否—Public HTTPS URLs of up to 5 audio references. Each is 2–30 seconds, with at most 30 seconds in total.

常见问题

MAGI-2 的费用是多少?

MAGI-2 通过 API Stock API 的起价为 $0.114 每秒输出。您按使用量从单个预付余额中支付——无需订阅——最终价格会根据分辨率或时长等参数浮动。

MAGI-2 是什么时候发布的?

MAGI-2 于 2026年11月24日 发布。它可以通过 API Stock API 使用,与其他所有模型共用同一个 API 密钥和预付余额。

如何获取 MAGI-2 的 API 密钥?

注册 API Stock 账号,使用可用的付款方式充值,然后在控制台创建 API 密钥即可,整个过程只需几分钟,无需签订合同。同一个密钥可调用目录中的所有模型,因此无需为 MAGI-2 单独申请密钥。

如何调用 MAGI-2 API?

向 https://api.api-stock.com/api/v1/generation/create 发送 POST 请求,并附上您的 API 密钥和模型 ID "magi-2"。请求会返回一个任务 ID,您可以轮询该 ID;或者在结果准备就绪时通过 webhook 回调通知。上方的快速开始部分提供了一个可直接运行的示例。

MAGI-2 接受哪些输入参数?

MAGI-2 接受 10 个输入参数。参数表中列出了它们的类型、默认值和允许值。

如果 MAGI-2 请求失败,会发生什么?

API Stock 会自动通过备用提供商重试请求。如果所有提供商均失败,费用将退还至您的余额。

我可以使用与其他模型相同的 API 密钥来调用 MAGI-2 吗?

可以。API Stock 上的每个模型——视频、图像、音乐和聊天——共享一个 API 密钥和一个预付余额,因此您无需新的凭据即可切换到 MAGI-2。