GLM 5 Code
glm-5-codePricing
List prices at Z.ai, in US dollars per million tokens.
| Tier | Input / 1M | Output / 1M | |
|---|---|---|---|
| Standard | $1.20 | $5.00 | |
| Cached input 75% off input | $0.30 | 75% off input | |
| Cache write, 5 minutes | $0.00 |
What it costs a month
At Z.ai list prices, 30 days.
- Chat assistant5,000 requests a day, 2K in / 0.5K out, cached$654
- RAG over documents2,000 requests a day, 8K in / 0.6K out, cached$540
- Coding agent1,000 requests a day, 40K in / 2K out, cached$984
- Overnight batch20,000 requests a day, 4K in / 0.4K out$4,080
Where to run it
1 host serve GLM 5 Code. The comparison is on blended price, 3 parts input to 1 part output.
| Host | In / out per 1M | Model id | |
|---|---|---|---|
Z.aiLab API glm-5-code | $1.20 / $5.00 | glm-5-code |
Capabilities
Core
- Streaming
- Function calling
- JSON mode
- Structured outputs
Multimodal
- Vision
- Image input
- Audio
- Image generation
- Video
Advanced
- Reasoning
- Tool calling
- MCP
- Prompt caching
- Batch API
- Embeddings
- Takes in
- Text
- Produces
- Text
- Features
- Prompt caching
Cheaper alternatives
Current models that cost less and keep most of what this one can do: tools, vision, reasoning, structured output, caching and enough context.
Same model, cheaper host
No host sells it for less than Z.ai.
Smaller Zhipu AI models
- 12% less
Other frontier labs
- 7% less
- 30% less
- 42% less
- 91% less
Open-weight picks
- 7% less
- 20% less
- 60% less
- 63% less
Call it
Using Z.ai's API.
from litellm import completion
response = completion(
model="zai/glm-5-code",
messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)Quick answers
How much does GLM 5 Code cost?
On Z.ai, GLM 5 Code costs $1.20 per million input tokens and $5.00 per million output tokens. Cached input costs $0.30 per million tokens.
Which APIs offer GLM 5 Code?
GLM 5 Code runs on 1 API: Z.ai.
What is GLM 5 Code's context window?
200K tokens, with up to 128K tokens in one reply.
Is GLM 5 Code being retired?
No retirement date is scheduled for it on any API we track.
What are cheaper alternatives to GLM 5 Code?
Models that cost less and keep most of what it can do: GLM 5v Turbo on Z.ai (12% less), GPT-6.1 Terra on OpenAI (7% less), Gemini 3.8 Flash on Google AI Studio (30% less) and Muse Spark Open on Baseten (7% less). Savings are on a mix of 3 input tokens to 1 output token.
What is GLM 5 Code's API model id?
Use glm-5-code with Z.ai.
Sources
Raw catalog entry for glm-5-code on Z.ai
{
"cache_creation_input_token_cost": 0,
"cache_read_input_token_cost": 3e-7,
"input_cost_per_token": 0.0000012,
"output_cost_per_token": 0.000005,
"litellm_provider": "zai",
"max_input_tokens": 200000,
"max_output_tokens": 128000,
"mode": "chat",
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
"source": "https://docs.z.ai/guides/overview/pricing"
}