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

# GLM 图像生成

GLM Image 文生图工具可根据文本提示词生成高质量图像，输出具有精细细节和高度一致性的高清图像。

<Tip>
  这是一个**异步**API，只会返回异步任务的 task\_id。您应该使用该 task\_id 请求 [查询任务结果 API](/models/reference-get-async-task-result) 来检索视频生成结果。
</Tip>

## 请求头

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

<ParamField header="Authorization" type="string" required={true}>
  Bearer 身份验证格式，例如：Bearer \{\{API 密钥}}。
</ParamField>

## 请求体

<ParamField body="size" type="string" default="1280x1280">
  图片尺寸。推荐值：1280x1280（默认）、1568x1056、1056x1568、1472x1088、1088x1472、1728x960、960x1728。自定义尺寸：宽高应在 1024-2048px 范围内，最大总像素数 4194304，宽高均需为 32 的整数倍。
</ParamField>

<ParamField body="prompt" type="string" required={true}>
  所需图像的文本描述。描述您希望在生成图像中呈现的场景、主体、风格和细节。
</ParamField>

<ParamField body="quality" type="string" default="hd">
  图像质量。HD 模式生成更精细、细节更丰富的图像，整体一致性更高。

  可选值：`hd`
</ParamField>

<ParamField body="watermark_enabled" type="boolean" default={true}>
  控制 AI 生成图片时是否添加水印。true：启用水印（默认，符合政策要求）。false：关闭水印。
</ParamField>

## 响应

<ResponseField name="task_id" type="string" required={true}>
  异步任务的 task\_id。您应该使用该 task\_id 请求 [查询任务结果 API](/models/reference-get-async-task-result) 以获取生成结果
</ResponseField>
