Skip to main content
Core.Today
|
xAIFastStandard

Grok Imagine Image Edit

Dedicated edit endpoint for xAI's Grok Imagine image model. Pass a source image URL and a prompt describing the change - the fastest, lowest-cost editing tier in the family.

52 credits
per image
Prompt-based editing of an existing image
Up to 10 edited variants per request (billed per image)
Aspect ratio control for the output
1k / 2k output resolution tiers at the same price

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/edit",
  "input": {
    "prompt": "Make the apple green and add soft morning light",
    "image": "https://example.com/apple.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. Same price for both.
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/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/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

Color Edit

Change an object's color while keeping the scene

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/edit",
  "input": {
    "prompt": "Make the apple green and add soft morning light",
    "image": "https://example.com/apple.jpg"
  }
}'

Tips & Best Practices

1Describe only the change you want - the rest of the image is preserved
2For pure text-to-image generation, use xai/grok-imagine-image instead
3auto aspect ratio follows the source image

Use Cases

Quick object, color, and lighting changes on existing photos
Bulk variant generation from one source image
Low-cost iteration before switching to the 2.0/Quality edit tiers