Get API Key Get API
Docs

Grok Imagine Image Generation

- Async processing mode, returns task ID for subsequent queries

  • Supports text-to-image and reference-based image editing
  • Also documents the grok-imagine-image and grok-imagine-image-quality models
  • Generated image links are valid for 24 hours; please save them promptly
Info

Model name compatibility note: This endpoint also accepts the alias grok-imagine-1.5-ext, which is equivalent to grok-imagine-1.5-openveer. The two are interchangeable and produce identical results.

Request example

# model can be "grok-imagine-1.5-openveer", or the compatible alias "grok-imagine-1.5-ext"
curl --request POST \
  --url https://api.openveer.com/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "grok-imagine-1.5-openveer",
    "prompt": "An orange cat sitting on a sunny windowsill, oil painting style",
    "size": "1:1",
    "n": 1
  }'

Response example

{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01JNXXXXXXXXXXXXXXXXXX"
    }
  ]
}

Authorizations

Authorization string

All APIs require Bearer Token authentication

Get API Key:

Visit the API Key Management Page to get your API Key

Add it to the request header:

Authorization: Bearer YOUR_API_KEY

Body

model string

Image generation model name

Supported models:

  • grok-imagine-1.5-openveer - Grok image generation and editing (compatible alias grok-imagine-1.5-ext)

Example: "grok-imagine-1.5-ext"

nsfw_check boolean

Whether to run content moderation before submitting the image task.

  • true: use omni-moderation-latest to review prompts and input images
  • false or omitted: do not send a moderation request, adding no moderation cost or latency (default)
prompt string

Text description for image generation or editing, supports multiple languages

image_urls string[]

Reference image URL list. Omit for text-to-image; include for image editing.

  • This model supports 1–5 reference images
  • Only publicly accessible absolute http:// or https:// URLs are accepted
  • Upload local images with POST /v1/uploads/images, then use the returned url
size string

Output image size

Supported formats:

  • 1:1 - Square (default)
  • 16:9 - Landscape widescreen
  • 9:16 - Portrait tall
  • 3:2 - Landscape
  • 2:3 - Portrait
n integer

Number of images to generate

Range: 1-10 (minimum 1, maximum 10)

⚠️ Note: Must be a plain number (e.g. 1), do not add quotes, otherwise an error will occur

Response

code integer

Response status code

data array
Response data array
status string

Task status

  * submitted - Submitted
task_id string

Unique task identifier

Use Cases

Case 1: Text-to-Image

{
  "model": "grok-imagine-1.5-openveer",
  "prompt": "An orange cat sitting on a sunny windowsill, oil painting style"
}

Case 2: Text-to-Image (size & count)

{
  "model": "grok-imagine-1.5-openveer",
  "prompt": "A starry night sky background with a person standing in the foreground",
  "size": "16:9",
  "n": 2
}

Case 3: Image Editing (background)

{
  "model": "grok-imagine-1.5-openveer",
  "prompt": "Change the background to a starry sky, keep the main subject",
  "image_urls": ["https://example.com/original.png"]
}

Case 4: Image Editing (style)

{
  "model": "grok-imagine-1.5-openveer",
  "prompt": "Convert the image to cyberpunk style",
  "image_urls": ["https://example.com/original.png"],
  "n": 2
}

Official Models

Info

grok-imagine-image and grok-imagine-image-quality use the same asynchronous task flow as other image models. A successful submission returns a task ID; poll Get Task Status until the task completes or fails.

Model Resolution Quality option Input images Outputs
grok-imagine-image 1k, 2k None 0–5 1–10
grok-imagine-image-quality 1k, 2k None 0–3 1–10

Do not send quality for either model. Omit image_urls for text-to-image; one image performs single-image editing; multiple images provide multi-image references.

Request parameters

Field Type Required Description
model string Yes grok-imagine-image or grok-imagine-image-quality
nsfw_check boolean No Default: false.
true: use omni-moderation-latest to review prompts and input images.
false or omitted: do not send a moderation request.
prompt string Yes Non-empty after trimming; maximum 8,000 characters
n integer No Default: 1; allowed values: 1–10
aspect_ratio string No Default: auto; use a supported aspect ratio or auto
resolution string No Default: 1k; allowed values: 1k or 2k
image_urls string[] No 1–5 images for grok-imagine-image; 1–3 for grok-imagine-image-quality

Supported aspect_ratio values: 1:1, 3:4, 4:3, 9:16, 16:9, 2:3, 3:2, 9:19.5, 19.5:9, 9:20, 20:9, 1:2, 2:1, and auto.

curl --request POST \
  --url https://api.openveer.com/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-OpenVeer-Response-Version: 2026-07-27' \
  --data '{
    "model": "grok-imagine-image",
    "prompt": "Minimal product photography of a white ceramic cup",
    "n": 1,
    "aspect_ratio": "1:1",
    "resolution": "2k"
  }'

Task submission response

{
  "code": 202,
  "data": {
    "id": "task_01KZQE5CM0Y3KZ6M1N1BK619MX",
    "object": "generation.task",
    "type": "image",
    "status": "pending",
    "progress": 0,
    "poll_url": "/v1/tasks/task_01KZQE5CM0Y3KZ6M1N1BK619MX"
  }
}

Use data.id or data.poll_url to query the task until its status becomes completed or failed.

This documentation is built and hosted on Mintlify, a developer documentation platform.