Skip to Content
ModelSell 文档
视频系列Magi-2 视频

Magi-2 文生视频

POST
/sand/magi-2/text-to-video

使用 ModelSell API Key 以 Bearer 鉴权提交文本提示词,生成 4–30 秒的 1080p 视频。路径已指定模型 magi-2。 保存响应中的公共 request_id,使用同一 API Key 访问 status_url 查询生成进度。

Authorization

bearerAuth
headerAuthorizationBearer <API key>

使用 Authorization Bearer API Key 进行鉴权。

Request Body

application/json
  1. body
prompt*string

视频内容、镜头运动或参考素材的使用说明,至少包含一个非空白字符。

Match\S
Length1 <= length <= 15000
duration?integer

视频时长,单位为秒。

Range4 <= value <= 30
Default5
resolution?"1080p"

输出视频的分辨率。

Default"1080p"
Value in"1080p"
aspect_ratio?string

输出画面的宽高比。

Default"16:9"
Value in"21:9""16:9""4:3""1:1""3:4""9:16"
generate_audio?boolean

是否生成视频声音,传 false 可生成无声视频。

Defaulttrue
seed?integer

随机种子,可传 0。

Range0 <= value <= 4294967295

Response Body

异步任务已受理。保存公共 request_id,按 status_url 查询后续状态。

application/json
  1. response
request_id*Magi2PublicTaskId

ModelSell 为本次生成分配的公共任务 ID。

Match^task_.+
status_url*string

本 API 域名下的任务查询路径。

Match^/requests/task_[^/]+/status$
Formaturi-reference
status*string

当前状态。completed 表示生成成功,nsfw 表示内容被拦截。

Value in"queued""in_progress""completed""failed""nsfw""canceled"
video?
error?string

任务失败时提供的原因。

Example Request
curl -X POST 'https://docs.modelsell.com/sand/magi-2/text-to-video' \  -H 'Content-Type: application/json' \  -d '{  "prompt": "A cinematic scene at sunset, with waves washing against the shore.",  "duration": 5,  "resolution": "1080p",  "aspect_ratio": "16:9",  "generate_audio": true}'
Example Response
{  "request_id": "task_MAGI2_EXAMPLE",  "status_url": "/requests/task_MAGI2_EXAMPLE/status",  "status": "queued"}