# Grok Imagine Image 2.0 Edit - Core.Today AI API > Dedicated edit endpoint for xAI's Grok Imagine Image 2.0. Precise, instruction-following edits on an existing image - ideal for ads, mockups, and asset touch-ups. - **Provider**: xAI - **Model ID**: xai/grok-imagine-image-2.0/edit - **Category**: Image Generation - **Credits**: 160 per image - **Speed**: Fast - **Quality**: High ## Features - Precise instruction-following edits (2.0 family strengths) - Up to 10 edited variants per request (billed per image) - Aspect ratio control for the output - 1k / 2k output resolution tiers (2k billed higher) ## Use Cases - Ad creative and product image touch-ups with exact instructions - UI/UX mockup revisions - Game asset variations from a source render ## 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 describing the edit. - **image**: string - Source image URL to edit. Supports jpg, jpeg, png (max 20MiB). ### Optional - **n**: integer (default: 1) - Number of edited variants to generate (1-10). Billed per image. - **aspect_ratio**: string (default: auto) - Aspect ratio of the output image. Options: auto, 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 - **resolution**: string - Output resolution tier. 2k is billed at a higher rate; omitted defaults to 1k. Options: 1k, 2k ## Examples ### Background Swap Replace the background while keeping the subject ```json { "model": "xai/grok-imagine-image-2.0/edit", "input": { "prompt": "Replace the background with a clean studio gradient", "image": "https://example.com/product.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 - Best tier for edits that must follow instructions exactly (text, layout, brand elements) - For pure generation, use xai/grok-imagine-image-2.0 instead - Batch alternative edits with the n parameter