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.
| Field | Value |
|---|---|
| Base URL | https://bettertoken.ai/v1 |
| Full request URL | https://bettertoken.ai/v1/chat/completions |
| Authorization header | Authorization: Bearer YOUR_BETTERTOKEN_API_KEY |
| Method | POST |
| Model ID | glm-5.4 |
Set your BetterToken API Key as the local environment variable BETTERTOKEN_API_KEY before you run the command.
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.

