# Grok Imagine Video 1.5 API Complete API reference for Grok Imagine Video 1.5 generation models by xAI. ## Model Variants This API supports one model variant: | Model | ID | Description | |-------|-----|-------------| | **Grok Imagine 1.5 Image to Video** | `grok-imagine-v1.5-image-to-video` | Reference-image-guided video animation | ### Supported Aspect Ratios | Ratio | Description | |-------|-------------| | `2:3` | Portrait | | `3:2` | Landscape | | `1:1` | Square | | `16:9` | Landscape (widescreen) | | `9:16` | Portrait (vertical) | | `3:4` | Standard portrait | | `4:3` | Standard landscape | ### Resolution Options | Resolution | Description | |------------|-------------| | `480p` | Standard definition, faster processing | | `720p` | High definition, balanced quality and speed | ## Grok Imagine 1.5 Image to Video ### Endpoint ``` POST /api/v1/video/task ``` ### Request Parameters #### Required | Parameter | Type | Description | |-----------|------|-------------| | `model_name` | string | Must be `"grok-imagine-v1.5-image-to-video"` | | `image_url` | string | Reference image URL for the animation input | | `prompt` | string | Video generation prompt | | `duration` | number | Video duration in seconds (1-15) | | `resolution` | string | Billing resolution: `"480p"` or `"720p"` | #### Optional | Parameter | Type | Description | |-----------|------|-------------| | `aspect_ratio` | string | Video aspect ratio: `"2:3"`, `"3:2"`, `"1:1"`, `"16:9"`, `"9:16"`, `"3:4"`, or `"4:3"` (defaults to `"16:9"`) | ### Example Request ```javascript const response = await fetch('https://api.flaq.ai/api/v1/video/task', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ model_name: 'grok-imagine-v1.5-image-to-video', image_url: 'https://example.com/reference.jpg', prompt: 'Subtle camera motion, subject holds pose', aspect_ratio: '16:9', duration: 10, resolution: '720p' }) }); const { data } = await response.json(); const taskId = data.task_id; ``` **Body-only example:** ```javascript { model_name: 'grok-imagine-v1.5-image-to-video', image_url: 'https://example.com/reference.jpg', prompt: 'Subtle camera motion, subject holds pose', aspect_ratio: '16:9', duration: 10, resolution: '720p' } ``` ## Response Format ### Initial Response Returns a `task_id` for polling: ```json { "code": 0, "message": "success", "data": { "task_id": "{task_id}", "response_url": "https://api.flaq.ai/api/v1/video/{task_id}", "task_status": "submitted" } } ``` ### Polling Response Poll `GET /api/v1/video/{taskId}` to check status: ```json { "code": 0, "message": "success", "data": { "task_id": "{task_id}", "response_url": "https://api.flaq.ai/api/v1/video/{task_id}", "task_status": "succeed", "task_status_msg": null, "task_result": { "credit": 0.2, "videos": [ { "url": "https://example.com/generated-video.mp4" } ] } } } ``` ### Status Values - `submitted`: Task accepted and waiting to be processed - `processing`: Video generation in progress - `succeed`: Video generation completed - `failed`: Video generation failed ## Processing Time Typical processing time: 2-5 minutes. ## Best Practices 1. **Motion Description**: Include camera movement and subject motion in prompts 2. **Image Quality**: Use high-quality input images for better animation results 3. **Aspect Ratio**: Match `aspect_ratio` to your target output format before submitting