# MiniMax Hailuo H3 Text to Video > Generate cinematic 2K video with native audio from a text prompt, up to 15 seconds long. ## Overview - **Endpoint**: `https://api.segmind.com/v1/minimax-h3-text-to-video` - **Model ID**: `minimax-h3-text-to-video` - **Category**: Text-to-Video Generation - **Type**: Synchronous (Direct response) - **Average Cost**: $0.8920833333333335 ## Pricing | resolution | duration | cost | | --- | --- | --- | | 2K | 4 | 0.65 | | 2K | 5 | 0.8125 | | 2K | 6 | 0.975 | | 2K | 7 | 1.1375 | | 2K | 8 | 1.3 | | 2K | 9 | 1.4625 | | 2K | 10 | 1.625 | | 2K | 11 | 1.7875 | | 2K | 12 | 1.95 | | 2K | 13 | 2.1125 | | 2K | 14 | 2.275 | | 2K | 15 | 2.4375 | | 768P | 4 | 0.4 | | 768P | 5 | 0.5 | | 768P | 6 | 0.6 | | 768P | 7 | 0.7 | | 768P | 8 | 0.8 | | 768P | 9 | 0.9 | | 768P | 10 | 1 | | 768P | 11 | 1.1 | | 768P | 12 | 1.2 | | 768P | 13 | 1.3 | | 768P | 14 | 1.4 | | 768P | 15 | 1.5 | ## API Information This model uses a **synchronous response pattern**: 1. Make a POST request with your parameters 2. Receive the output directly in the response (binary for images/videos/audio, JSON for text) 3. No polling required - response is immediate ### Input Schema The API accepts the following input parameters: - **`prompt`** (`string`, _required_): Prompt Describe the scene, subject and motion. Up to 7000 characters. - **`ratio`** (`string`, _optional_): Aspect Ratio Output aspect ratio. - Default: `"16:9"` - Options: "21:9" (21:9), "16:9" (16:9), "4:3" (4:3), "1:1" (1:1), "3:4" (3:4), "9:16" (9:16) - **`duration`** (`integer`, _optional_): Duration (seconds) Length of the generated video. Cost scales per second. - Default: `6` - Range: 4 to 15 - **`resolution`** (`string`, _optional_): Resolution Output resolution. 768P is the cheaper tier; 2K is the highest quality. - Default: `"2K"` - Options: "768P" (768P), "2K" (2K) **Required Parameters Example**: ```json { "prompt": "A neon-lit Tokyo alley in the rain at night, camera slowly pushing forward past steaming food stalls, reflections rippling on wet asphalt, cinematic anamorphic lighting." } ``` **Full Example**: ```json { "prompt": "A neon-lit Tokyo alley in the rain at night, camera slowly pushing forward past steaming food stalls, reflections rippling on wet asphalt, cinematic anamorphic lighting.", "ratio": "16:9", "duration": 6, "resolution": "2K" } ``` ### Output Schema The API returns a synchronous response based on the model type: **For Image/Video/Audio Models**: - Response contains binary data (image/png, video/mp4, audio/mp3) - Content-Type header indicates the media type - Save the response body directly to a file **For Text Models**: - Response is JSON with the generated text - Structure varies by model **HTTP Response Codes**: - **200 - OK**: Request successful, output in response body - **400 - Bad Request**: Invalid parameters - **401 - Unauthorized**: Invalid or missing API key - **404 - Not Found**: Model not found - **406 - Not Acceptable**: Insufficient credits - **429 - Too Many Requests**: Rate limit exceeded - **500 - Server Error**: Internal server error ## Usage Examples ### cURL ```bash curl -X POST "https://api.segmind.com/v1/minimax-h3-text-to-video" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A neon-lit Tokyo alley in the rain at night, camera slowly pushing forward past steaming food stalls, reflections rippling on wet asphalt, cinematic anamorphic lighting.", "ratio": "16:9", "duration": 6, "resolution": "2K" }' ``` ### Python ```python import requests import json api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/minimax-h3-text-to-video" data = { "prompt": "A neon-lit Tokyo alley in the rain at night, camera slowly pushing forward past steaming food stalls, reflections rippling on wet asphalt, cinematic anamorphic lighting.", "ratio": "16:9", "duration": 6, "resolution": "2K" } response = requests.post( url, json=data, headers={ 'x-api-key': api_key, 'Content-Type': 'application/json' } ) if response.status_code == 200: # For image/video/audio models, response.content contains the binary data with open('output.png', 'wb') as f: f.write(response.content) print('Generation complete, saved to output.png') else: print(f"Error: {response.status_code}") print(response.text) ``` ### JavaScript ```javascript const apiKey = 'YOUR_API_KEY'; const url = 'https://api.segmind.com/v1/minimax-h3-text-to-video'; const data = { "prompt": "A neon-lit Tokyo alley in the rain at night, camera slowly pushing forward past steaming food stalls, reflections rippling on wet asphalt, cinematic anamorphic lighting.", "ratio": "16:9", "duration": 6, "resolution": "2K" }; const response = await fetch(url, { method: 'POST', headers: { 'x-api-key': apiKey, 'Content-Type': 'application/json', }, body: JSON.stringify(data), }); if (response.ok) { // For image/video/audio models, response contains binary data const blob = await response.blob(); const downloadUrl = URL.createObjectURL(blob); // Create download link const a = document.createElement('a'); a.href = downloadUrl; a.download = 'output.png'; a.click(); console.log('Generation complete'); } ``` ## Additional Resources ### Documentation - [Model Playground](https://www.segmind.com/models/minimax-h3-text-to-video) - [API Documentation](https://www.segmind.com/models/minimax-h3-text-to-video/api) - [Pricing Details](https://www.segmind.com/models/minimax-h3-text-to-video/pricing) - [Platform Documentation](https://docs.segmind.com/) ### Tags No tags available