# Grok Imagine Image Quality Edit > Highest-fidelity image editing with xAI's Grok Imagine Image Quality - pass a source image and a prompt describing the change. - **Provider**: xai-image-edit - **Model ID**: xai/grok-imagine-image-quality/edit - **Category**: image_generation - **Credits**: 140 per request - **Pricing Type**: input_based ## API Endpoint Base URL: https://api.core.today/v1 ### Create Prediction POST /predictions ### Get Status GET /predictions/{job_id} ### Cancel DELETE /predictions/{job_id} ## Authentication Header: `X-API-Key: YOUR_API_KEY` ## Input Parameters - `aspect_ratio` (string, optional): Aspect ratio of the output image. (Default: `auto`; 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`) - `prompt` (string, **required**): Text prompt describing the edit. - `n` (integer, optional): Number of edited variants to generate. Billed per image. (Default: `1`; Range: min: 1, max: 10) - `resolution` (string, optional): Output resolution tier. 2k is billed at a higher rate; omitted defaults to 1k. (Options: `1k`, `2k`) - `image` (string, **required**): Source image URL to edit. Supports jpg, jpeg, png (max 20MiB). ## Example Request ```json { "model": "xai/grok-imagine-image-quality/edit", "input": { "prompt": "Restore this photo and enhance fine detail, keep composition", "image": "https://files.core.today/aiapi/6f8aed9a74674cd1/public/SlzMWjEAXHIdNTyTRKe6jV2keHjUXZ2k/0.jpg" } } ``` ## Response Format ```json { "job_id": "abc123", "status": "pending", "provider": "replicate", "model": "black-forest-labs/flux-schnell", "created_at": "2026-01-01T00:00:00Z", "result": null, "error": null } ``` Status values: `pending`, `processing`, `completed`, `failed`, `cancelled` ## Usage Flow 1. POST /predictions with model and input → receive job_id 2. Poll GET /predictions/{job_id} until status is `completed` or `failed` 3. Result contains output URL(s) or data ## Output Type url ## Tags xai, grok, image-editing, image-to-image, high-quality ## Documentation https://docs.x.ai/developers/model-capabilities/images/editing