# Grok Imagine Video 1.5 API Vollständige API-Referenz für Grok Imagine Video 1.5 Generierungsmodelle von xAI. ## Modellvarianten Diese API unterstützt eine Modellvariante: | Modell | ID | Beschreibung | |-------|-----|-------------| | **Grok Imagine 1.5 Image to Video** | `grok-imagine-v1.5-image-to-video` | Referenzbildgesteuerte Videoanimation | ### Unterstützte Seitenverhältnisse | Verhältnis | Beschreibung | |-------|-------------| | `2:3` | Hochformat | | `3:2` | Querformat | | `1:1` | Quadrat | | `16:9` | Querformat (Widescreen) | | `9:16` | Hochformat (vertikal) | | `3:4` | Standard-Hochformat | | `4:3` | Standard-Querformat | ### Auflösungsoptionen | Auflösung | Beschreibung | |------------|-------------| | `480p` | Standardauflösung, schnellere Verarbeitung | | `720p` | Hohe Auflösung, ausgewogene Qualität und Geschwindigkeit | ## Grok Imagine 1.5 Image to Video ### Endpoint ``` POST /api/v1/video/task ``` ### Anfrageparameter #### Erforderlich | Parameter | Typ | Beschreibung | |-----------|------|-------------| | `model_name` | string | Muss `"grok-imagine-v1.5-image-to-video"` sein | | `image_url` | string | Referenzbild-URL für die Animationseingabe | | `prompt` | string | Prompt für die Videogenerierung | | `duration` | number | Videodauer in Sekunden (1-15) | | `resolution` | string | Abrechnungsauflösung: `"480p"` oder `"720p"` | #### Optional | Parameter | Typ | Beschreibung | |-----------|------|-------------| | `aspect_ratio` | string | Video-Seitenverhältnis: `"2:3"`, `"3:2"`, `"1:1"`, `"16:9"`, `"9:16"`, `"3:4"` oder `"4:3"` (Standard ist `"16:9"`) | ### Beispielanfrage ```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; ``` **Nur-Body-Beispiel:** ```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' } ``` ## Antwortformat ### Erste Antwort Gibt eine `task_id` für das Polling zurück: ```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-Antwort Frage `GET /api/v1/video/{taskId}` per Polling ab, um den Status zu prüfen: ```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" } ] } } } ``` ### Statuswerte - `submitted`: Aufgabe akzeptiert und wartet auf Verarbeitung - `processing`: Videogenerierung läuft - `succeed`: Videogenerierung abgeschlossen - `failed`: Videogenerierung fehlgeschlagen ## Verarbeitungszeit Typische Verarbeitungszeit: 2-5 Minuten. ## Best Practices 1. **Bewegungsbeschreibung**: Nimm Kamerabewegung und Motivbewegung in Prompts auf 2. **Bildqualität**: Verwende hochwertige Eingabebilder für bessere Animationsergebnisse 3. **Seitenverhältnis**: Passe `aspect_ratio` vor dem Absenden an dein Zielausgabeformat an