grok_text_to_video
Generate a video from a text prompt. Describe the scene, action, and style to produce a custom AI video.
Instructions
Generate AI video from a text prompt using Grok Imagine.
This creates a video from scratch based on your text description. Grok
Imagine will interpret your prompt and generate a matching video clip.
Use this when:
- You want to create a video from a text description
- You don't have a reference image to use
- You want maximum creative freedom
Only the 'grok-imagine-video' model supports text-to-video. For generating
a video from a reference image, use grok_image_to_video instead.
Returns:
Task ID and generated video information including URLs and state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Grok Imagine model. 'grok-imagine-video' (default) supports both text-to-video and image-to-video at a lower price. 'grok-imagine-video-1.5-preview' supports image-to-video ONLY and requires an image_url — do not use it here for text-to-video. | grok-imagine-video |
| prompt | Yes | Description of the video to generate. Be descriptive about scene, subject, action, camera movement, lighting, and style. Examples: 'A cinematic shot of a kitten chasing a butterfly in a sunlit garden', 'Drone shot flying over a neon-lit cyberpunk city at night'. Required for text-to-video with the 'grok-imagine-video' model. | |
| duration | No | Video duration in seconds (default 8). grok-imagine-video supports 1-30; grok-imagine-video-1.5-preview supports 1-15. | |
| resolution | No | Output resolution. '480p' (default, cheaper), '720p', or '1080p' (higher quality, costs more credits per second for grok-imagine-video-1.5-preview). | 480p |
| aspect_ratio | No | Video aspect ratio. '16:9' for landscape/widescreen, '9:16' for portrait/vertical, '1:1' for square, plus '4:3', '3:4', '3:2', '2:3'. | 16:9 |
| callback_url | No | Optional URL to receive a POST callback when generation completes. The callback will include the task_id and video results. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |