Grok Imagine 1.5 Image-to-Video API Guide — Animate Still Images
You have a high-quality product shot, a portrait, or a generated image — and you want it to move. Grok Imagine 1.5 is xAI's image-to-video model, accessible through GenRelay's API. Unlike text-to-video, i2v takes a still image as the first frame and generates a clip that logically extends from it. The model preserves your original visual — the subject, lighting, and composition — while adding motion according to your prompt.
This guide covers the full integration: submitting an i2v job, polling for the result, writing effective motion prompts, estimating cost, and deciding whether Grok Imagine 1.5 or Veo 3.1 i2v is the right fit.
What Is Grok Imagine 1.5 Image-to-Video?
Grok Imagine 1.5 is xAI's second-generation video model, with the Imagine 1.5 variant optimized for image-to-video (i2v) generation. Given a starting still image and a motion prompt, it produces a video clip — typically 5 or 8 seconds — where the scene in the image animates according to the prompt description.
As of September 2026, Grok Imagine 1.5 is available on GenRelay at $0.022 per second of generated video. Grok Imagine 1.0 (text-to-video) is $0.010/s; the 1.5 model's higher rate reflects its improved motion quality and subject fidelity for image-animated outputs.
How Do I Authenticate with the GenRelay Video API?
Authentication uses a Bearer token in the Authorization header — the same credential across all GenRelay image and video endpoints.
import requests
import base64
import time
import os
API_KEY = os.environ["GENRELAY_API_KEY"]
BASE_URL = "https://genrelay.ai/v1"
HEADERS = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
Your API key is available in the GenRelay console. Route all API calls through your backend — never expose the key client-side.
How Do I Submit a Grok Imagine 1.5 i2v Job?
Video generation is asynchronous. The API returns a job ID immediately; you poll a separate endpoint until the job status is succeeded. The submission payload passes the input image (as base64), the motion prompt, and the clip duration.
Step 1 — Encode the input image:
def encode_image(path: str) -> str:
with open(path, "rb") as f:
return base64.b64encode(f.read()).decode("utf-8")
input_image_b64 = encode_image("product_shot.jpg")
JPEG and PNG both work. Keep the input image under 10MB; resize to 1920px on the longest side if you're starting from a high-resolution source.
Step 2 — Submit the job:
def submit_i2v_job(image_b64: str, prompt: str, duration: int = 5) -> str:
payload = {
"model": "grok-imagine-1.5",
"image": image_b64,
"prompt": prompt,
"duration": duration # 5 or 8 seconds
}
resp = requests.post(
f"{BASE_URL}/videos/generations",
headers=HEADERS,
json=payload
)
resp.raise_for_status()
job = resp.json()
print(f"Job submitted: {job['id']}")
return job["id"]
job_id = submit_i2v_job(
input_image_b64,
"The bottle slowly rotates 360 degrees, catching warm studio light as it turns.",
duration=5
)
The duration parameter controls clip length. 5 and 8 are the supported values. A 5-second clip at $0.022/s costs $0.110; 8 seconds costs $0.176.
How Do I Poll for the Video Result?
Grok Imagine 1.5 i2v jobs complete in roughly 60–120 seconds. Poll every 10 seconds to avoid unnecessary API calls while staying responsive.
def poll_job(job_id: str, interval: int = 10, timeout: int = 300) -> dict:
deadline = time.time() + timeout
while time.time() < deadline:
resp = requests.get(
f"{BASE_URL}/videos/generations/{job_id}",
headers=HEADERS
)
resp.raise_for_status()
job = resp.json()
status = job.get("status")
print(f" [{job_id[:8]}] status={status}")
if status == "succeeded":
return job
if status == "failed":
raise RuntimeError(f"Job failed: {job.get('error', 'unknown error')}")
time.sleep(interval)
raise TimeoutError(f"Job {job_id} timed out after {timeout}s")
result = poll_job(job_id)
video_url = result["output"]["url"]
print(f"Video ready: {video_url}")
Download and persist the output:
def download_video(url: str, path: str) -> None:
data = requests.get(url, timeout=60).content
with open(path, "wb") as f:
f.write(data)
print(f"Saved: {path}")
download_video(video_url, "output_animated.mp4")
Output URLs have a limited validity window — download to your own storage (S3, GCS, or a CDN) immediately after job completion. Do not serve the GenRelay URL directly to end users.
How Do I Write Effective Motion Prompts for Grok 1.5 i2v?
The motion prompt describes what happens in the clip, starting from the input image as frame one. Because the model already knows the scene from the image, your prompt should focus exclusively on motion — not on re-describing the subject or setting.
Motion prompt patterns by scene type:
| Scene type | Prompt pattern | Example |
|---|---|---|
| Product rotation | Object rotation + lighting callout | "The sneaker slowly rotates 180 degrees, light glinting off the midsole" |
| Portrait animation | Subtle head or eye movement | "A gentle breeze moves the subject's hair; eyes track slightly left and back" |
| Landscape reveal | Camera push or orbit | "Slow cinematic push forward into the scene; depth-of-field gradually sharpens" |
| Food presentation | Texture and steam cues | "Steam rises from the coffee cup surface; a slow ripple spreads from the center" |
| Architecture exterior | Drone-style orbit | "The camera orbits clockwise around the building, rising slightly as it turns" |
Prompting principles:
- Focus on motion, not description. The model reads the image; your prompt guides movement, not scene setup.
- 1–2 sentences is enough. Longer prompts don't reliably produce more adherent motion.
- Avoid scene changes. i2v performs best when the first frame remains coherent throughout. Prompts requesting a new location or dramatic object transformation produce artifacts.
- Name the speed. "Slowly", "gradually", and "at a steady pace" help calibrate motion intensity versus "quickly" or "abruptly".
What Does Grok Imagine 1.5 i2v Cost?
Grok Imagine 1.5 is billed at $0.022 per second of generated video. No per-request fee; no resolution tier — the rate is flat regardless of output resolution.
| Duration | Cost per clip |
|---|---|
| 5 seconds | $0.110 |
| 8 seconds | $0.176 |
Workload math — 200 product animations per day:
- 200 × 5s clips: 200 × $0.110 = $22.00/day (~$660/month)
- 200 × 8s clips: 200 × $0.176 = $35.20/day (~$1,056/month)
For comparison: Veo 3.1 Lite starts at $0.060/s for 720p and reaches $0.180/s for 4K. For i2v use cases where HD output at Grok 1.5's quality level is sufficient, $0.022/s represents meaningful cost efficiency at scale.
Grok Imagine 1.5 i2v vs Veo 3.1 i2v — Which Should You Use?
Both models support image-to-video, but they address different production requirements.
| Dimension | Grok Imagine 1.5 | Veo 3.1 i2v |
|---|---|---|
| Price | $0.022/s | $0.060/s (720p Lite) – $0.180/s (4K) |
| Max resolution | Up to 1080p | Up to 4K |
| Typical job time | 60–120 seconds | 90–180 seconds |
| Motion fidelity | Smooth, subject-faithful | High-detail, cinematic |
| Native audio generation | No | Yes (Veo 3.1 supports audio) |
| Best for | Product rotation, portrait animation, cost-efficient i2v at scale | Cinematic i2v, 4K output, productions requiring native audio |
Verdict: If your workflow needs 4K, native audio, or cinematic production quality — Veo 3.1 i2v is the stronger model. If you're animating product images at scale and want to keep per-clip costs under $0.20, Grok Imagine 1.5 delivers consistent results for a fraction of Veo 3.1's premium tiers.
See the Veo 3.1 image-to-video API guide for the full Veo 3.1 i2v integration walkthrough and motion prompt reference.
FAQ
Does Grok Imagine 1.5 support text-to-video as well?
No. Grok Imagine 1.5 is i2v only — it requires an input image. For text-to-video, use Grok Imagine 1.0 at $0.010/s, Veo 3.1 Lite, or Gemini Omni Flash. All are accessible on the same GenRelay endpoint by changing the model parameter.
What image formats does the endpoint accept?
JPEG, PNG, and WebP are supported. Input images should be at least 512px on the shortest side for reliable motion quality. Images below 512px may produce low-fidelity or jittery output.
Can I control camera movement separately from subject motion?
Not through separate parameters — the motion prompt drives both subject and camera behavior together. To emphasize camera movement, include camera language ("slow dolly forward", "gentle pan right"). To keep the camera static while the subject moves, focus the prompt solely on subject motion and omit camera direction.
What causes a job to fail?
Common failure causes: input image exceeds 10MB, unsupported content (flagged by content policy), or malformed base64 encoding. Check the error field in the failed job response for the specific reason. Retry with a smaller or reformatted image; implement exponential backoff if you encounter consecutive failures.
Is there a webhook option instead of polling?
Yes. GenRelay supports webhook callbacks for async video jobs — configure a callback URL in your request to receive a POST notification when the job completes instead of polling. See the webhook guide for async video jobs for setup and payload schema.
Summary
Grok Imagine 1.5 gives developers a cost-efficient path to image-to-video at $0.022/s — submit a still image, write a motion-focused prompt, poll for the result, download the clip. The full Python integration above covers job submission, status polling, output download, and error handling in under 50 lines.
For higher resolution or audio-enabled i2v, Veo 3.1 is the alternative on GenRelay. For lower-cost text-to-video without an input image, Grok Imagine 1.0 at $0.010/s uses the same endpoint — just change "model": "grok-imagine-1.0" and remove the image field.