
2026/01/11
Z.ai API Quick Start + Parameter Cheatsheet
Generating images via GLM-Image using the official Z.ai API—includes curl and Python examples, sizing rules, quality modes, and best practices.
Endpoint and Minimal curl Request
The Z.ai image generation endpoint is:
POST https://api.z.ai/api/paas/v4/images/generations (Z.AI)
curl --request POST \
--url https://api.z.ai/api/paas/v4/images/generations \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"model": "glm-image",
"prompt": "A clean poster with Headline Spring Sale and CTA Buy Now",
"size": "1280x1280",
"quality": "hd"
}'
The response returns a downloadable image URL. (Z.AI)
Parameter Cheatsheet (Most Used)
model
"glm-image"(Z.AI)
size
- e.g.,
1280x1280(Z.AI) - Custom Sizing: Width/Height should be between 1024–2048 and multiples of 32 based on API references. (Z.AI)
quality
hd(more detail, slower ~20s)standard(faster ~5-10s) (Z.AI)
Production Tips
- Validate
sizeon your server-side (range + divisibility by 32). - Implement retries for transient failures.
- Store the returned URL or download immediately for CDN/cache.
More Posts

Menu Test: Why GLM-Image Beats Diffusion Models at Legible Pricing
A practical menu benchmark you can run at home—testing price readability, alignment, and typography using GLM-Image with a clear scoring rubric.


ComfyUI Status Tracker: When Native Support Lands
Track GLM-Image support in ComfyUI—where to watch, what “native support” means, and stopgap workflows until it lands.


GLM-Image for Posters: 10 Prompt Templates That Actually Render Text
A practical prompt library for poster design with legible typography using GLM-Image—layout recipes, font controls, and 10 copy-paste templates.
