xAI Imagine API for image and video generation
Generate and edit images and videos using Grok Imagine models with API access.
The Imagine API lets you generate and edit images and videos with Grok Imagine models. Use it for image generation, image editing with up to 5 reference images, video generation from text or still images, video editing, and more.
Image generation, image editing, video generation, video editing.
Image generation uses flat per-image pricing. Image edits are billed for both input and output images. Video generation uses per-second pricing affected by duration and resolution.
https://docs.x.ai/developers/model-capabilities/imagine
The xAI Imagine API allows developers to generate and edit images and videos using Grok Imagine models. It supports advanced features like multi-image editing and video animation from still images, with flexible pricing models for different media types.
- Imagine Overview ↗xAI · xAI Docs: Guides · Aug 27, 2026 · paraphrased
First seen on Subvolts Aug 27, 2026. Updated Sep 11, 2026. Spotted a problem? Tell us.
- Imagine OverviewxAI · xAI Docs: Guides · Aug 27, 2026
The Playbook: reusable how-tos, prompts, configs and tips pulled out of the news.
- Cost tipUnderstand Imagine API pricing for images and videosImage generation is flat per-image; edits cost for input and output; video is per-second. · 1 min
- HeuristicAdd imperfections for human-like AI videoIncorporate flaws like off-level framing to make AI-generated scenes feel more natural. · 5 min
- Code snippetGrok Imagine Video Reference Image UsageUsing reference images to guide character, product, and location generation in Grok Imagine videos. · 10 min
- HeuristicAnimate still images with text prompts for video generationUse a still image as the starting point for video generation with a text prompt. · 3 min
- HeuristicUse reference images for complex image editingLeverage up to 5 reference images to guide complex edits like style transfer or scene composition. · 5 min
- Code snippetEdit images using natural language with Grok Imagine APIAPI call pattern for editing an image with natural language instructions and reference images. · 3 min
Questions people ask
- Which AI tools does this work with?
- The sources used it with Grok.
- Where did this come from?
- xAI (xAI Docs: Guides). Subvolts collected, normalized and credited it; the link above opens the original.

