Quick answer: GLM 5.4 vision is built into the main glm-5.4 model, with no separate "V" model. Send a messages[].content array with a text block plus one or more media blocks: image_url (jpg/png, under 5 MB, up to 6000×6000 px, URL or Base64), video_url (mp4/mkv/mov, up to 200 MB) or file (up to 50 MB, by file_id, file_url or file_data). A file block cannot be mixed with image or video blocks in the same message. Pricing is the normal GLM 5.4 rate: $1.40 input and $4.40 output per million tokens.
GLM 5.4 is the first GLM flagship that can see. GLM 5.3 was text-only and only the Flash tier read images, so teams that wanted a flagship model on screenshots had to chain a vision model in front of it. Z.ai's GLM-5.4 page covers image input in a short paragraph; the size, format and mixing rules sit in the Chat Completions reference. This guide collects the GLM 5.4 vision rules in one place, with code you can paste, checked against Z.ai's docs on December 3, 2026.
The problem GLM 5.4 vision solves
The usual pain is a two-model pipeline: OCR or a captioning model turns an image into text, then a reasoning model works on that text, and details get lost in between. A layout bug, a chart axis or a CAD dimension rarely survives the caption. GLM 5.4 vision lets the same model that writes the code look at the source. Z.ai's launch demos lean on that: code written from video frames, a FreeCAD robotic arm and GLSL 3D scenes. Those are Z.ai's picks, not measured success rates, but they show where GLM 5.4 vision is aimed.
GLM 5.4 vision input limits
| Input | Block type | Formats | Limit | How to pass it |
|---|---|---|---|---|
| Image | image_url | jpg, jpeg, png | Under 5 MB, max 6000×6000 px | URL (recommended) or Base64 data URL |
| Video | video_url | mp4, mkv, mov | Up to 200 MB | URL |
| File | file | Documents | Up to 50 MB | One of file_id, file_url, file_data |
| Text | text | — | Within 1M context | Plain string |
GLM 5.4 vision rules worth remembering:
- Content arrays are limited to the GLM-5.4 and GLM-5.3-Flash series. Sending an array to
glm-5.2will not work. - For several images, add several
image_urlblocks. - A
fileblock cannot be combined withimage_urlorvideo_urlblocks. - Output is always text. GLM 5.4 vision reads media; it does not generate images.
Step 1: Send an image to GLM 5.4 vision
The smallest working GLM 5.4 vision request is one text block and one image block:
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.z.ai/api/paas/v4",
api_key=os.environ["ZAI_API_KEY"])
resp = client.chat.completions.create(
model="glm-5.4",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "Rebuild this mockup as a React + Tailwind component."},
{"type": "image_url", "image_url": {"url": "https://example.com/mockup.png"}},
],
}],
max_tokens=16000,
)
print(resp.choices[0].message.content)
Z.ai recommends URLs over Base64. A URL keeps the request small; Base64 inflates payload size by about a third and makes logs heavy. Use a data URL such as data:image/png;base64,... only when the image cannot be hosted.
Step 2: Send a video
GLM 5.4 vision accepts video through a video_url block:
{
"model": "glm-5.4",
"messages": [{
"role": "user",
"content": [
{ "type": "text", "text": "List every UI error shown in this screen recording, with timestamps." },
{ "type": "video_url", "video_url": { "url": "https://example.com/bug-repro.mp4" } }
]
}]
}
Trim recordings to the part that matters before you send them. Z.ai has not published how GLM 5.4 vision samples frames or how many tokens a minute of video costs, so measure usage.prompt_tokens on a short clip first.
Step 3: Send a document to GLM 5.4 vision
For PDFs and other files, use a file block with exactly one source:
{ "type": "file", "file": { "file_url": "https://example.com/spec.pdf", "filename": "spec.pdf" } }
file_data takes the form data:<MIME>;base64,<DATA>. Z.ai marks the older standalone file_url content type as still working but not recommended for new code.
Want to try GLM 5.4 vision before writing any code? Upload a screenshot to GLM 5.4 in glm5.app chat; the model picker shows GLM 5.4 as able to read images.
What GLM 5.4 vision is good for
Based on Z.ai's positioning and the model's coding focus, these are the jobs where GLM 5.4 vision earns its flagship price:
| Task | Why GLM 5.4 vision fits |
|---|---|
| Screenshot or Figma export to code | Sees layout and writes code in one pass |
| Debugging from screen recordings | Reads the failing state directly |
| Charts and dashboards to data or SQL | Keeps axis and legend context |
| Diagrams and CAD views to scripts | Matches Z.ai's FreeCAD and 3D demos |
| Long PDFs with figures | 1M context holds text plus attachments |
For bulk captioning, alt text or simple OCR, GLM 5.3 Flash uses the same block format at $0.15 / $0.50 per million tokens, about nine times less. Our GLM 5.4 vs GLM 5.3 Flash comparison covers that routing choice.
GLM 5.4 vision cost
Media is billed as input tokens at the normal GLM 5.4 rate. Z.ai does not publish a per-image token formula, so the only reliable number is the usage field in your own responses. A practical way to budget GLM 5.4 vision:
- Send five representative images and record
usage.prompt_tokens. - Subtract the tokens of a text-only version of the same prompt.
- Multiply the per-image tokens by $1.40 per million, plus output at $4.40 per million.
Remember that GLM 5.4 always thinks, and reasoning bills as output. Set max_tokens so a hard screenshot does not trigger an expensive "marathon thinking" pass.
Troubleshooting GLM 5.4 vision requests
| Error or symptom | Likely cause | Fix |
|---|---|---|
| Request rejected | Image over 5 MB or over 6000×6000 px | Resize or recompress |
| Format error | WebP, GIF or HEIC image | Convert to png or jpg |
| Content array rejected | Wrong model, such as glm-5.2 | Use glm-5.4 or glm-5.3-flash |
| File plus image rejected | Mixed file and image_url blocks | Split into separate messages |
| Model ignores the image | URL not publicly reachable | Use a public URL or Base64 |
| Answer cut short | Reasoning used up max_tokens | Raise the limit |
Using GLM 5.4 vision through glm5.app
glm5.app is an independent service, not run by Z.ai. It serves glm-5.4 in chat with image upload and through an OpenAI-compatible API on prepaid credits. See the API docs for the endpoint and the pricing page for credit rates. For high-volume GLM 5.4 vision jobs, going direct to Z.ai is cheaper per token.
FAQs
Does GLM 5.4 support vision?
Yes. GLM 5.4 vision accepts images, video and files as input and returns text.
What image formats does GLM 5.4 vision accept?
jpg, jpeg and png, each under 5 MB and at most 6000×6000 pixels.
Can GLM 5.4 vision read video?
Yes, through video_url blocks with mp4, mkv or mov files up to 200 MB.
Can GLM 5.4 generate images?
No. GLM 5.4 vision is input only; output is text.
Is there a cheaper model with the GLM 5.4 vision format?
GLM 5.3 Flash uses the same content blocks at about one-ninth of the price.
Final take
GLM 5.4 vision removes the caption step between seeing and coding. Keep images in png or jpg under 5 MB, never mix file and image blocks, and cap max_tokens. Then test it on the screenshots your team actually ships. Open the GLM 5.4 page for access options, or start a GLM 5.4 chat and drop in an image.
Sources
- Z.ai Docs: GLM-5.4: modalities, image input method, recommended settings
- Z.ai Docs: Chat Completion API:
image_url,video_urlandfileblock formats and limits - Z.ai Pricing: GLM-5.4 and GLM-5.3-Flash rates
- Z.ai Docs: GLM-5.3-Flash: Flash multimodal input
Checked December 3, 2026 against Z.ai's docs.




