Videogenerierung
Verwende CometAPI POST /grok/v1/videos/generations, um mit Grok Videos zu erstellen, ein Eingabebild per Prompt zu animieren und Ergebnisse über request_id abzufragen.
Verwende diesen Endpoint, um einen Grok-Videojob aus Text oder aus Text plus einem Quellbild zu starten. Er gibt sofort eineDocumentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
request_id zurück, daher solltest du ihn als ersten Schritt in einem asynchronen Workflow behandeln.
Mit einer kleinen Anfrage beginnen
- Verwende
model: grok-imagine-video - Behalte für eine erste Anfrage
durationauf1undresolutionauf480p - Füge
image.urlnur hinzu, wenn du image-to-video möchtest - Wenn du base64 sendest, behalte die Form in den Docs und im OpenAPI-Beispiel als
data:image/png;base64,<BASE64_IMAGE_DATA>bei
Aufgabenablauf
Auf Abschluss prüfen
done wird.Autorisierungen
Bearer token authentication. Use your CometAPI key.
Body
Prompt for the video job.
"A candle flickers on a wooden table."
Output aspect ratio.
1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3 Output duration in seconds. xAI documents a range of 1 to 15 seconds.
Optional source image for image-to-video.
xAI video model id.
"grok-imagine-video"
Output resolution.
480p, 720p Deprecated size field. Prefer aspect_ratio and resolution.
Optional end-user identifier.
Antwort
Request accepted.
Deferred request id used for polling.