GLM Image Generation
Images
GLM Image Generation
POST
GLM Image Generation
This is an asynchronous API and only returns the
task_id of the asynchronous task.
Request Headers
Enum value:
application/jsonBearer authentication format: Bearer {{API Key}}.
Request Body
Image size. Recommended values: 1280x1280 (default), 1568x1056, 1056x1568, 1472x1088, 1088x1472, 1728x960, 960x1728. Custom sizes: width and height should be within the 1024–2048px range, the maximum total pixel count is 4194304, and both width and height must be integer multiples of 32.
Text description of the desired image. Describe the scene, subject, style, and details you want in the generated image.
Image quality. HD mode generates more refined and detail-rich images with higher overall consistency.Optional value:
hdControls whether a watermark is added to AI-generated images. true: enable watermark (default, complies with policy requirements). false: disable watermark.
Response Information
Use the task_id to call the Get Task Result API to retrieve the generated output.