xAI API: Grok Imagine Video, Image and Voice in One Key
Grok Imagine video, Grok Imagine Image 2.0, Grok TTS and xAI Speech to Text behind one key. Which model does which job, the parameters that matter, copy-ready requests and a five-step ad pipeline.
By Eftal Yurtseven · Dec 3, 2026 · 8 min read

Most teams who go looking for the xAI API want one thing, and then they find out they need four. The video model gets the attention. Then the clip needs a voiceover, the voiceover needs a transcript for captions, and the product shot that started it all needs an edit before anyone animates it. Suddenly "add Grok" means four integrations, four request formats and four places where a job can quietly fail.
This guide treats the xAI API as what it actually is in 2026: a family. On each::labs that family is Grok Imagine for video and images, plus Grok TTS and xAI Speech to Text for audio, all behind one key and one prediction endpoint. Below you'll find which model does which job, the parameters that matter, working requests and a pipeline that chains them.
What the xAI API Covers Today
Think of it as three lanes. The video lane is Grok Imagine Video: text to video, image to video, reference to video, edit video and extend video, plus the faster Grok Imagine Video 1.5 Lite for text and image input. The image lane is Grok Imagine Image 2.0, with a text-to-image model and an edit model. The audio lane is Grok TTS for speech and xAI Speech to Text for transcripts.
xAI announced the standalone speech APIs on April 17, 2026, in its Grok STT and TTS launch post, which describes word-level timestamps, speaker diarization and multichannel support for transcription, and inline tags for laughter, whispers and pauses in speech. The video and image models arrived earlier through the Grok Imagine line. What changes when you run them on each::labs is not the models. It's the plumbing.
Every model above takes the same request shape: a model slug and an input object, posted to one endpoint, answered with a prediction ID. Learn it once and the whole family opens up.

Your First xAI API Call on each::labs
Here's a text-to-video request. Swap the slug and the input fields, and the same call runs every other model in this post.
curl -X POST https://api.eachlabs.ai/v1/prediction \
-H "X-API-Key: $EACHLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "xai-grok-imagine-text-to-video",
"input": {
"prompt": "A street food cook flips noodles in a wok at night, flames lick the pan, steam drifts through neon light, handheld camera slowly pushes in",
"duration": 8,
"aspect_ratio": "9:16",
"resolution": "720p",
"generate_audio": true
}
}'The response carries a predictionID. Poll GET /v1/prediction/{id} until the status is final, or pass a webhook_url in the request body and let the result come to you. Use the webhook in production. Video generation time varies with length and resolution, and a backend that blocks a worker while it waits will fall over the first busy afternoon.
One habit saves hours: log the full input object next to the prediction ID. When a clip comes back wrong, you want to know exactly what you asked for, not what you think you asked for.

Pick the Right Grok Imagine Video Model
Five video endpoints sounds like a lot until you map them to jobs. They split by what you hand the model, not by quality tier.
Text to video and image to video
Text to video takes a prompt and returns a clip of 1 to 15 seconds at 480p or 720p in seven aspect ratios, from 16:9 to 9:16, with an audio track on by default. Image to video takes the same controls plus an image_url, and its auto aspect ratio keeps your source image's frame. If you already have an approved still (a product shot, a character design, a storyboard frame), start here. A picture pins down what a paragraph can only hope for.
Reference to video
Reference to video accepts one to seven images as style and content guides and a prompt of up to 4,096 characters. It's the model for "this character, this jacket, this room, new scene". You're not animating one picture. You're casting from several.
Edit video and extend video
Edit video changes an existing clip from a text instruction. The source can be up to 8.7 seconds and output is capped at 720p, so trim before you send. Extend video continues a 2 to 15 second MP4 by another 2 to 10 seconds, guided by a prompt that says what happens next. Together they turn one good take into a sequence without regenerating the part you already like. We wrote a full walkthrough of the edit model in Grok Imagine Video Edit: Change One Thing, Keep the Take.
Grok Imagine Video 1.5 Lite
The 1.5 Lite models cover text and image input with the same 1 to 15 second range, default to 480p and are the only Grok video endpoints here that offer 1080p. Use them for drafts: test ten prompts at 480p, keep the two that work, render those properly.
Write Prompts the xAI API Can Act On
The parameters are the easy part. The prompt decides whether the clip is usable. Grok Imagine responds best to a shot, not a story: who is in frame, what they do, where the camera is and what you should hear. Three examples you can paste straight into the prompt field:
A ceramicist pulls a wet clay bowl off the wheel and turns it toward the camera, late afternoon window light, slow dolly in, soft room tone and the hum of the wheel winding down.
Low angle on a skateboarder dropping into an empty concrete pool at dusk, camera follows the board, wheels roar on concrete, one sharp clack as the tail hits the lip.
Overhead shot of hands plating a dessert on a black slate, a spoon drags a line of raspberry sauce, the camera holds still, quiet kitchen ambience.
Notice what's missing: adjectives about quality. "Cinematic, 8K, masterpiece" tells the model nothing it can act on. "Slow dolly in" does. If you want a larger library, our X AI Video Prompts post has ten more clips to copy, sorted by shot type.
For edits, ask for one change at a time. "Make the jacket red" works. "Make the jacket red, add rain and move the camera left" gives you three half-changes and no way to tell which one broke.

