Unofficial Python library for the Minimax REST API
Project description
MiniMax Python SDK
A type-safe Python SDK for the MiniMax REST API, focusing on video generation capabilities. Built with modern Python features and focused on developer experience, this library provides a clean interface to MiniMax's video generation API.
Disclaimer: This SDK is an unofficial implementation and is not affiliated with, endorsed by, or associated with MiniMax Open Platform or NanoNoble PTE. LTD.
Installation
Requires Python 3.8 or later.
pip install minimax-python
Quick Start
from minimax import Minimax
# Initialize with environment variables (MINIMAX_API_KEY, MINIMAX_GROUP_ID)
client = Minimax()
# Generate a video from text
video_path = client.create_video(
text="A majestic dragon soars through sunset-lit clouds",
output_path="dragon.mp4"
)
print(f"Video generated at: {video_path}")
Example Outputs
Here are some examples generated using this SDK:
| Text-to-Video | Image-to-Video |
|---|---|
Note: The examples above are compressed GIFs for preview. For the actual high-quality video outputs (720p, 25fps) generated by this SDK, check the assets/videos directory. Source images for the image-to-video examples are available in assets/images.
About MiniMax Platform
MiniMax offers a comprehensive AI platform with multiple capabilities:
- 🎥 Video Generation (currently supported in this SDK)
- 🗣️ Text Generation
- 🔊 Speech Synthesis (Text-to-Audio)
- 🎙️ Voice Cloning
- And more...
This SDK currently focuses on the Video Generation API, which supports:
- Text-to-Video generation
- Image-to-Video generation
- High-definition output (720p resolution at 25fps)
- Advanced prompt control
Note: While MiniMax offers many AI capabilities, this SDK currently specializes in video generation. Future versions may include support for other MiniMax APIs. You'll need a MiniMax API key and Group ID to use this SDK. Visit the MiniMax Platform to obtain your credentials.
Features
✨ Modern Python SDK
- Async and sync clients with identical APIs
- Type-safe with Pydantic models
- Comprehensive docstrings and type hints
🚀 Production Ready
- Robust error handling with detailed messages
- Automatic retries with exponential backoff
- Progress tracking for long-running operations
🔧 Developer Experience
- Environment variables or constructor configuration
- Support for files, URLs, and raw bytes as input
- Rich examples for every feature
Detailed Usage
Synchronous Client Example
from minimax import Minimax
# Initialize the client
client = Minimax(
api_key="your_api_key", # Optional if MINIMAX_API_KEY env var is set
group_id="your_group_id" # Optional if MINIMAX_GROUP_ID env var is set
)
# Example: Image-to-Video with prompt guidance
prompt = """The dragon in the image awakens, its eyes glowing with ancient power.
The camera circles slowly around as the dragon unfurls its wings, sending ripples
through the misty mountain air. Particles of golden light dance around its scales
as it raises its head majestically, creating an awe-inspiring atmosphere with
rich, vibrant colors and dramatic lighting."""
# Generate video from image
client.create_video(
image="dragon.jpg",
text=prompt,
output_path="dragon.mp4"
)
Asynchronous Client Example
from minimax import AsyncMinimax
import asyncio
async def main():
# Initialize the async client
client = AsyncMinimax()
# Example: Text-to-Video generation
prompt = """A martial artist performs a spinning kick in a traditional dojo.
The camera tracks smoothly around the movement as cherry blossom petals
drift through the air. Time slows dramatically during the apex of the spin,
capturing the precise form and power of the technique. The scene has a
cinematic quality with dynamic lighting that emphasizes the flow of movement."""
await client.create_video(text=prompt, output_path="martial_arts.mp4")
asyncio.run(main())
Note: Both sync and async clients support all features (text-to-video and image-to-video generation). The examples above just showcase different use cases for variety.
Documentation
- Examples Directory: More code examples for all features
- API Documentation: MiniMax's official API reference
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file minimax_python-0.1.1.tar.gz.
File metadata
- Download URL: minimax_python-0.1.1.tar.gz
- Upload date:
- Size: 20.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96591f683e54baadec09a371ef7235ef5ca3b7f7420e6bf80f614e4275eb0d6b
|
|
| MD5 |
f8385a171870df57e0d536278dd43bc1
|
|
| BLAKE2b-256 |
324ab9c8d372d36fb99670664200f383c2ff8f256aa6dc503270b7ccde71abbd
|
File details
Details for the file minimax_python-0.1.1-py3-none-any.whl.
File metadata
- Download URL: minimax_python-0.1.1-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab3a4018e12edbdfaa991c2edb8a25fe3066b9058fbd9de4156cb9c067e69d8e
|
|
| MD5 |
0171df9ca3a3ed2a744b6484852861ea
|
|
| BLAKE2b-256 |
c40a8df93b544232a9d044dd063c4c7d6eff41d139f823bfa2e8d2d5de060ea1
|