01 · Code generation
Natural language to code
Describe what a function, class, or module should do and get runnable code back. Multi-turn refinement works naturally for iterating on requirements.
Live on TokenRa · Zhipu AI
glm-5.4 is Zhipu AI's coding-specialized GLM 5.4 model — fine-tuned for code generation, debugging, review, and agentic programming workflows. It is live on TokenRa with an OpenAI-compatible endpoint and no waitlist.
glm-5.4
Prices below are live on TokenRa. Check the console for the current rate and any active discounts before production use.
| Dimension | Price |
|---|---|
| Input tokens | $0.09 / 1M tokens |
| Output tokens | $0.33 / 1M tokens |
| Cache read | $0.0225 / 1M tokens |
Prices shown in USD. CNY rates and volume discounts are displayed in the console. The cache read tier applies when the same prompt prefix has been seen recently — useful for repeated system prompts or large code context.
Register at tokenra.io/register, top up your balance, and call glm-5.4 immediately. No application or separate approval is needed.
glm-5.4 is a code-specialized model from Zhipu AI built on the GLM 5.4 base, trained with additional focus on programming tasks. Compared with the general-purpose GLM-5.3 family, it brings targeted improvements in four areas:
base_url and model, and existing code keeps working.Three scenarios where glm-5.4's specialized training makes a practical difference.
01 · Code generation
Describe what a function, class, or module should do and get runnable code back. Multi-turn refinement works naturally for iterating on requirements.
02 · Debugging & review
Paste failing code or a function to audit. The model pinpoints the error, explains why it occurs, and returns a corrected version — suitable for embedding in a CI step or editor plugin.
03 · Agentic workflows
Wire it into an agent framework with tool access to files, terminals, or test runners. The model plans, executes, and iterates across steps — useful for building AI coding assistants.
TokenRa is OpenAI-compatible. Point base_url at https://tokenra.io/v1 and set model to glm-5.4.
curl https://tokenra.io/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.4",
"messages": [
{
"role": "user",
"content": "Write a binary search function in Python with type hints and a docstring."
}
],
"max_tokens": 1024
}'
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://tokenra.io/v1",
)
response = client.chat.completions.create(
model="glm-5.4",
messages=[
{
"role": "system",
"content": "You are a senior software engineer specializing in code review and best practices.",
},
{
"role": "user",
"content": (
"Review the following Python code for bugs and security issues:\n\n"
"def get_user(id):\n"
" result = db.execute('SELECT * FROM users WHERE id = ' + str(id))\n"
" return result[0]"
),
},
],
max_tokens=2048,
)
print(response.choices[0].message.content)
Sign up at tokenra.io/register, open the console, and create a key. Replace YOUR_API_KEY in the examples above and you are ready to call the model.
Both models come from Zhipu AI and are live on TokenRa. The right choice depends on whether your workload is primarily code or general-purpose.
| Dimension | glm-5.4 | GLM-5.3-Flash |
|---|---|---|
| Model generation | GLM 5.4 (coding fine-tune) | GLM 5.3 (general fast) |
| Primary use | Code generation, debugging, agentic coding | General text, multimodal, enterprise workflows |
| Input price | $0.09 / 1M tokens | $0.14 / 1M tokens |
| Output price | $0.33 / 1M tokens | $0.52 / 1M tokens |
| Cache read | $0.0225 / 1M tokens | $0.04 / 1M tokens |
| Image / video input | Check console | Supported |
| Function calling | Supported | Supported |
| OpenAI-compatible | Yes | Yes |
| Best for | Coding AI products, CI integration, code assistants | Multimodal apps, Chinese content, general agents |
Prices are live from the TokenRa console and may vary with discounts. If your workload involves image or video inputs, GLM-5.3-Flash is the safer choice today.
Yes. glm-5.4 is live on TokenRa. Register, create an API key, and start calling the model immediately — no waitlist or separate approval required.
$0.09 per 1M input tokens, $0.33 per 1M output tokens, and $0.0225 per 1M cached-read tokens. Check the console for the latest pricing and any volume discounts currently active on your account.
glm-5.4 is a coding-focused fine-tune of GLM 5.4 with targeted optimization for code generation, debugging, and agentic programming. GLM-5.3-Flash is a general multimodal model that handles text, image, and video — a broader scope but not coding-specific. glm-5.4 is also slightly cheaper per token.
Yes. Set base_url to https://tokenra.io/v1 and model to glm-5.4. Any client library that supports the OpenAI Chat Completions interface works without modification.
Python, JavaScript, TypeScript, Go, Java, C, C++, Rust, SQL, and other mainstream languages are supported, with particular attention to code completion, refactoring, debugging, and documentation generation tasks.
Yes. Pass a tools array in your request and the model will decide when to invoke them. This makes it suitable for agentic workflows where the model needs to call external APIs, read files, or run tests as part of a multi-step coding task.
Set max_tokens to cap output length, leverage prompt caching for repeated context (system prompts, large code files), and configure a spend limit in the console. For batch jobs, test on a small sample before scaling.
The active limit is shown in the TokenRa console after you sign in. GLM 5.4-family models generally support large contexts well-suited to working with sizable codebases and long files. Confirm the current limit in the console before designing prompts that rely on a specific size.
Prices, limits, and features reflect what is active in the TokenRa console and may change with promotions or plan updates. Model capabilities are as published by Zhipu AI; TokenRa provides the API access layer and does not guarantee the accuracy of model outputs. Test thoroughly before deploying to production.