Models/Grok Imagine/Image & Video API
Live9 endpoints

Grok Imagine API — xAI Image & Video Generation

The Grok Imagine API gives you programmatic access to xAI's Grok Imagine model family — text-to-image, image-to-image, text-to-video, image-to-video, video extension, and Grok Imagine Image 2.0's precise generation and chained follow-up editing, all through one Muapi API key, from $0.05 per call.

🖼️ Image GenerationText-to-image, including Image 2.0's sharp typography and layout planning3 models
Text to ImageLive
🖼️ Image Generation

Grok Imagine Text to Image

High-quality text-to-image generation with vivid scenes, characters, and strong lighting. Returns 6 images per call.

ImageFast
$0.05/call
Try Model
Text to ImageLive
🖼️ Image Generation

Grok Imagine Text to Image (Quality)

High-fidelity text-to-image mode prioritizing accuracy and detail over speed, with sharper lighting and depth.

High-fidelity
$0.05/call
Try Model
Text to ImageNew
🖼️ Image Generation

Grok Imagine Image 2.0

xAI's next-generation image model with precise instruction-following, sharp typography, and multi-reference editing across up to 5 input images.

Up to 5 ref imagesFast
$0.05/call
Try Model
✏️ Image EditingInstruction-based image edits and Image 2.0 chained follow-up edits2 models
Image to ImageLive
✏️ Image Editing

Grok Imagine Image to Image

Edit an existing image with natural-language instructions while preserving scene structure, perspective, and lighting.

NativeFast
$0.05/call
Try Model
Image to ImageNew
✏️ Image Editing

Grok Imagine Image 2.0 Edit

Apply a targeted follow-up edit to a prior Image 2.0 generation, optionally scoped with mask_indexs, while preserving the rest of the image.

NativeFast
$0.05/call
Try Model
🎬 Video GenerationText-to-video, image-to-video, a preview video model, and video extension4 models
Text to VideoLive
🎬 Video Generation

Grok Imagine Text to Video

Fast text-to-video generation with synchronized ambient audio, smooth motion, and expressive lighting, from 6 to 30 seconds.

6–30sFast
$0.15/call
Try Model
Image to VideoLive
🎬 Video Generation

Grok Imagine Image to Video

Animate a still image into cinematic video with synchronized ambient audio and fluid, realistic motion, from 6 to 30 seconds.

6–30sFast
$0.15/call
Try Model
Image to VideoPreview
🎬 Video Generation

Grok Imagine Video 1.5 Preview

Preview of Grok Imagine's next video model with multiple aspect ratios and resolutions, up to 15 seconds.

Up to 15s
$0.64/call
Try Model
EditLive
🎬 Video Generation

Grok Imagine Extend

Continue an existing Grok Imagine video generation while maintaining visual style and motion.

NativeFast
$0.05/call
Try Model

What is the Grok Imagine API?

The Grok Imagine API gives applications programmatic access to xAI's Grok Imagine model family. Generate images and video from a text prompt, edit an existing image with natural-language instructions, or animate a still image into a cinematic clip with synchronized ambient audio.

Muapi exposes the complete Grok Imagine endpoint catalogue through one REST API. Use the image and video playgrounds to compare endpoints, then combine generation, editing, and video extension in your own workflow.

Key Capabilities

Text-to-Image Generation

Turn a prompt into vivid, stylish images, with a dedicated high-fidelity Quality mode and 6 images per call.

Precise Instruction-Following

Image 2.0 follows detailed prompts down to fine layout and typography, ideal for posters and dense compositions.

Natural-Language Image Editing

Edit an existing image or chain a targeted follow-up edit to a prior Image 2.0 generation by its request_id.

Text-to-Video and Image-to-Video

Generate 6-30 second video clips from a prompt or an image, with synchronized ambient audio and fluid motion.

Video Extension

Continue an existing Grok Imagine video generation while maintaining its visual style and motion.

Async REST, No App Required

Every endpoint uses Muapi's standard asynchronous submit-and-poll pattern — no chat interface or manual prompting.

Grok Imagine API Endpoint Comparison

