> ## 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.

# GLM Image Generation

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="size" type="string" default="1280x1280">
  Image dimensions. Recommended values: 1280x1280 (default), 1568x1056, 1056x1568, 1472x1088, 1088x1472, 1728x960, 960x1728. Custom dimensions: width and height should be in the range of 1024-2048px, maximum total pixels 4194304, and both width and height must be multiples of 32.
</ParamField>

<ParamField body="prompt" type="string" required={true}>
  Text description of the desired image. Describe the scene, subject, style, and details you want in the generated image.
</ParamField>

<ParamField body="quality" type="string" default="hd">
  Image quality. HD mode generates finer, more detailed images with higher overall consistency.

  Possible values: `hd`
</ParamField>

<ParamField body="watermark_enabled" type="boolean" default={true}>
  Controls whether a watermark is added to AI-generated images. true: enable watermark (default, compliant with policy requirements). false: disable watermark.
</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>
