Skip to main content
Core.Today
|
xAIMediumUltra

Grok Imagine Image Quality Edit

Dedicated edit endpoint for xAI's Grok Imagine Image Quality - the highest-fidelity editing tier in the family for polished, detail-preserving edits.

140 credits
per image
Highest-fidelity editing in the Grok Imagine family
Detail-preserving retouches and restorations
Up to 10 edited variants per request (billed per image)
1k / 2k output resolution tiers (2k billed higher)

Run it right now

Test this model instantly in the Console Playground โ€” no code required

Sign in to try

Use with AI Assistant

Copy usage instructions for Claude, ChatGPT, or other AI

Quick Start

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "xai/grok-imagine-image-quality/edit",
  "input": {
    "prompt": "Restore this photo and enhance fine detail, keep composition",
    "image": "https://example.com/old-photo.jpg"
  }
}'

Parameters

ParameterTypeRequiredDefaultDescription
promptstringYes-Text prompt describing the edit.
imagestringYes-Source image URL to edit. Supports jpg, jpeg, png (max 20MiB).
nintegerNo1Number of edited variants to generate (1-10). Billed per image.
aspect_ratiostringNoautoAspect ratio of the output image.
auto1:116:99:164:33:43:22:32:11:219.5:99:19.520:99:20
resolutionstringNo-Output resolution tier. 2k is billed at a higher rate; omitted defaults to 1k.
1k2k

How to Provide File Input

There are 3 ways to provide files for the image parameter:

Recommended

Image URL

Pass a publicly accessible URL directly. With the Storage API (POST /v1/files/upload-url) the file uploads straight to S3 (50MB per file) and you pass the returned file_url.

{
  "model": "xai/grok-imagine-image-quality/edit",
  "input": {
    "prompt": "your prompt here",
    "image": "https://example.com/image.jpg"
  }
}

Direct Upload (Multipart)

Attach files directly to POST /v1/predictions/upload. No separate upload step, but the bytes pass through the API server so the whole request is capped at 10MB.

curl -X POST "https://api.core.today/v1/predictions/upload" \
  -H "X-API-Key: cdt_your_api_key" \
  -F "model=xai/grok-imagine-image-quality/edit" \
  -F 'input={"prompt":"your prompt here"}' \
  -F "file:image=@your_file.png"
See the File Upload docs for more upload methods including Presigned URLs.

Common Parameters

Common parameters used when calling POST /v1/predictions.

ParameterTypeRequiredDefaultDescription
modelstringYes-Model identifier
inputobjectYes-Object containing the model-specific parameters from the table above
output_folderstringNo-Folder path for output files (max 256 chars, '..' not allowed)
webhook_urlstringNo-Webhook URL to call on completion
is_publicbooleanNofalseIf true, output files are also available via permanent public URLs

Examples

Restoration

Restore and enhance a photo without changing composition

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "xai/grok-imagine-image-quality/edit",
  "input": {
    "prompt": "Restore this photo and enhance fine detail, keep composition",
    "image": "https://example.com/old-photo.jpg"
  }
}'

Tips & Best Practices

1Use this tier when edit fidelity matters more than speed or cost
2Upstream is limited to 5 requests/second - batch with n instead of parallel calls
3For cheaper iteration, start with xai/grok-imagine-image/edit

Use Cases

Final-quality retouching of hero images
Photo restoration and detail enhancement
High-end product image editing