Grok Video API Documentation
Grok Video API is a developer-facing AI video generation interface that supports generating high-quality videos through text prompts, reference images, keyframe control, and other methods. Through TTAPI unified gateway, you can stably access the latest Grok models (including grok-imagine-video-1.5-fast, grok-imagine-video-1.5, grok-imagine-video-1.5-lite).Quick Start
- Text to Video API — Generate videos from pure text
- First Frame to Video API — Specify video start frame
- Last Frame to Video API — Specify video end frame
- First & Last Frame to Video API — Specify both start and end frames
- Keyframe to Video API — Insert keyframes in the middle of video
- Reference to Video API — Use reference images and voice roles
- Fetch API (Get Results) — Poll async task results
- Video Pricing
Core Features
🎬 AI Video Generation
Generate high-quality videos from text prompts using the latest Grok models, with support for various duration ranges and resolution options.⚡ Async Workflow
Submit generation tasks asynchronously and retrieve results via polling or webhook callbacks, suitable for production environment integration.🎯 Precise Keyframe Control
Specify keyframe images in the middle of the video through thekeyframes parameter, which can be combined with first_frame and last_frame. Each request supports up to 4 keyframes.
️ First/Last Frame Locking
Strictly specify the start and end images of the video throughfirst_frame and last_frame. When the same image is passed to both, it creates a loop effect.
Reference Images & Voice Roles
Pass reference images (up to 7) throughrefer_images, or pass voice roles through reference_audios to control character voice characteristics in the video.
Model Differences
Notes:
grok-imagine-video-1.5-fastandgrok-imagine-video-1.5support all advanced control featuresgrok-imagine-video-1.5-liteis a lightweight model, only supports basic text-to-video functionality
Authentication & Base URL
For complete setup instructions, see Gateway & Auth.
End-to-End Example
Step 1 — Submit Generation Request
Step 2 — Save jobId
Step 3 — Get Generation Result
videoUrl and other complete information after task completion.
All Endpoints
Common Workflows
Why Choose TTAPI
- Unified Gateway — Access Grok and other AI models with a single API Key
- Latest Model Support — Always support the latest Grok versions
- Standardized Async Workflow — Consistent task submission, fetch polling, and webhook callback patterns
- Clear Documentation — Separate overview guide from endpoint references
- Unified Billing — Unified quota management across all AI APIs
FAQ
Which Grok model should I use?
- grok-imagine-video-1.5-fast: Suitable for fast generation scenarios requiring advanced controls (keyframes, first/last frames), supports longer input text
- grok-imagine-video-1.5: Standard quality, balances speed and quality, supports all advanced features
- grok-imagine-video-1.5-lite: Lightweight, cost-effective, only supports basic text-to-video
How do I control first and last frames?
Use the First & Last Frame to Video API, passing bothfirst_frame and last_frame parameters. When both are set to the same image, it creates a loop effect.
How do I insert keyframes in the middle of a video?
Use the Keyframe to Video API, passing a keyframe array through thekeyframes parameter. Each keyframe contains image_url and timestamp_s (timestamp). Each request supports up to 4 keyframes.
How do I use reference images or voice roles?
Use the Reference to Video API, passing reference images (up to 7) throughrefer_images, or passing voice roles through reference_audios.
How do I check task status?
Use the Fetch API withjobId to poll status. While processing, status returns ON_QUEUE; after completion, status returns SUCCESS with complete video URL in the response.
Does Grok Video API support Webhook?
Yes. PasshookUrl when submitting any Grok task, and TTAPI will POST the result to your endpoint after task completion, eliminating the need for polling.