Z.AI logo

GLM-Image

Z.aiReleased Jan 14, 2026z-ai/glm-image
CostCompare

GLM-Image is Z.AI's text-to-image generation model that quickly and accurately understands text descriptions to produce precise, personalized, high-quality images. It supports an 'hd' mode for more detailed and consistent output (~20s generation time) and a 'standard' mode optimized for faster generation (~5-10s), along with flexible custom resolutions from 1024px to 2048px per side.

Context
4K
Max output
4K
Input /1M
—
Output /1M
$0.01/img
AcceptsTextProducesImage

Providers

FastRouter routes your requests to this provider. You can also bring your own key.

Z.AI logo
Z.AI
z-ai
Input /1M—
Output /1M$0.015/img
Context4K
Max output4K

Supported parameters

Request parameters you can send with this model.

Parameter
Type
Z.AI
Other
quality
string
"hd", "standard"
size
string
"1280x1280", "1568x1056", "1056x1568", "1472x1088", "1088x1472", "1728x960", "960x1728"
user_id
string
-

Make your first API call

OpenAI-compatible. Point your SDK at FastRouter, or call the API directly.

Full API docs
Replace <FASTROUTER_API_KEY> with your key · Get your key →Install
OpenAI SDKHTTP
import base64
from openai import OpenAI
client = OpenAI(
api_key="<FASTROUTER_API_KEY>",
base_url="https://api.fastrouter.ai/api/v1"
)
img = client.images.generate(
model="z-ai/glm-image",
prompt="A cute baby sea otter",
n=1,
size="1024x1024"
)
image_base64 = img.data[0].b64_json
image_bytes = base64.b64decode(image_base64)
with open("otter.png", "wb") as f:
f.write(image_bytes)

Frequently asked questions

More models from Z.AI

Z.AI logo
GLM 4.6z-ai/glm-4.6

GLM-4.6 is the latest iteration in the GLM series by Zhipu AI, designed as a large language model with about 355 billion parameters in a Mixture of Experts (MoE) architecture. It is optimized for various complex tasks including real-world coding, long-context processing, advanced reasoning, intelligent agent applications, and refined writing. The model features an expanded context window of 200,000 tokens (up from 128,000 in GLM-4.5), allowing it to handle longer and more complex interactions such as extensive documents or multi-turn conversations.

Z.AI logo
GLM 4.7z-ai/glm-4.7

GLM-4.7 is Z.AI’s latest flagship model, featuring upgrades in two key areas: enhanced programming capabilities and more stable multi-step reasoning/execution. It demonstrates significant improvements in executing complex agent tasks while delivering more natural conversational experiences and superior front-end aesthetics.

Z.AI logo
GLM 5z-ai/glm-5

GLM-5 is Z.ai’s flagship open-source foundation model, built for complex system design and long-horizon agent workflows. Aimed at expert developers, it delivers production-grade results on large-scale programming tasks and competes with top closed-source models. With strong agentic planning, deep backend reasoning, and iterative self-correction, GLM-5 goes beyond code generation to help design, build, and execute complete systems end-to-end.

Z.AI logo
GLM 5.1z-ai/glm-5.1

zai-org/GLM-5.1 is Z.AI's (formerly Zhipu AI) open-weight, instruction-tuned coding flagship model—a refreshed upgrade over GLM-5—excelling in agentic engineering, complex system programming, and long-horizon tasks with SOTA open-source performance approaching Claude Opus 4.6.

Z.AI logo
GLM 5.2z-ai/glm-5.2

GLM 5.2 is a large-scale reasoning model from Z.ai. It supports text input and output with a 1M-token context window, and is suited for long-horizon agent workflows, project-level software engineering,...

Z.AI logo
GLM-5.3z-ai/glm-5.3

GLM-5.3 is Z.ai’s latest GLM-5-series flagship, a 743B-parameter text-only foundation model post-trained from GLM-5.2 for frontier-level coding, long-horizon agentic workflows, and defensive cybersecurity analysis. It inherits GLM-5’s 200K-token context window and up to 128K-token outputs, supports advanced reasoning and tool use, and is initially exposed through Z.ai’s coding plan and forthcoming API access.

Model scores sourced from ArtificialAnalysis