# Grok Imagine Image - Core.Today AI API > Generate images using xAI's Grok Imagine model. Sibling to Grok Imagine Video, sharing the same underlying Grok Imagine architecture for fast text-to-image generation. - **Provider**: xAI - **Model ID**: xai/grok-imagine-image - **Category**: Image Generation - **Credits**: 47 per image - **Speed**: Fast - **Quality**: Standard ## Features - Text-to-image generation built on the Grok Imagine architecture - Image editing mode — pass an existing image plus a prompt to edit it - 14 aspect ratio presets plus an auto option - Shares its underlying architecture with Grok Imagine Video ## Use Cases - Rapidly iterating on image concepts from text prompts - Editing an existing image by passing it in as input alongside a prompt - Generating images across varied aspect ratios for social posts, wide banners, and mobile screens ## API Endpoint Base URL: https://api.core.today/v1 Create Prediction: POST /predictions Get Status: GET /predictions/{job_id} ## Authentication Header: X-API-Key: YOUR_API_KEY ## Input Parameters ### Required - **prompt**: string - Text prompt for image generation or editing ### Optional - **image**: string - Input image for editing. When provided, the model edits this image based on the prompt. Supports jpg, jpeg, png, webp. - **aspect_ratio**: string (default: 1:1) - Aspect ratio of the generated image. Ignored when editing an image. Options: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2, 19.5:9, 9:19.5, 20:9, 9:20, auto ## Examples ### Text-to-image generation Generates a new image from a text prompt at a 16:9 aspect ratio. ```json { "model": "xai/grok-imagine-image", "input": { "prompt": "A futuristic city skyline at sunset, flying vehicles, neon reflections on glass towers", "aspect_ratio": "16:9" } } ``` ### Edit an existing image Edits an uploaded image based on the prompt; aspect_ratio is ignored. ```json { "model": "xai/grok-imagine-image", "input": { "prompt": "Change the background to a snowy mountain landscape", "image": "https://example.com/input-photo.jpg" } } ``` ## Response Format ```json { "job_id": "abc123", "status": "pending | processing | completed | failed", "result": "URL or data (when completed)" } ``` ## Usage Flow 1. POST /predictions with model and input -> receive job_id 2. GET /predictions/{job_id} -> poll until status is completed or failed 3. Result contains output URL(s) ## Tips - Pass an image to switch into edit mode — the model edits that image based on your prompt instead of generating from scratch - aspect_ratio is ignored when editing an image since the output follows the input image's dimensions - Use aspect_ratio=auto to let the model choose a sensible ratio for the prompt ## Documentation https://replicate.com/xai/grok-imagine-image