Skip to content
Sign Up Free
Model updates

GLM 5.4: complex coding tasks

Learn when to use Z.ai's GLM 5.4. Find the exact Model ID and a text request example for Chat Completions.

GLM 5.4 is Z.ai’s model for complex coding tasks. Typical tasks include planning changes across files, diagnosing test failures, and outlining a refactor.

Chat Completions setup

Send text requests to glm-5.4 through BetterToken’s OpenAI-compatible Chat Completions endpoint. This endpoint supports streaming and tool calling.

Use your existing BetterToken API Key. To get one, register and create a Key.

FieldValue
Base URLhttps://bettertoken.ai/v1
Full request URLhttps://bettertoken.ai/v1/chat/completions
Authorization headerAuthorization: Bearer YOUR_BETTERTOKEN_API_KEY
MethodPOST
Model IDglm-5.4

Set your BetterToken API Key as the local environment variable BETTERTOKEN_API_KEY before you run the command.

Terminal window
curl "https://bettertoken.ai/v1/chat/completions" \
-H "Authorization: Bearer ${BETTERTOKEN_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"model": "glm-5.4",
"messages": [{ "role": "user", "content": "Give three steps to diagnose an automated test that fails intermittently." }],
"stream": false
}'

Read the text response in choices[0].message.content. See the Chat Completions reference for more parameters.

See Streaming and tool calling for examples.

Pricing

Check the model plaza for current input, output, and cache-read prices.

Z.ai’s GLM 5.4 announcement