> ## Documentation Index
> Fetch the complete documentation index at: https://docs.myrouter.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Grok Imagine text to Image

This is an async API that only returns the `task_id` of the async task.

<Tip>
  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](/docs/models/reference-get-async-task-result) to retrieve the generated result.
</Tip>

## Request Headers

<ParamField header="Content-Type" type="string" required={true}>
  Enum: `application/json`
</ParamField>

<ParamField header="Authorization" type="string" required={true}>
  Bearer authentication format: Bearer \{\{API Key}}.
</ParamField>

## Request Body

<ParamField body="prompt" type="string" required={true}>
  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
</ParamField>

<ParamField body="aspect_ratio" type="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`
</ParamField>

<ParamField body="output_format" type="string" default="jpeg">
  Output image format.

  Possible values: `jpeg`, `png`
</ParamField>

## Response

<ResponseField name="task_id" type="string" required={true}>
  Use the task\_id to call the [Get Async Task Result API](/docs/models/reference-get-async-task-result) to retrieve the generated output.
</ResponseField>
