Skip to main content
POST
/
v3
/
async
/
grok-imagine-image-t2i
Grok Imagine Image Text-to-Image
curl --request POST \
  --url https://api.highwayapi.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 asynchronous API and only returns the task_id of the async task.
This is an asynchronous API and will only return the task_id of the async task. You should use this task_id to request the Get Task Result API to retrieve the generated results.

Request Headers

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

Request Body

prompt
string
required
The text description of the image to generate. The model supports rich, detailed prompts to generate high-quality images, and supports various visual styles, including hyper-realistic photography, anime, oil painting, pencil sketch, and more.Length limit: 1 - unlimited
aspect_ratio
string
default:"1:1"
The aspect ratio of the generated image. Common use cases: 1:1 is suitable for social media and thumbnails; 16:9/9:16 are suitable for widescreen and mobile portrait; 4:3/3:4 are suitable for presentations and portraits; 3:2/2:3 are suitable for photography; 2:1/1:2 are suitable for banners and hero images; 20:9/9:20 are suitable for ultrawide displays.Options: 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.Options: jpeg, png

Response Information

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