Skip to main content

MiniMax Python SDK

MiniMax Logo

PyPI version License

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.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:

Text-to-Video Image-to-Video
Office scene Electric cat
Golden retriever Fluffy creature

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.generate_video(
    image="dragon.jpg",
    text=prompt,
    download_path="dragon.mp4"
)

Asynchronous Client Example

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

Release files for minimax-python 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for minimax-python 0.2.0
File Size Uploaded
minimax_python-0.2.0.tar.gz 20.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for minimax-python 0.2.0
File Interpreter ABI Platform
minimax_python-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.7 MB

Release files / minimax_python-0.2.0.tar.gz

Download URL minimax_python-0.2.0.tar.gz
Size 20.7 MB
Tags Source
SHA-256 checksum
How to use checksums
6b8d009f842dd4bebe3f6d82e2615af330dd3e83824bca417ca0ed269a2184cb
BLAKE2b-256 checksum
How to use checksums
b1e5ea704b00e62d00c26d27905abf49cefdac27f78d9a113ff06821f553c676
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.20

Release files / minimax_python-0.2.0-py3-none-any.whl

Download URL minimax_python-0.2.0-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
266cfb89f2f0664b9311c22788574948d147d5d3d940f675805df9f33e663c23
BLAKE2b-256 checksum
How to use checksums
84a93b318c54c3c077a5baa576f0a1d6da9b0e533539d9b2003ed1599da16fd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.20

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page