EndpointInputOutputPriceBest For
grok-imagine-text-to-imageprompt, aspect_ratio6 images$0.05/callVivid scenes and characters from a prompt
grok-imagine-text-to-image-qualityprompt, aspect_ratioHigh-fidelity image$0.05/callAccuracy and detail over speed
grok-imagine-image-2prompt, aspect_ratioNew image + request_id$0.05/callSharp typography and layout planning
grok-imagine-image-to-imageprompt, images_listEdited image$0.05/callNatural-language edits to an existing image
grok-imagine-image-2-editprompt, request_id, mask_indexsRefined image + request_id$0.05/callChained follow-up edits to an Image 2.0 generation
grok-imagine-text-to-videoprompt, aspect_ratio, duration6-30s video$0.15/callCinematic clips from a text prompt
grok-imagine-image-to-videoprompt, images_list, duration6-30s video$0.15/callAnimating a reference image
grok-imagine-video-1-5-previewprompt, images_list, durationUp to 15s video$0.64/callTesting the next-generation video model
grok-imagine-extendrequest_id, prompt, extend_timesExtended video$0.05/callContinuing an existing video generation

Prices and supported fields are model-specific. Review the live Playground schema before shipping generated media in production.

How to Call the Grok Imagine API

Submit a JSON request with your Muapi API key, save the request ID, and poll the shared result endpoint. Provide a publicly reachable image URL for image-to-image, image-to-video, and follow-up edit requests.

1. Generate an image

curl -X POST https://api.muapi.ai/api/v1/grok-imagine-text-to-image \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"A vivid neon-lit alley in a cyberpunk city, rain-soaked pavement reflecting signage","aspect_ratio":"16:9"}'

# Response: {"request_id":"REQUEST_ID"}

Call grok-imagine-text-to-image with a prompt and aspect ratio. Returns 6 images per call.

2. Generate a video

curl -X POST https://api.muapi.ai/api/v1/grok-imagine-text-to-video \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"A hawk gliding low over a canyon at sunrise, ambient wind","aspect_ratio":"16:9","duration":6}'

# Response: {"request_id":"REQUEST_ID"}

Call grok-imagine-text-to-video with a prompt, aspect ratio, and duration.

3. Poll the result

curl https://api.muapi.ai/api/v1/predictions/REQUEST_ID/result \
  -H "x-api-key: YOUR_API_KEY"

# Poll until status is completed, then read the generated image/video URL from outputs.

Poll until the task is completed, then read the returned image or video URL.

Frequently Asked Questions

Can I generate images from a text prompt with Grok Imagine?

Yes. grok-imagine-text-to-image returns 6 images per call; grok-imagine-text-to-image-quality trades speed for higher fidelity and detail.

What's different about Grok Imagine Image 2.0?

Image 2.0 (grok-imagine-image-2) focuses on precise instruction-following, sharp typography and layout planning, and has a dedicated chained follow-up edit endpoint (grok-imagine-image-2-edit) that edits by request_id rather than a re-uploaded image.

Can I edit an existing image with Grok Imagine?

Yes. grok-imagine-image-to-image accepts an uploaded image plus natural-language instructions. grok-imagine-image-2-edit instead chains a targeted edit off a prior Image 2.0 generation's request_id, optionally scoped with mask_indexs.

Can Grok Imagine generate video?

Yes. grok-imagine-text-to-video and grok-imagine-image-to-video generate 6-30 second clips with synchronized ambient audio. grok-imagine-video-1-5-preview is a preview of the next video model, and grok-imagine-extend continues an existing video generation.

How much does the Grok Imagine API cost?

Image endpoints (text-to-image, quality mode, Image 2.0, image-to-image, and Image 2.0 edits) cost $0.05 per call. Text-to-video, image-to-video, and video extension cost $0.15-$0.05 per call depending on the endpoint. The video 1.5 preview model costs $0.64 per call.

Do I need to prompt Grok Imagine through a chat interface?

No. Muapi exposes Grok Imagine as standard asynchronous REST endpoints. Create an API key, submit JSON, and poll the returned request ID without a chat UI or manual prompting.

Ready to build with Grok Imagine?

Create one Muapi API key and connect image generation, editing, video generation, and video extension in a single asynchronous workflow.