# Hailuo 2.3 > Hailuo 2.3 creates hyper-realistic videos from text prompts with fluid character movements and advanced expressive detail. ## Overview - **Endpoint**: `https://api.segmind.com/v1/hailuo-2.3` - **Model ID**: `hailuo-2.3` - **Category**: Image-to-Video Generation - **Type**: Synchronous (Direct response) - **Average Cost**: $0.7 ## Pricing | resolution | duration | cost | | --- | --- | --- | | 768p | 6 | 0.35 | | 768p | 10 | 0.7 | | 1080p | 6 | 0.61 | ## 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 Customizes video content; use for creative scenarios or instructional content. - **`duration`** (`integer | null`, _optional_): Duration Controls video length; choose 6 for brief clips or 10 for longer videos. - Default: `6` - Options: "6" (6), "10" (10) - **`resolution`** (`string | null`, _optional_): Resolution Determines video clarity; use 768p for standard quality, 1080p for high definition. - Default: `"768p"` - Options: "768p" (768p), "1080p" (1080p) - **`prompt_optimizer`** (`boolean | null`, _optional_): Prompt optimizer Enhances prompt execution; true optimizes outputs, false for basic generation. - Default: `true` - **`first_frame_image`** (`File (URL)`, _optional_): First frame image Sets video aspect ratio; link to an image with desired dimensions. **Required Parameters Example**: ```json { "prompt": "A young woman in yoga attire balances gracefully in tree pose on a rock by a serene lake, surrounded by wildflowers and soft morning light. She slowly shifts her arms overhead, transitions through gentle stretches and flows, framed by sun rays filtering through the tree, with calm water and distant mountains in the background." } ``` **Full Example**: ```json { "prompt": "A young woman in yoga attire balances gracefully in tree pose on a rock by a serene lake, surrounded by wildflowers and soft morning light. She slowly shifts her arms overhead, transitions through gentle stretches and flows, framed by sun rays filtering through the tree, with calm water and distant mountains in the background.", "duration": 6, "resolution": "768p", "prompt_optimizer": true, "first_frame_image": "https://segmind-resources.s3.amazonaws.com/output/29539533-f96d-4d18-ad41-71a17f06d160-44c1380a-3513-40b6-b085-bc2cd3cc5477.png" } ``` ### 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/hailuo-2.3" \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A young woman in yoga attire balances gracefully in tree pose on a rock by a serene lake, surrounded by wildflowers and soft morning light. She slowly shifts her arms overhead, transitions through gentle stretches and flows, framed by sun rays filtering through the tree, with calm water and distant mountains in the background.", "duration": 6, "resolution": "768p", "prompt_optimizer": true, "first_frame_image": "https://segmind-resources.s3.amazonaws.com/output/29539533-f96d-4d18-ad41-71a17f06d160-44c1380a-3513-40b6-b085-bc2cd3cc5477.png" }' ``` ### Python ```python import requests import json api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/hailuo-2.3" data = { "prompt": "A young woman in yoga attire balances gracefully in tree pose on a rock by a serene lake, surrounded by wildflowers and soft morning light. She slowly shifts her arms overhead, transitions through gentle stretches and flows, framed by sun rays filtering through the tree, with calm water and distant mountains in the background.", "duration": 6, "resolution": "768p", "prompt_optimizer": true, "first_frame_image": "https://segmind-resources.s3.amazonaws.com/output/29539533-f96d-4d18-ad41-71a17f06d160-44c1380a-3513-40b6-b085-bc2cd3cc5477.png" } 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/hailuo-2.3'; const data = { "prompt": "A young woman in yoga attire balances gracefully in tree pose on a rock by a serene lake, surrounded by wildflowers and soft morning light. She slowly shifts her arms overhead, transitions through gentle stretches and flows, framed by sun rays filtering through the tree, with calm water and distant mountains in the background.", "duration": 6, "resolution": "768p", "prompt_optimizer": true, "first_frame_image": "https://segmind-resources.s3.amazonaws.com/output/29539533-f96d-4d18-ad41-71a17f06d160-44c1380a-3513-40b6-b085-bc2cd3cc5477.png" }; 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/hailuo-2.3) - [API Documentation](https://www.segmind.com/models/hailuo-2.3/api) - [Pricing Details](https://www.segmind.com/models/hailuo-2.3/pricing) - [Platform Documentation](https://docs.segmind.com/) ### Tags No tags available