Back to Media creation

Grok Imagine Image

xAI

Generate or edit images from text prompts with aspect-ratio and output-format controls.

Current price
$0.0280/image
Availability
Ready to run
Last accepted verification

What this API does

Create images from a prompt with fal's current Grok Imagine Image endpoint. Aspect ratio, resolution and image count are explicit; Scrollport fixes asynchronous JPEG output and stores every result as a private artifact.

Agents select this operation with tool ID xai.grok-imagine-image, then inspect its current executable contract before a run.

Public input and output shape

Input

aspect_ratiostring · optional

Value supplied for aspect ratio.

enum: 2:1, 20:9, 19.5:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:19.5, 9:20, 1:2

num_imagesinteger · optional

Value supplied for num images.

minimum: 1 · maximum: 4

promptstring · required

Instruction describing the requested generated output.

minLength: 1 · maxLength: 4096

resolutionstring · optional

Value supplied for resolution.

enum: 1k, 2k

Output

imagesarray

Returned images value.

notestring

Returned note value.

Example request and output

This reviewed worked example is shared with inspect. Inspect also returns the current executable schema and price estimate before a paid run.

Request

{
  "tool_id": "xai.grok-imagine-image",
  "input": {
    "prompt": "a cobalt reusable water bottle on a pale stone plinth, soft editorial studio lighting, crisp product photography",
    "num_images": 1,
    "resolution": "1k",
    "aspect_ratio": "1:1"
  }
}

Output

{
  "note": "images returned as artifacts",
  "images": [
    {
      "content_type": "image/jpeg"
    }
  ]
}
Teaching errors and limitations
  • invalid_input: num_images must be 1–4 and resolution must be 1k or 2kexample: {"prompt":"a cobalt reusable water bottle on a pale stone plinth, soft editorial studio lighting, crisp product photography","num_images":1,"aspect_ratio":"1:1","resolution":"1k"}
Updated
18 August 2026

Use Grok Imagine Image with Scrollport

Scrollport identifies and validates the best-in-class API tools and provides them on a pay-as-you-go basis so you don't need to maintain a separate provider account, subscription or credits.

Give your agent the setup prompt to receive $1 in trial credit and start using the tools right away.