Skip to main content
POST
/
v3
/
async
/
grok-imagine-image-t2i
Grok Imagine text to Image
curl --request POST \
  --url https://api.myrouter.ai/v3/async/grok-imagine-image-t2i \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "prompt": "<string>",
  "aspect_ratio": "<string>",
  "output_format": "<string>"
}
'
{
  "task_id": "<string>"
}
This is an async API that only returns the task_id of the async task.
This is an async API that only returns the task_id of the async task. Use the task_id to call the Get Async Task Result API to retrieve the generated result.

Request Headers

Content-Type
string
required
Enum: application/json
Authorization
string
required
Bearer authentication format: Bearer {{API Key}}.

Request Body

prompt
string
required
Text description of the image to generate. The model supports rich, detailed prompts for high-quality image generation across multiple visual styles, including hyper-realistic photography, anime, oil painting, pencil sketch, and more.Length limit: 1 - unlimited
aspect_ratio
string
default:"1:1"
Aspect ratio of the generated image. Common uses: 1:1 for social media and thumbnails, 16:9/9:16 for widescreen and mobile portrait, 4:3/3:4 for presentations and portraits, 3:2/2:3 for photography, 2:1/1:2 for banners and headers, 20:9/9:20 for ultra-wide displays.Possible values: 2:1, 20:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:20, 1:2
output_format
string
default:"jpeg"
Output image format.Possible values: jpeg, png

Response

task_id
string
required
Use the task_id to call the Get Async Task Result API to retrieve the generated output.