# API chuyển tư liệu tham chiếu thành video MiniMax H3 Max Spicy > Tạo video bằng MiniMax H3 Max Spicy trên API Muapi. Gói Spicy cường độ cao của MiniMax H3 Max ở 480p/768p. Trả phí theo mỗi lần tạo, không cần đăng ký. ## Tổng quan - **Điểm cuối**: `POST https://api.muapi.ai/api/v1/minimax-h3-max-spicy-reference-to-video` - **Mã mẫu**: `minimax-h3-max-spicy-reference-to-video` - **Danh mục**: Hình ảnh thành video - **Biến thể**: MiniMax H3 Max Spicy Reference to Video - **Nhóm**: minimax-h3-spicy - **Chi phí**: 0.46 tín dụng cho mỗi cuộc gọi (một số mô hình tính toán chi phí linh hoạt dựa trên thông số) ## Sử dụng API MuApi sử dụng mẫu **gửi rồi thăm dò ý kiến**: gửi công việc, nhận `request_id`, sau đó thăm dò điểm cuối dự đoán cho đến khi `trạng thái` là `hoàn thành`. Tùy chọn chuyển `?webhook=YOUR_URL` trong lệnh gọi gửi để nhận lệnh gọi lại POST khi công việc kết thúc (bỏ qua bỏ phiếu). **Xác thực**: gửi khóa MuApi của bạn trong tiêu đề `x-api-key`. Nhận một cái tại https://muapi.ai/access-keys. ### 1. Gửi tác vụ ```http POST https://api.muapi.ai/api/v1/minimax-h3-max-spicy-reference-to-video Content-Type: application/json x-api-key: YOUR_API_KEY ``` **Tối thiểu (chỉ bắt buộc):** ```json { "prompt": "" } ``` **Ví dụ đầy đủ (tất cả các thông số):** ```json { "prompt": "", "reference_images": [], "reference_videos": [], "reference_audios": [], "aspect_ratio": "adaptive", "resolution": "768p", "duration": 5 } ``` **Phản hồi:** ```json { "request_id": "abc123", "status": "processing" } ``` ### 2. Kiểm tra kết quả ```http GET https://api.muapi.ai/api/v1/predictions/{request_id}/result x-api-key: YOUR_API_KEY ``` Các giá trị `trạng thái` có thể có: `được xếp hàng`, `đang chờ`, `đang xử lý`, `đã hoàn thành`, `không thành công`, `đã hủy`. Thăm dò ý kiến ​​cứ sau 2-5 giây cho đến khi kết thúc. Khi `hoàn thành`, các URL kết quả nằm trong mảng `đầu ra`. **Phản hồi ví dụ khi `hoàn thành`:** ```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. Gửi tác vụ REQUEST_ID=$(curl -s -X POST https://api.muapi.ai/api/v1/minimax-h3-max-spicy-reference-to-video \ -H "x-api-key: $MUAPI_API_KEY" \ -H "Content-Type: application/json" \ -d '{"prompt":""}' | jq -r .request_id) 2. Thăm dò cho đến khi hoàn thành 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-spicy-reference-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) ``` ## Lược đồ đầu vào API chấp nhận các tham số đầu vào sau: - **`prompt`** (`string`, _required_): Describe the video scene and how the references should be used (e.g. 'Image 1', 'Video 1'). - **`reference_images`** (`array`, _optional_): Reference image URLs (up to 9). Provide at least one image or video reference. Max 12 combined reference files. - **`reference_videos`** (`array`, _optional_): Reference video URLs (up to 3; 2-15s each, 15s combined max). Provide at least one image or video reference. - **`reference_audios`** (`array`, _optional_): URLs (up to 3; 2-15s each, 15s combined max). Audio cannot be used alone. - **`aspect_ratio`** (`string`, _optional_): Không có mô tả. - Mặc định: `"adaptive"` - Tùy chọn: `"adaptive"`, `"21:9"`, `"16:9"`, `"4:3"`, `"1:1"`, `"3:4"`, `"9:16"` - **`resolution`** (`string`, _optional_): Không có mô tả. - Mặc định: `"768p"` - Tùy chọn: `"480p"`, `"768p"` - **`duration`** (`integer`, _optional_): ()。 - Mặc định: `5` - Tùy chọn: `"5"`, `"6"`, `"7"`, `"8"`, `"9"`, `"10"`, `"11"`, `"12"`, `"13"`, `"14"`, `"15"` ## Lược đồ đầu ra Điểm cuối bỏ phiếu trả về các trường sau: - **`id`** (`string`): ID yêu cầu. - **`status`** (`string`): Một trong số `xếp hàng`, `đang chờ xử lý`, `đang xử lý`, `đã hoàn thành`, `không thành công`, `đã hủy`. - **`outputs`** (`array`): URL tới hình ảnh/video/âm thanh được tạo. Để trống cho đến khi `trạng thái` được` hoàn thành`. - **`urls.get`** (`string`): Tự liên kết để tìm nạp lại dự đoán này. - **`error`** (`string` | `null`): Thông báo lỗi nếu `trạng thái` là `không thành công`. - **`created_at`** (`string`): Dấu thời gian ISO-8601 về thời điểm yêu cầu được tạo. - **`has_nsfw_contents`** (`array of boolean`): Cờ phát hiện NSFW trên mỗi đầu ra. ## Webhooks (tùy chọn) Nối `?webhook=https://your-server/path` vào URL gửi. Khi công việc đạt đến trạng thái cuối, MuApi sẽ ĐĂNG hình dạng giống như phản hồi bỏ phiếu cho URL của bạn - không cần bỏ phiếu. ## Tích hợp đại lý MuApi gửi máy chủ MCP và CLI để các đại lý (Mã Claude, Con trỏ, tùy chỉnh) có thể gọi điểm cuối này mà không cần viết mã HTTP: ```bash # Cài đặt CLI npm install -g muapi-cli # Xác thực một lần muapi auth login # Hiển thị tất cả các mô hình MuApi dưới dạng công cụ MCP cho đại lý của bạn muapi mcp serve ``` Máy chủ MCP hiển thị các công cụ bao gồm việc gửi + thăm dò ý kiến cho mọi mô hình, bao gồm cả `minimax-h3-max-spicy-reference-to-video`. Xem `muapi --help` để biết các phím tắt dành riêng cho danh mục (`tạo hình ảnh muaapi`, `muapi video từ hình ảnh`, v.v.). ## Mô hình liên quan - [MiniMax H3 Spicy Image to Video](https://muapi.ai/vi/playground/minimax-h3-image-to-video-spicy) - [MiniMax H3 Max Spicy Text to Video](https://muapi.ai/vi/playground/minimax-h3-max-spicy-text-to-video) - [MiniMax H3 Max Spicy Image to Video](https://muapi.ai/vi/playground/minimax-h3-max-spicy-image-to-video) - [MiniMax H3 Max Spicy Reference to Video](https://muapi.ai/vi/playground/minimax-h3-max-spicy-reference-to-video) - [MiniMax H3 Max Turbo Spicy Text to Video](https://muapi.ai/vi/playground/minimax-h3-max-turbo-spicy-text-to-video) - [MiniMax H3 Max Turbo Spicy Image to Video](https://muapi.ai/vi/playground/minimax-h3-max-turbo-spicy-image-to-video) - [MiniMax H3 Spicy Text to Video](https://muapi.ai/vi/playground/minimax-h3-text-to-video-spicy) - [MiniMax H3 Spicy Reference to Video](https://muapi.ai/vi/playground/minimax-h3-reference-to-video-spicy) ## Tài nguyên - [Trang sân chơi](https://muapi.ai/vi/playground/minimax-h3-max-spicy-reference-to-video) - [Tham khảo API](https://muapi.ai/vi/playground/minimax-h3-max-spicy-reference-to-video/api) - [llms.txt toàn cầu](https://muapi.ai/vi/llms.txt)