# Veo 3.1 API Complete API reference for Veo 3.1 video generation models. ## Model Variants This API supports four model variants: | Model | ID | Speed | Description | |-------|-----|-------|-------------| | **Veo 3.1 Text to Video** | `veo3.1-text-to-video` | Standard | High-quality text-to-video generation | | **Veo 3.1 Image to Video** | `veo3.1-image-to-video` | Standard | High-quality image-to-video generation | | **Veo 3.1 Fast Text to Video** | `veo3.1-fast-text-to-video` | Fast | Faster text-to-video generation | | **Veo 3.1 Fast Image to Video** | `veo3.1-fast-image-to-video` | Fast | Faster image-to-video generation | ## Quick Comparison | Feature | Standard | Fast | |---------|----------|------| | Generation Speed | ~2-3 minutes | ~1-2 minutes | | Quality | Highest | High | | Aspect Ratios | 16:9, 9:16 | 16:9, 9:16 | | Feature | Text to Video | Image to Video | |---------|---------------|----------------| | Input | Text prompt | Image + Text prompt | | Start Frame | Not supported | Optional | | End Frame | Not supported | Optional | | Audio | Not supported | Not supported | ## Veo 3.1 Text to Video (Standard & Fast) ### Endpoint ``` POST /api/v1/video/task ``` ### Request Parameters #### Required | Parameter | Type | Description | |-----------|------|-------------| | `model_name` | string | `"veo3.1-text-to-video"` or `"veo3.1-fast-text-to-video"` | | `prompt` | string | Video generation prompt | #### Optional | Parameter | Type | Description | |-----------|------|-------------| | `aspect_ratio` | string | Video aspect ratio: `"16:9"` or `"9:16"` | ### Example Request **Standard Version:** ```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: 'veo3.1-text-to-video', prompt: 'A time-lapse of a flower blooming' }) }); const { data } = await response.json(); const taskId = data.task_id; ``` **Fast Version:** ```javascript { model_name: 'veo3.1-fast-text-to-video', prompt: 'A time-lapse of a flower blooming' } ``` ## Veo 3.1 Image to Video (Standard & Fast) ### Request Parameters #### Required | Parameter | Type | Description | |-----------|------|-------------| | `model_name` | string | `"veo3.1-image-to-video"` or `"veo3.1-fast-image-to-video"` | | `prompt` | string | Video generation prompt | #### Optional | Parameter | Type | Description | |-----------|------|-------------| | `aspect_ratio` | string | Video aspect ratio: `"16:9"` or `"9:16"` | | `image_url` | string | Optional start frame image URL | | `image_end_url` | string | The last frame of the video | ### Example Request **Standard Version:** ```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: 'veo3.1-image-to-video', image_url: 'https://example.com/image.jpg', prompt: 'Camera slowly zooms in, soft wind movement' }) }); const { data } = await response.json(); const taskId = data.task_id; ``` **Fast Version:** ```javascript { model_name: 'veo3.1-fast-image-to-video', image_url: 'https://example.com/image.jpg', prompt: 'Camera slowly zooms in, soft wind movement' } ``` ## Response Format ### Initial Response ```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 `/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 - **Standard Version**: ~2-3 minutes - **Fast Version**: ~1-2 minutes Use polling to check generation status every 5-10 seconds. ## Best Practices - Be specific about camera movements and scene dynamics - Fast version offers good quality with faster processing - Standard version provides highest quality output - Use descriptive prompts for better results