Images and Edits With Grok Imagine Image 2.0
Video is only as good as its first frame, which is why the image models belong in the same integration. Grok Imagine Image 2.0 text to image returns 1 to 10 images per request at 1k or 2k, in aspect ratios that include phone-native 19.5:9 and 9:19.5, as JPEG, PNG or WebP. The edit model takes either one source image or up to three, and in multi-image edits you refer to inputs as <IMAGE_0>, <IMAGE_1> and so on:
{
"model": "xai-grok-imagine-2-0-image-edit",
"input": {
"image_urls": ["https://.../sneaker.png", "https://.../street.jpg"],
"prompt": "Place the sneaker from <IMAGE_0> on the wet curb in <IMAGE_1>, keep its colors and laces exactly, match the evening light",
"aspect_ratio": "9:16",
"resolution": "2k"
}
}Ask for four outputs with num_images, pick the best one and hand its URL to image to video. That two-step habit gives you a far higher hit rate than asking a video model to invent the product and animate it in one go. Our Grok Imagine 2.0 deep dive covers the editing behavior in more detail.
Add Voice and Transcripts to the Same Pipeline
Grok TTS turns up to 15,000 characters into speech with five voices (eve, ara, rex, sal and leo), more than twenty languages and inline tags such as [pause] and [laugh]. Output comes as MP3, WAV, PCM, mu-law or A-law, at sample rates from 8,000 Hz for telephony to 48,000 Hz for post-production. The text and language fields are required, and auto is a valid language. Stage directions are where this model earns its place, which is why we gave them their own post: Grok TTS: Text to Speech That Takes Stage Directions.
{
"model": "xai-grok-tts-text-to-speech",
"input": {
"text": "Fresh noodles, every night. [pause] Come hungry. [chuckle]",
"language": "en",
"voice_id": "rex",
"output_format": "wav"
}
}xAI Speech to Text goes the other way. It takes an audio or video file up to 500 MB (WAV, MP3, OGG, Opus, FLAC, AAC, MP4, M4A or MKV), covers 25 languages, and can tag each word with a speaker when you set diarize to true. Its format option turns spoken numbers into written ones, so "one hundred" comes back as "100", but it needs a specific language rather than auto. For stereo call recordings with one speaker per channel, set multichannel instead and each channel comes back on its own.

Chain the xAI API Into One Workflow
Here's where one key pays off. A short product ad can run end to end through the xAI API without leaving each::labs:
First, generate or edit the hero still with Grok Imagine Image 2.0. Second, animate it with image to video, 6 to 8 seconds, audio on. Third, if the shot needs another beat, extend it with a prompt for the next action. Fourth, write the voiceover and render it with Grok TTS. Fifth, run the final cut through Speech to Text with word timestamps and turn them into captions.
Each step's output URL is the next step's input, so the orchestration is a handful of lines in any backend. If you'd rather not write it at all, build the chain visually in each::labs Flows and call the flow as one endpoint. You can also drop a model from another family into any step: a different video model for one shot, a different voice for one language. That flexibility is the real argument for running xAI through a shared API instead of wiring each model by hand.
Frequently Asked Questions
Is there one xAI API key for video, images and voice?
On each::labs, yes. One each::labs key runs every Grok Imagine video and image model, Grok TTS and xAI Speech to Text, with the same request format for all of them. Only the model slug and the input fields change.
Can Grok edit videos through the API?
It can, with the Grok Imagine edit video model. Send a clip of up to 8.7 seconds and a text instruction, and it returns an edited version at up to 720p. For a longer sequence, edit the part that matters and use extend video to continue it.
How long can a Grok Imagine video be?
A single generation runs 1 to 15 seconds on text to video, image to video and the 1.5 Lite models. Extend video adds 2 to 10 seconds to an existing clip, so longer shots come from chaining calls rather than one huge request.
Does the xAI API generate audio with video?
Text to video, image to video and 1.5 Lite all have a generate_audio option that is on by default, so clips come back with a soundtrack. For narration with a specific voice and timing, render it separately with Grok TTS and mix it in.



