# MiniMax Python SDK
<div align="center">
<img src="assets/images/minimax_logo.png" alt="MiniMax Logo" width="300"/>
[![PyPI version](https://img.shields.io/pypi/v/minimax-python?style=flat&colorA=black&colorB=black)](https://pypi.org/project/minimax-python)
[![License](https://img.shields.io/badge/License-MIT-black?style=flat&colorA=black&colorB=black)](https://opensource.org/licenses/MIT)
</div>
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.
```bash
pip install minimax-python
```
## Quick Start
```python
from minimax import Minimax
# Initialize with environment variables (MINIMAX_API_KEY, MINIMAX_GROUP_ID)
client = Minimax()
# Generate a video from text
video_path = client.generate_video(
text="A majestic dragon soars through sunset-lit clouds",
download_path="dragon.mp4"
)
print(f"Video generated at: {video_path}")
```
## Example Outputs
Here are some examples generated using this SDK:
<div align="center">
| Text-to-Video | Image-to-Video |
|:-------------:|:--------------:|
| ![Office scene](assets/gifs/office.gif) | ![Electric cat](assets/gifs/cat_electric.gif) |
| ![Golden retriever](assets/gifs/golden_retriever.gif) | ![Fluffy creature](assets/gifs/fluffy_creature.gif) |
</div>
> **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](assets/videos) directory. Source images for the image-to-video examples are available in [assets/images](assets/images).
## About MiniMax Platform
[MiniMax](https://www.minimaxi.com/en) 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](https://www.minimaxi.com/en) 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
```python
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.generate_video(
image="dragon.jpg",
text=prompt,
download_path="dragon.mp4"
)
```
### Asynchronous Client Example
```python
from minimax import AsyncMinimax
import asyncio
async def main():
# Initialize the async client
client = AsyncMinimax(
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: 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.generate_video(text=prompt, download_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](examples/): More code examples for all features
- [API Documentation](https://platform.minimax.chat/docs/api-reference/video-generation): MiniMax's official API reference
Raw data
{
"_id": null,
"home_page": null,
"name": "minimax-python",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "ai, ai-video-generation, api, generation, minimax, sdk, video",
"author": null,
"author_email": "Jes\u00fas Copado <copado.je@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/b1/e5/ea704b00e62d00c26d27905abf49cefdac27f78d9a113ff06821f553c676/minimax_python-0.2.0.tar.gz",
"platform": null,
"description": "# MiniMax Python SDK\n\n<div align=\"center\">\n <img src=\"assets/images/minimax_logo.png\" alt=\"MiniMax Logo\" width=\"300\"/>\n \n[![PyPI version](https://img.shields.io/pypi/v/minimax-python?style=flat&colorA=black&colorB=black)](https://pypi.org/project/minimax-python)\n[![License](https://img.shields.io/badge/License-MIT-black?style=flat&colorA=black&colorB=black)](https://opensource.org/licenses/MIT)\n</div>\n\nA 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.\n\n> **Disclaimer:** This SDK is an unofficial implementation and is not affiliated with, endorsed by, or associated with MiniMax Open Platform or NanoNoble PTE. LTD.\n\n## Installation\n\nRequires Python 3.8 or later.\n\n```bash\npip install minimax-python\n```\n\n## Quick Start\n\n```python\nfrom minimax import Minimax\n\n# Initialize with environment variables (MINIMAX_API_KEY, MINIMAX_GROUP_ID)\nclient = Minimax()\n\n# Generate a video from text\nvideo_path = client.generate_video(\n text=\"A majestic dragon soars through sunset-lit clouds\",\n download_path=\"dragon.mp4\"\n)\nprint(f\"Video generated at: {video_path}\")\n```\n\n## Example Outputs\n\nHere are some examples generated using this SDK:\n\n<div align=\"center\">\n\n| Text-to-Video | Image-to-Video |\n|:-------------:|:--------------:|\n| ![Office scene](assets/gifs/office.gif) | ![Electric cat](assets/gifs/cat_electric.gif) |\n| ![Golden retriever](assets/gifs/golden_retriever.gif) | ![Fluffy creature](assets/gifs/fluffy_creature.gif) |\n\n</div>\n\n> **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](assets/videos) directory. Source images for the image-to-video examples are available in [assets/images](assets/images).\n\n## About MiniMax Platform\n\n[MiniMax](https://www.minimaxi.com/en) offers a comprehensive AI platform with multiple capabilities:\n- \ud83c\udfa5 Video Generation (currently supported in this SDK)\n- \ud83d\udde3\ufe0f Text Generation\n- \ud83d\udd0a Speech Synthesis (Text-to-Audio)\n- \ud83c\udf99\ufe0f Voice Cloning\n- And more...\n\nThis SDK currently focuses on the Video Generation API, which supports:\n- Text-to-Video generation\n- Image-to-Video generation\n- High-definition output (720p resolution at 25fps)\n- Advanced prompt control\n\n> **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](https://www.minimaxi.com/en) to obtain your credentials.\n\n## Features\n\n\u2728 **Modern Python SDK**\n- Async and sync clients with identical APIs\n- Type-safe with Pydantic models\n- Comprehensive docstrings and type hints\n\n\ud83d\ude80 **Production Ready**\n- Robust error handling with detailed messages\n- Automatic retries with exponential backoff\n- Progress tracking for long-running operations\n\n\ud83d\udd27 **Developer Experience**\n- Environment variables or constructor configuration\n- Support for files, URLs, and raw bytes as input\n- Rich examples for every feature\n\n## Detailed Usage\n\n### Synchronous Client Example\n```python\nfrom minimax import Minimax\n\n# Initialize the client\nclient = Minimax(\n api_key=\"your_api_key\", # Optional if MINIMAX_API_KEY env var is set\n group_id=\"your_group_id\" # Optional if MINIMAX_GROUP_ID env var is set\n)\n\n# Example: Image-to-Video with prompt guidance\nprompt = \"\"\"The dragon in the image awakens, its eyes glowing with ancient power.\nThe camera circles slowly around as the dragon unfurls its wings, sending ripples\nthrough the misty mountain air. Particles of golden light dance around its scales\nas it raises its head majestically, creating an awe-inspiring atmosphere with\nrich, vibrant colors and dramatic lighting.\"\"\"\n\n# Generate video from image\nclient.generate_video(\n image=\"dragon.jpg\",\n text=prompt,\n download_path=\"dragon.mp4\"\n)\n```\n\n### Asynchronous Client Example\n```python\nfrom minimax import AsyncMinimax\nimport asyncio\n\nasync def main():\n # Initialize the async client\n client = AsyncMinimax(\n api_key=\"your_api_key\", # Optional if MINIMAX_API_KEY env var is set\n group_id=\"your_group_id\" # Optional if MINIMAX_GROUP_ID env var is set\n )\n\n # Example: Text-to-Video generation\n prompt = \"\"\"A martial artist performs a spinning kick in a traditional dojo.\n The camera tracks smoothly around the movement as cherry blossom petals\n drift through the air. Time slows dramatically during the apex of the spin,\n capturing the precise form and power of the technique. The scene has a\n cinematic quality with dynamic lighting that emphasizes the flow of movement.\"\"\"\n\n await client.generate_video(text=prompt, download_path=\"martial_arts.mp4\")\n\nasyncio.run(main())\n```\n\n> **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.\n\n## Documentation\n\n- [Examples Directory](examples/): More code examples for all features\n- [API Documentation](https://platform.minimax.chat/docs/api-reference/video-generation): MiniMax's official API reference\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Unofficial Python library for the Minimax REST API",
"version": "0.2.0",
"project_urls": {
"Documentation": "https://github.com/jesuscopado/minimax-python#readme",
"Homepage": "https://github.com/jesuscopado/minimax-python",
"Issues": "https://github.com/jesuscopado/minimax-python/issues",
"Repository": "https://github.com/jesuscopado/minimax-python.git"
},
"split_keywords": [
"ai",
" ai-video-generation",
" api",
" generation",
" minimax",
" sdk",
" video"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "84a93b318c54c3c077a5baa576f0a1d6da9b0e533539d9b2003ed1599da16fd9",
"md5": "81c6d15c7680e6105e1799614cc17023",
"sha256": "266cfb89f2f0664b9311c22788574948d147d5d3d940f675805df9f33e663c23"
},
"downloads": -1,
"filename": "minimax_python-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "81c6d15c7680e6105e1799614cc17023",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 15288,
"upload_time": "2024-12-27T14:42:15",
"upload_time_iso_8601": "2024-12-27T14:42:15.052645Z",
"url": "https://files.pythonhosted.org/packages/84/a9/3b318c54c3c077a5baa576f0a1d6da9b0e533539d9b2003ed1599da16fd9/minimax_python-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "b1e5ea704b00e62d00c26d27905abf49cefdac27f78d9a113ff06821f553c676",
"md5": "a610ec00d04aff21030526e28eb47e05",
"sha256": "6b8d009f842dd4bebe3f6d82e2615af330dd3e83824bca417ca0ed269a2184cb"
},
"downloads": -1,
"filename": "minimax_python-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "a610ec00d04aff21030526e28eb47e05",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 20733959,
"upload_time": "2024-12-27T14:42:31",
"upload_time_iso_8601": "2024-12-27T14:42:31.359129Z",
"url": "https://files.pythonhosted.org/packages/b1/e5/ea704b00e62d00c26d27905abf49cefdac27f78d9a113ff06821f553c676/minimax_python-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-27 14:42:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jesuscopado",
"github_project": "minimax-python#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "minimax-python"
}