### Generate video Source: https://github.com/minimax-ai/minimax-mcp/blob/main/README.md Example usage for generating a video. Define completion rules before starting. ```python from minimax import Minimax minimax = Minimax(api_key="YOUR_API_KEY") # Generate a video minimax.generate_video( prompt="A futuristic cityscape at sunset", output_path="output.mp4", completion_rules=["rule1", "rule2"] ) ``` -------------------------------- ### MinimaxAPIClient Initialization and Usage Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Demonstrates how to initialize the MinimaxAPIClient and make common API requests like POST for text-to-speech and GET for querying status. It also shows an example of file upload for voice cloning. ```APIDOC ## MinimaxAPIClient The underlying API client handles authentication and requests to MiniMax endpoints. ### Description This section details the initialization and usage of the `MinimaxAPIClient` for interacting with MiniMax AI services. ### Method Initialization and various HTTP methods (POST, GET). ### Endpoint `/v1/t2a_v2`, `/v1/query/video_generation`, `/v1/files/upload` ### Parameters #### Path Parameters None for initialization. Specific endpoints have their own parameters. #### Query Parameters - **task_id** (string) - Required - The ID of the video generation task to query. #### Request Body ##### POST /v1/t2a_v2 - **model** (string) - Required - The text-to-speech model to use (e.g., "speech-2.6-hd"). - **text** (string) - Required - The text to convert to speech. - **voice_setting** (object) - Required - Settings for the voice. - **voice_id** (string) - Required - The ID of the voice to use (e.g., "female-shaonv"). - **speed** (float) - Optional - The speaking speed (default: 1.0). - **vol** (float) - Optional - The volume (default: 1.0). - **pitch** (integer) - Optional - The pitch (default: 0). - **emotion** (string) - Optional - The emotion of the voice (e.g., "happy"). - **audio_setting** (object) - Required - Settings for the audio output. - **sample_rate** (integer) - Optional - The sample rate of the audio (default: 32000). - **bitrate** (integer) - Optional - The bitrate of the audio (default: 128000). - **format** (string) - Optional - The audio format (e.g., "mp3"). - **channel** (integer) - Optional - The number of audio channels (default: 1). ##### POST /v1/files/upload - **file** (file) - Required - The audio file to upload for voice cloning. - **purpose** (string) - Required - The purpose of the file upload (e.g., "voice_clone"). ### Request Example ```python from minimax_mcp.client import MinimaxAPIClient client = MinimaxAPIClient( api_key="your-api-key", api_host="https://api.minimax.io" ) # Text-to-speech example response_tts = client.post("/v1/t2a_v2", json={ "model": "speech-2.6-hd", "text": "Hello world", "voice_setting": { "voice_id": "female-shaonv", "speed": 1.0, "vol": 1.0, "pitch": 0, "emotion": "happy" }, "audio_setting": { "sample_rate": 32000, "bitrate": 128000, "format": "mp3", "channel": 1 } }) # Query video status example status = client.get("/v1/query/video_generation?task_id=abc123") # File upload for voice cloning example with open("sample.mp3", "rb") as f: response_upload = client.post( "/v1/files/upload", files={"file": f}, data={"purpose": "voice_clone"} ) ``` ### Response #### Success Response (200) - **response_tts** (object) - The response from the text-to-speech API. - **status** (object) - The status of the video generation task. - **response_upload** (object) - The response from the file upload API. #### Response Example ```json { "message": "Success", "data": { ... } } ``` ``` -------------------------------- ### Generate images Source: https://github.com/minimax-ai/minimax-mcp/blob/main/README.md Example usage for generating images. Provide a prompt and specify the output path. ```python from minimax import Minimax minimax = Minimax(api_key="YOUR_API_KEY") # Generate images minimax.generate_images( prompt="A serene forest landscape", output_path="output.png" ) ``` -------------------------------- ### Clone a voice Source: https://github.com/minimax-ai/minimax-mcp/blob/main/README.md Example usage for cloning a voice. Ensure you have the necessary audio data. ```python from minimax import Minimax minimax = Minimax(api_key="YOUR_API_KEY") # Clone a voice minimax.clone_voice( name="My Voice", audio_file="path/to/your/audio.wav" ) ``` -------------------------------- ### Clone Voice from Audio Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Tool call examples for cloning a voice using a local file or a URL. Requires a source file and a target voice ID. ```python # Clone from local file { "voice_id": "my_custom_voice", "file": "/path/to/voice_sample.mp3", "text": "This is a demo of my cloned voice.", "is_url": false, "output_directory": "~/Desktop/cloned" } # Clone from URL { "voice_id": "narrator_voice", "file": "https://example.com/sample_audio.mp3", "text": "Testing the cloned narrator voice.", "is_url": true, "output_directory": "~/Desktop/cloned" } ``` -------------------------------- ### List Available Voices Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Tool call examples for retrieving system or custom cloned voices. Allows filtering by voice type. ```python # List all voices { "voice_type": "all" } # List system voices { "voice_type": "system" } # List cloned voices { "voice_type": "voice_cloning" } ``` -------------------------------- ### Initialize and Use MinimaxAPIClient in Python Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Demonstrates how to initialize the MinimaxAPIClient with API credentials and make various requests to MiniMax endpoints. This includes POST requests for text-to-speech and file uploads, as well as GET requests for querying video generation status. It requires the 'minimax-mcp' library. ```python from minimax_mcp.client import MinimaxAPIClient # Initialize client client = MinimaxAPIClient( api_key="your-api-key", api_host="https://api.minimax.io" ) # Make POST request (e.g., text-to-speech) response = client.post("/v1/t2a_v2", json={ "model": "speech-2.6-hd", "text": "Hello world", "voice_setting": { "voice_id": "female-shaonv", "speed": 1.0, "vol": 1.0, "pitch": 0, "emotion": "happy" }, "audio_setting": { "sample_rate": 32000, "bitrate": 128000, "format": "mp3", "channel": 1 } }) # Make GET request (e.g., query video status) status = client.get("/v1/query/video_generation?task_id=abc123") # File upload for voice cloning with open("sample.mp3", "rb") as f: response = client.post( "/v1/files/upload", files={"file": f}, data={"purpose": "voice_clone"} ) ``` -------------------------------- ### Convert Text to Audio Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Tool call examples for text-to-speech synthesis. Supports basic and advanced parameters like voice ID, speed, pitch, emotion, and output formatting. ```python # Basic usage { "text": "Hello, welcome to MiniMax text-to-speech service!", "output_directory": "~/Desktop/audio" } # Advanced usage { "text": "Breaking news: Scientists have made a groundbreaking discovery.", "voice_id": "male-qn-qingse", "model": "speech-2.6-hd", "speed": 1.2, "vol": 1.5, "pitch": 2, "emotion": "neutral", "sample_rate": 44100, "bitrate": 256000, "channel": 2, "format": "mp3", "language_boost": "English", "output_directory": "~/Desktop/news" } ``` -------------------------------- ### Broadcast news segment Source: https://github.com/minimax-ai/minimax-mcp/blob/main/README.md Example usage for broadcasting a segment of the evening news. ```python from minimax import Minimax minimax = Minimax(api_key="YOUR_API_KEY") # Broadcast a segment of the evening news minimax.broadcast_news( title="Evening News", segment_url="https://example.com/news_segment.mp4", description="A summary of today's top stories." ) ``` -------------------------------- ### Play Audio Files Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Plays audio files from local paths or remote URLs. Requires ffmpeg installed on the host system. ```json { "input_file_path": "https://cdn.minimax.io/audio/sample.mp3", "is_url": true } ``` -------------------------------- ### Design Custom Voice Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Tool call examples for generating a new voice based on a descriptive text prompt. Supports optional manual voice ID assignment. ```python # Create voice with ID { "prompt": "A warm, friendly female voice in her 30s with a slight British accent, suitable for audiobook narration", "preview_text": "Welcome to this exciting adventure story. Let me take you on a journey through mysterious lands.", "voice_id": "audiobook_narrator", "output_directory": "~/Desktop/voices" } # Create voice with auto-generated ID { "prompt": "Young energetic male voice, enthusiastic and upbeat, perfect for sports commentary", "preview_text": "And the crowd goes wild! What an incredible play!" } ``` -------------------------------- ### Configure Environment Variables Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Sets up the MCP server environment, including API credentials, host endpoints, and default file output directories. ```bash MINIMAX_API_KEY=your-api-key-here MINIMAX_API_HOST=https://api.minimax.io MINIMAX_MCP_BASE_PATH=~/Desktop ``` -------------------------------- ### Configure Claude Desktop for MiniMax MCP Source: https://github.com/minimax-ai/minimax-mcp/blob/main/README.md Add this configuration to your claude_desktop_config.json to enable the MiniMax MCP server. Ensure your MINIMAX_API_KEY and MINIMAX_API_HOST are correctly set for your region. ```json { "mcpServers": { "MiniMax": { "command": "uvx", "args": [ "minimax-mcp", "-y" ], "env": { "MINIMAX_API_KEY": "insert-your-api-key-here", "MINIMAX_MCP_BASE_PATH": "local-output-dir-path, such as /User/xxx/Desktop", "MINIMAX_API_HOST": "api host, https://api.minimax.io | https://api.minimaxi.com", "MINIMAX_API_RESOURCE_MODE": "optional, [url|local], url is default, audio/image/video are downloaded locally or provided in URL format" } } } } ``` -------------------------------- ### POST /query_video_generation Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Checks the status of an asynchronous video generation task and retrieves the final output. ```APIDOC ## POST /query_video_generation ### Description Polls the status of a previously submitted asynchronous video generation task. ### Method POST ### Parameters #### Request Body - **task_id** (string) - Required - The ID returned from the initial generation request - **output_directory** (string) - Required - Path to save the completed file ### Request Example { "task_id": "task_abc123", "output_directory": "~/Desktop/videos" } ### Response #### Success Response (200) - **status** (string) - Current status (processing, completed, or failed) #### Response Example { "message": "Success. Video saved as: ~/Desktop/videos/video_task_abc123.mp4" } ``` -------------------------------- ### Find uvx executable path Source: https://github.com/minimax-ai/minimax-mcp/blob/main/README.md Use this command to find the absolute path of the uvx executable if it's not found. Update your configuration with the obtained path. ```sh which uvx ``` -------------------------------- ### POST voice_clone Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Creates a new voice profile from an existing audio sample. ```APIDOC ## POST voice_clone ### Description Clone a voice from an audio sample file. The cloned voice can be used in subsequent text-to-speech calls. ### Method POST ### Endpoint voice_clone ### Parameters #### Request Body - **voice_id** (string) - Required - Unique identifier for the new voice. - **file** (string) - Required - Path or URL to the audio sample. - **is_url** (boolean) - Required - Whether the file input is a URL. - **output_directory** (string) - Required - Directory to store the demo output. ### Request Example { "voice_id": "my_custom_voice", "file": "/path/to/sample.mp3", "is_url": false } ### Response #### Success Response (200) - **status** (string) - Success confirmation and file path. ``` -------------------------------- ### POST /generate_video Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Generates video content from text prompts or image-to-video inputs with support for director-style camera controls and asynchronous processing. ```APIDOC ## POST /generate_video ### Description Generates a video based on a prompt. Supports T2V (text-to-video), I2V (image-to-video), and Director models. ### Method POST ### Parameters #### Request Body - **model** (string) - Required - The model identifier (e.g., T2V-01, I2V-01, MiniMax-Hailuo-02) - **prompt** (string) - Required - The descriptive text for video generation - **output_directory** (string) - Required - Local path to save the generated file - **first_frame_image** (string) - Optional - Path to the starting frame for I2V models - **duration** (integer) - Optional - Duration in seconds - **resolution** (string) - Optional - Output resolution (e.g., 1080P) - **async_mode** (boolean) - Optional - If true, returns a task ID for background processing ### Request Example { "model": "MiniMax-Hailuo-02", "prompt": "A futuristic cityscape", "output_directory": "~/Desktop/videos" } ### Response #### Success Response (200) - **message** (string) - Confirmation message with file path or task ID #### Response Example { "message": "Success. Video saved as: ~/Desktop/videos/video_task123.mp4" } ``` -------------------------------- ### POST /text_to_image Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Generates images from text prompts with support for batching and aspect ratio configuration. ```APIDOC ## POST /text_to_image ### Description Creates high-quality images based on provided prompts. ### Method POST ### Parameters #### Request Body - **prompt** (string) - Required - Description of the image - **aspect_ratio** (string) - Optional - Desired ratio (e.g., 16:9, 3:4) - **n** (integer) - Optional - Number of images to generate - **output_directory** (string) - Required - Path to save images ### Request Example { "prompt": "Cyberpunk street scene", "aspect_ratio": "16:9", "n": 1, "output_directory": "~/Desktop/images" } ### Response #### Success Response (200) - **files** (array) - List of paths to generated images ``` -------------------------------- ### POST text_to_audio Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Converts input text into high-quality audio using specified voice models and parameters. ```APIDOC ## POST text_to_audio ### Description Convert text to audio with customizable voice, speed, pitch, emotion, and audio format settings. ### Method POST ### Endpoint text_to_audio ### Parameters #### Request Body - **text** (string) - Required - The text content to synthesize. - **output_directory** (string) - Required - Local path to save the generated file. - **voice_id** (string) - Optional - The ID of the voice to use. - **model** (string) - Optional - The speech model version. - **speed** (float) - Optional - Playback speed multiplier. - **vol** (float) - Optional - Volume level. - **pitch** (float) - Optional - Pitch adjustment. - **format** (string) - Optional - Audio output format (e.g., mp3, wav). ### Request Example { "text": "Hello, welcome to MiniMax!", "voice_id": "male-qn-qingse", "output_directory": "~/Desktop/audio" } ### Response #### Success Response (200) - **message** (string) - Confirmation message including file path or URL. #### Response Example { "message": "Success. File saved as: ~/Desktop/audio/t2a_sample.mp3" } ``` -------------------------------- ### Generate Images from Text Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Creates images based on text prompts with support for batch generation, custom aspect ratios, and prompt optimization. ```json { "model": "image-01", "prompt": "Cyberpunk street scene with rain and neon reflections, highly detailed", "aspect_ratio": "16:9", "n": 4, "prompt_optimizer": true, "output_directory": "~/Desktop/images" } ``` -------------------------------- ### POST list_voices Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Retrieves a list of available voices for synthesis, categorized by type. ```APIDOC ## POST list_voices ### Description Retrieve all available voices for text-to-speech synthesis, including system-provided voices and custom cloned voices. ### Method POST ### Endpoint list_voices ### Parameters #### Request Body - **voice_type** (string) - Required - Filter by 'all', 'system', or 'voice_cloning'. ### Request Example { "voice_type": "all" } ### Response #### Success Response (200) - **voices** (array) - List of available voice objects. #### Response Example { "voices": ["Name: Female Shaonv, ID: female-shaonv", "Name: MyClonedVoice, ID: custom_voice_001"] } ``` -------------------------------- ### Configure MiniMax MCP Server Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt JSON configuration for integrating the MiniMax MCP server into an MCP client's settings file. It requires an API key and supports custom base paths and resource delivery modes. ```json { "mcpServers": { "MiniMax": { "command": "uvx", "args": ["minimax-mcp"], "env": { "MINIMAX_API_KEY": "your-api-key-here", "MINIMAX_MCP_BASE_PATH": "~/Desktop", "MINIMAX_API_HOST": "https://api.minimax.io", "MINIMAX_API_RESOURCE_MODE": "url" } } } } ``` -------------------------------- ### Generate Music Tracks Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Produces AI-generated music based on prompts and lyrics. Supports advanced audio settings like sample rate, bitrate, and format selection. ```json { "prompt": "Emotional ballad, piano-driven, melancholic mood, rainy night atmosphere", "lyrics": "[Intro]\n(Soft piano intro)\n[Verse]\nMemories fade like morning dew\nI still remember loving you", "sample_rate": 44100, "bitrate": 256000, "format": "wav", "output_directory": "~/Desktop/music" } ``` -------------------------------- ### Generate Video using MiniMax MCP Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Executes video generation tasks using various models like T2V-01 or MiniMax-Hailuo-02. Supports text-to-video, image-to-video, director-style camera controls, and asynchronous processing. ```json { "model": "T2V-01", "prompt": "A serene mountain landscape at sunset with clouds drifting slowly across the sky", "output_directory": "~/Desktop/videos" } ``` ```json { "model": "MiniMax-Hailuo-02", "prompt": "Ocean waves crashing on a rocky coastline at dawn", "async_mode": true } ``` -------------------------------- ### Query Video Generation Status Source: https://context7.com/minimax-ai/minimax-mcp/llms.txt Checks the status of an asynchronous video generation task using a task ID. Returns the file path if completed or a processing status message. ```json { "task_id": "task_abc123", "output_directory": "~/Desktop/videos" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.