Grok Video Generation API: Grok Imagine 1.0 & 1.5 Guide
You need AI video generation in your app but Veo 3.1 Lite's per-second pricing adds up too quickly for short clips, and the flat-rate options don't give you image-to-video support. xAI's Grok Imagine models — available on GenRelay — cover both cases: Grok Imagine 1.0 at $0.010/s for text-to-video, and Grok Imagine 1.5 at $0.022/s with image-to-video capability. This guide covers authentication, request structure, polling, and a clear decision framework for choosing between the two.
What Is Grok Imagine?
Grok Imagine is xAI's video generation model family, accessible through GenRelay's unified generative media API. As of August 2026, two versions are available:
- Grok Imagine 1.0 — text-to-video (t2v). Takes a text prompt and generates a video clip. Priced at $0.010 per second of output, making it the most affordable per-second video model on GenRelay.
- Grok Imagine 1.5 — adds image-to-video (i2v). You supply an input image and a text prompt; the model generates a video that animates or extends the visual content of that image. Priced at $0.022 per second.
Both models use the same GenRelay endpoint and authentication. Switching between them is a single "model" parameter change.
How Do I Authenticate with the Grok Video API?
GenRelay uses a standard HTTP Bearer token for authentication — the same key works across all models on the platform. Get your key from the GenRelay console under API Keys, then include it in every request:
Authorization: Bearer YOUR_GENRELAY_KEY
No xAI account or separate Grok credentials required. GenRelay handles upstream authentication.
How Do I Generate a Video with Grok Imagine 1.0?
Video generation on GenRelay is asynchronous: you submit a job, receive a job ID, then poll until the job completes. Here's a complete Python example for Grok Imagine 1.0 text-to-video:
import time
import requests
API_KEY = "YOUR_GENRELAY_KEY"
BASE_URL = "https://genrelay.ai/v1"
def generate_video_grok(prompt: str, duration: int = 5) -> str:
"""Submit a Grok Imagine 1.0 video job and return the output URL."""
# Step 1: Submit the generation job
resp = requests.post(
f"{BASE_URL}/videos/generations",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
json={
"model": "grok-imagine-1-0",
"prompt": prompt,
"duration": duration, # seconds of output video
},
timeout=30,
)
resp.raise_for_status()
job_id = resp.json()["id"]
print(f"Job submitted: {job_id} (expected cost: ${duration * 0.010:.3f})")
# Step 2: Poll for completion
poll_url = f"{BASE_URL}/videos/jobs/{job_id}"
while True:
status_resp = requests.get(
poll_url,
headers={"Authorization": f"Bearer {API_KEY}"},
timeout=15,
)
status_resp.raise_for_status()
job = status_resp.json()
if job["status"] == "succeeded":
return job["output"]["url"]
elif job["status"] == "failed":
raise RuntimeError(f"Job failed: {job.get('error', 'unknown')}")
print(f"Status: {job['status']} — waiting 5s...")
time.sleep(5)
# Usage: 4-second clip at $0.040 total
video_url = generate_video_grok(
"A close-up of coffee being poured into a white cup, slow motion, warm lighting, cinematic",
duration=4,
)
print(f"Video ready: {video_url}")
Cost at $0.010/s is easy to reason about: a 5-second clip costs $0.050, a 10-second clip costs $0.100. At these rates, Grok 1.0 is the most affordable option on GenRelay for short text-to-video clips.
How Do I Use Grok Imagine 1.5 for Image-to-Video?
Grok Imagine 1.5 adds an image_url parameter. Supply a publicly accessible image URL and the model animates or extends that image into a video clip based on your prompt:
def generate_image_to_video(image_url: str, prompt: str, duration: int = 4) -> str:
"""Submit a Grok Imagine 1.5 image-to-video job."""
resp = requests.post(
f"{BASE_URL}/videos/generations",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
json={
"model": "grok-imagine-1-5",
"prompt": prompt,
"image_url": image_url, # publicly accessible URL
"duration": duration,
},
timeout=30,
)
resp.raise_for_status()
job_id = resp.json()["id"]
print(f"i2v job submitted: {job_id} (expected cost: ${duration * 0.022:.3f})")
# Polling loop identical to Grok 1.0
poll_url = f"{BASE_URL}/videos/jobs/{job_id}"
while True:
status_resp = requests.get(
poll_url,
headers={"Authorization": f"Bearer {API_KEY}"},
timeout=15,
)
status_resp.raise_for_status()
job = status_resp.json()
if job["status"] == "succeeded":
return job["output"]["url"]
elif job["status"] == "failed":
raise RuntimeError(f"Job failed: {job.get('error', 'unknown')}")
print(f"Status: {job['status']} — waiting 5s...")
time.sleep(5)
# Example: animate a product photo
video_url = generate_image_to_video(
image_url="https://your-cdn.com/product-photo.jpg",
prompt="The product slowly rotates 360 degrees, subtle ambient lighting, clean white background",
duration=6,
)
print(f"i2v video ready: {video_url}")
The image_url must be publicly accessible at request time — the GenRelay backend fetches the image during generation. For private assets, upload to a temporary CDN URL or use a short-lived signed URL before passing it to the API.
What Parameters Do the Grok Models Accept?
| Parameter | Type | Grok 1.0 | Grok 1.5 | Notes |
|---|---|---|---|---|
model |
string | "grok-imagine-1-0" |
"grok-imagine-1-5" |
Required |
prompt |
string | Required | Required | Describe subject, motion, style, lighting |
duration |
integer | Optional | Optional | Seconds of output; affects billing |
image_url |
string | Not supported | Required | Publicly accessible URL for i2v input |
negative_prompt |
string | Optional | Optional | Elements to avoid in the output |
Writing effective prompts for Grok: Structure prompts as subject → action → visual style → camera. "A hummingbird hovering at a red flower, wings in slow motion, macro lens, shallow depth of field, golden hour light" produces more consistent output than a generic description. For image-to-video, your prompt should describe the motion you want rather than re-describing the image content — the model reads the visual input directly.
How Much Does the Grok Video API Cost?
Per-second pricing makes Grok cost transparent: multiply your clip duration by the per-second rate.
| Model | Per second | 4s clip | 8s clip | 15s clip |
|---|---|---|---|---|
| Grok Imagine 1.0 (t2v) | $0.010 | $0.040 | $0.080 | $0.150 |
| Grok Imagine 1.5 (i2v) | $0.022 | $0.088 | $0.176 | $0.330 |
| Veo 3.1 Lite (720p) | $0.060 | $0.240 | $0.480 | $0.900 |
| Gemini Omni Flash (720p) | $0.10 flat | $0.100 | $0.100 | $0.100 |
Grok 1.0 at $0.010/s is the lowest per-second rate on GenRelay. For clips under ~10 seconds, it undercuts Gemini Omni Flash's flat rate. Omni Flash's flat pricing becomes cost-advantageous at longer durations — a 15-second clip costs $0.150 on Grok 1.0 vs $0.100 on Omni Flash.
Monthly cost at scale — 10,000 clips/month at 5 seconds average:
| Model | Cost per clip | Monthly total |
|---|---|---|
| Grok Imagine 1.0 | $0.050 | $500 |
| Grok Imagine 1.5 | $0.110 | $1,100 |
| Gemini Omni Flash | $0.100 | $1,000 |
| Veo 3.1 Lite | $0.300 | $3,000 |
For a full pricing comparison between all video models, see the Gemini Omni Flash API guide which includes Omni Flash vs Veo 3.1 breakeven calculations.
When Should I Use Grok 1.0 vs Grok 1.5?
Choose Grok Imagine 1.0 when:
- Your input is text only — no source image exists
- Short clips (under 8 seconds) are your primary output format
- Cost minimization is the leading factor — $0.010/s has no lower-cost alternative on GenRelay
- Use cases: background animations, ambient loops, generic b-roll, concept visualizations
Choose Grok Imagine 1.5 when:
- You have a source image and want to animate it — product photos, character images, scene photographs
- Your use case depends on visual consistency with an input image (i2v preserves subject identity and scene composition better than a text prompt alone)
- Use cases: product reveal videos, avatar animation, still-photo to video for marketing, real estate walkthroughs from rendered images
The 2.2× price premium for Grok 1.5 over 1.0 reflects the i2v capability. If your pipeline doesn't require image input, there's no functional reason to pay the higher rate — use Grok 1.0.
For workflows requiring advanced motion control or reference-video support, see the Veo 3.1 API tutorial, which covers Veo's t2v, i2v, and ref2v modes.
Frequently Asked Questions
What video resolution do Grok models output?
Grok Imagine 1.0 and 1.5 output at a fixed resolution managed by the model. Unlike Gemini Omni Flash, there is no user-selectable resolution parameter — the model determines output dimensions. Check the GenRelay model page for current resolution details.
Does Grok Imagine 1.5 support text-to-video (t2v) in addition to image-to-video?
Grok Imagine 1.5 is primarily designed for image-to-video. For text-only prompts without an input image, use Grok Imagine 1.0.
How long does a Grok video generation job take?
Typical turnaround for a 5-second clip is 30–90 seconds. Image-to-video jobs via Grok 1.5 may take slightly longer due to image preprocessing. Plan your polling loop around 5-second intervals with a 5-minute timeout.
Are there rate limits on Grok video generation?
Rate limits depend on your GenRelay plan. Free tier includes limited credits and lower concurrent job capacity. Paid plans starting at $14/month support higher concurrency. Check the GenRelay console for your current limits.
Can I use Grok 1.5 with a local image file instead of a URL?
The API requires a publicly accessible URL. Upload your image to cloud storage (S3, GCS, Cloudinary, etc.) and pass the public URL in image_url. For temporary assets, use a signed URL with sufficient TTL for the generation to complete — typically 2–5 minutes.
Is billing by second or by generation for Grok models?
Grok Imagine 1.0 and 1.5 bill per second of output. A 6-second clip costs 6× the per-second rate. This differs from Gemini Omni Flash, which charges a flat per-generation fee regardless of clip length.
What happens if a Grok video job fails?
Failed jobs are not billed. The job status endpoint returns "failed" with an error description. Common failure causes include content policy violations (adjust your prompt) or image access errors for i2v jobs (verify the image URL is publicly accessible).
Summary
Grok Imagine 1.0 and 1.5 are available through GenRelay's unified video API at POST /v1/videos/generations. Grok 1.0 at $0.010/s is GenRelay's lowest-cost per-second video option — well-suited for short text-to-video clips. Grok 1.5 at $0.022/s adds image-to-video capability, useful for animating product photos, character images, or any still with a specific visual identity to preserve. Both share the same endpoint, authentication, and polling workflow — switching between them requires changing only the "model" parameter and adding image_url for 1.5.