# MiniMax H3 Max Text to Video API > Generate 1080p video from text with the MiniMax H3 Max API on Muapi. Cinematic motion, prompt expansion, pay per generation. ## 概览 - **端点**: `POST https://api.muapi.ai/api/v1/minimax-h3-max-text-to-video` - **模型 ID**: `minimax-h3-max-text-to-video` - **类别**: 文生视频 - **变体**: MiniMax H3 Max Text to Video - **系列**: minimax-h3-max - **费用**: 每次调用 0.26 credits(部分模型会根据参数动态计算费用) ## API 使用 MuApi 使用**提交后轮询**模式:提交任务,获取 `request_id`,然后轮询预测端点,直到 `status` 为 `completed`。也可以在提交请求中传入 `?webhook=YOUR_URL`,任务完成后接收 POST 回调(无需轮询)。 **身份验证**:在 `x-api-key` 请求头中发送 MuApi 密钥。可在 https://muapi.ai/access-keys 获取。 ### 1. 提交任务 ```http POST https://api.muapi.ai/api/v1/minimax-h3-max-text-to-video Content-Type: application/json x-api-key: YOUR_API_KEY ``` **最小请求(仅必填参数):** ```json { "prompt": "" } ``` **完整示例(全部参数):** ```json { "prompt": "", "aspect_ratio": "16:9", "resolution": "768p", "duration": 5, "prompt_expansion_mode": "balanced" } ``` **响应:** ```json { "request_id": "abc123", "status": "processing" } ``` ### 2. 轮询结果 ```http GET https://api.muapi.ai/api/v1/predictions/{request_id}/result x-api-key: YOUR_API_KEY ``` 可能的 `status` 值:`queued`、`pending`、`processing`、`completed`、`failed`、`cancelled`。每 2–5 秒轮询一次,直到进入终止状态。状态为 `completed` 时,结果 URL 位于 `outputs` 数组中。 **`completed` 状态的响应示例:** ```json { "id": "abc123", "status": "completed", "outputs": [ "https://cdn.muapi.ai/.../output.png" ], "urls": { "get": "https://api.muapi.ai/api/v1/predictions/abc123/result" }, "created_at": "2026-05-08T12:34:56Z", "has_nsfw_contents": [] } ``` ### cURL ```bash 1. 提交 REQUEST_ID=$(curl -s -X POST https://api.muapi.ai/api/v1/minimax-h3-max-text-to-video \ -H "x-api-key: $MUAPI_API_KEY" \ -H "Content-Type: application/json" \ -d '{"prompt":""}' | jq -r .request_id) 2. 轮询直到完成 while :; do RESP=$(curl -s https://api.muapi.ai/api/v1/predictions/$REQUEST_ID/result -H "x-api-key: $MUAPI_API_KEY") STATUS=$(echo "$RESP" | jq -r .status) [ "$STATUS" = "completed" ] && echo "$RESP" | jq .outputs && break [ "$STATUS" = "failed" ] && echo "$RESP" && exit 1 sleep 3 done ``` ### Python ```python import os, time, requests API = "https://api.muapi.ai/api/v1" headers = {"x-api-key": os.environ["MUAPI_API_KEY"]} r = requests.post(f"{API}/minimax-h3-max-text-to-video", headers=headers, json={"prompt":""}) request_id = r.json()["request_id"] while True: res = requests.get(f"{API}/predictions/{request_id}/result", headers=headers).json() if res["status"] == "completed": print(res["outputs"]); break if res["status"] == "failed": raise RuntimeError(res.get("error")); time.sleep(3) ``` ## 输入结构 API 接受以下输入参数: - **`prompt`** (`string`, _必填_): 描述视频场景、动作、镜头移动和风格。 - **`aspect_ratio`** (`string`, _可选_): 暂无描述。 - 默认值: `"16:9"` - 选项: `"21:9"`, `"16:9"`, `"4:3"`, `"1:1"`, `"3:4"`, `"9:16"` - **`resolution`** (`string`, _可选_): Output resolution. 1080p applies latent refinement from a 768p source. - 默认值: `"768p"` - 选项: `"480p"`, `"768p"`, `"1080p"` - **`duration`** (`integer`, _可选_): 输出时长(秒)。 - 默认值: `5` - 选项: `"5"`, `"6"`, `"7"`, `"8"`, `"9"`, `"10"`, `"11"`, `"12"`, `"13"`, `"14"`, `"15"` - **`prompt_expansion_mode`** (`string`, _可选_): Prompt rewriting effort. 'quality' can add up to ~30s of processing. - 默认值: `"balanced"` - 选项: `"disabled"`, `"balanced"`, `"quality"` ## 输出结构 轮询端点会返回以下字段: - **`id`** (`string`): 请求 ID。 - **`status`** (`string`): 取值之一:`queued`、`pending`、`processing`、`completed`、`failed`、`cancelled`。 - **`outputs`** (`array`): 生成的图像、视频或音频 URL。`status` 为 `completed` 前为空。 - **`urls.get`** (`string`): 用于重新获取此预测结果的自身链接。 - **`error`** (`string` | `null`): `status` 为 `failed` 时的错误消息。 - **`created_at`** (`string`): 创建请求时的 ISO-8601 时间戳。 - **`has_nsfw_contents`** (`array of boolean`): 每个输出对应的 NSFW 检测标记。 ## Webhook(可选) 在提交 URL 后附加 `?webhook=https://your-server/path`。任务进入终止状态后,MuApi 会将与轮询响应相同结构的 POST 请求发送到你的 URL,无需轮询。 ## Agent 集成 MuApi 提供 MCP 服务器和 CLI,让 Agent(Claude Code、Cursor 或自定义 Agent)无需编写 HTTP 代码即可调用此端点: ```bash # 安装 CLI npm install -g muapi-cli # 完成一次身份验证 muapi auth login # 将所有 MuApi 模型作为 MCP 工具提供给 Agent muapi mcp serve ``` MCP 服务器为每个模型提供封装提交与轮询的工具,包括 `minimax-h3-max-text-to-video`。使用 `muapi --help` 查看按类别划分的快捷命令(`muapi image generate`、`muapi video from-image` 等)。 ## 相关模型 - [MiniMax H3 Max Image to Video](https://muapi.ai/zh/playground/minimax-h3-max-image-to-video) - [MiniMax H3 Max Turbo Text to Video](https://muapi.ai/zh/playground/minimax-h3-max-turbo-text-to-video) - [MiniMax H3 Max Turbo Image to Video](https://muapi.ai/zh/playground/minimax-h3-max-turbo-image-to-video) - [MiniMax H3 Max Text to Video](https://muapi.ai/zh/playground/minimax-h3-max-text-to-video) - [MiniMax H3 Max Reference to Video](https://muapi.ai/zh/playground/minimax-h3-max-reference-to-video) ## 资源 - [Playground 页面](https://muapi.ai/zh/playground/minimax-h3-max-text-to-video) - [API 文档](https://muapi.ai/zh/playground/minimax-h3-max-text-to-video/api) - [全站 llms.txt](https://muapi.ai/zh/llms.txt)