Python SDK for the MiniMax H3 API — text-to-video, image-to-video, and first/last-frame video generation via Muapi.
48
stars
10
commits
Python
primary language
Aug 15, 2026
updated
Python SDK for the MiniMax H3 API on Muapi. Generate video from text, animate a still image, or guide a new video with image, video, and optional audio references using one API key.
requestspip install minimax-h3-api
Or install from source:
git clone https://github.com/Anil-matcha/MiniMax-H3-API.git
cd MiniMax-H3-API
pip install -e .
Set your Muapi API key:
export MUAPI_API_KEY=your_muapi_api_key
from minimax_h3_api import MiniMaxH3API
api = MiniMaxH3API()
task = api.text_to_video(
"A cinematic tracking shot of a silver sports car driving through a rain-soaked city at night",
aspect_ratio="16:9",
resolution="2k",
duration=5,
)
result = api.wait_for_completion(task["request_id"])
print(result["outputs"][0])
task = api.text_to_video(
prompt="A lone astronaut walking through a field of bioluminescent flowers, slow camera dolly in"
)
task = api.image_to_video(
prompt="The camera slowly pushes in as a warm breeze moves through the subject's hair",
image_url="https://example.com/source-image.jpg",
last_image_url="https://example.com/final-frame.jpg",
duration=5,
)
task = api.reference_to_video(
prompt="Use the references to create a cinematic product reveal with a slow camera orbit",
reference_images=["https://example.com/product.jpg"],
reference_videos=["https://example.com/motion-reference.mp4"],
reference_audios=["https://example.com/soundtrack.mp3"],
aspect_ratio="16:9",
resolution="2k",
duration=5,
)
At least one reference_images or reference_videos URL is required. Audio references are optional and cannot be used alone.
Existing integrations can continue using first_last_frame(). It now maps to the current image-to-video endpoint with image_url and last_image_url; new code should call image_to_video() directly.
| Workflow | Endpoint |
|---|---|
| Text to Video | POST /api/v1/minimax-h3-text-to-video |
| Image to Video | POST /api/v1/minimax-h3-image-to-video |
| Reference to Video | POST /api/v1/minimax-h3-reference-to-video |
| Poll task | GET /api/v1/predictions/{request_id}/result |
See the full MiniMax H3 API guide and Muapi documentation.
MIT
10 commits
Python
100.0%
Python SDK for the MiniMax H3 API — text-to-video, image-to-video, and first/last-frame video generation via Muapi.
48
stars
10
commits
Python
primary language
Aug 15, 2026
updated
Python SDK for the MiniMax H3 API on Muapi. Generate video from text, animate a still image, or guide a new video with image, video, and optional audio references using one API key.
requestspip install minimax-h3-api
Or install from source:
git clone https://github.com/Anil-matcha/MiniMax-H3-API.git
cd MiniMax-H3-API
pip install -e .
Set your Muapi API key:
export MUAPI_API_KEY=your_muapi_api_key
from minimax_h3_api import MiniMaxH3API
api = MiniMaxH3API()
task = api.text_to_video(
"A cinematic tracking shot of a silver sports car driving through a rain-soaked city at night",
aspect_ratio="16:9",
resolution="2k",
duration=5,
)
result = api.wait_for_completion(task["request_id"])
print(result["outputs"][0])
task = api.text_to_video(
prompt="A lone astronaut walking through a field of bioluminescent flowers, slow camera dolly in"
)
task = api.image_to_video(
prompt="The camera slowly pushes in as a warm breeze moves through the subject's hair",
image_url="https://example.com/source-image.jpg",
last_image_url="https://example.com/final-frame.jpg",
duration=5,
)
task = api.reference_to_video(
prompt="Use the references to create a cinematic product reveal with a slow camera orbit",
reference_images=["https://example.com/product.jpg"],
reference_videos=["https://example.com/motion-reference.mp4"],
reference_audios=["https://example.com/soundtrack.mp3"],
aspect_ratio="16:9",
resolution="2k",
duration=5,
)
At least one reference_images or reference_videos URL is required. Audio references are optional and cannot be used alone.
Existing integrations can continue using first_last_frame(). It now maps to the current image-to-video endpoint with image_url and last_image_url; new code should call image_to_video() directly.
| Workflow | Endpoint |
|---|---|
| Text to Video | POST /api/v1/minimax-h3-text-to-video |
| Image to Video | POST /api/v1/minimax-h3-image-to-video |
| Reference to Video | POST /api/v1/minimax-h3-reference-to-video |
| Poll task | GET /api/v1/predictions/{request_id}/result |
See the full MiniMax H3 API guide and Muapi documentation.
MIT
10 commits
Python
100.0%