impulse

GLM 5 Code

API id glm-5-code
Input / 1M
$1.20
at Z.ai
Output / 1M
$5.00
at Z.ai
Context window
200K
tokens
Max output
128K
tokens per reply
Hosts
1
1 listings
Released
-
date not published

Pricing

List prices at Z.ai, in US dollars per million tokens.

TierInput / 1MOutput / 1M
Standard$1.20$5.00
Cached input
75% off input
$0.30
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
Use your own numbers

Where to run it

1 host serve GLM 5 Code. The comparison is on blended price, 3 parts input to 1 part output.

HostIn / out per 1M
Z.aiLab API
glm-5-code
$1.20 / $5.00

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

  • GLM 5v Turbo
    Zhipu AI · on Z.ai
    $1.20 / $4.00
    Has every key capability
    12% less

Other frontier labs

  • GPT-6.1 Terra
    OpenAI · on OpenAI
    $1.00 / $5.00
    Has every key capability
    7% less
  • Gemini 3.8 Flash
    Google · on Google AI Studio
    $0.75 / $3.75
    Has every key capability
    30% less
  • Grok Build 0.1
    xAI · on xAI
    $1.00 / $2.00
    Has every key capability
    42% less
  • Claude Haiku 5.5
    Anthropic · on Anthropic
    $0.10 / $0.50
    Has every key capability
    91% less

Open-weight picks

  • Muse Spark Open
    Meta · on Baseten
    $1.25 / $4.25
    Has every key capability
    7% less
  • Inkling
    Independent · on DeepInfra
    $0.95 / $4.05
    Has every key capability
    20% less
  • GLM 5.3
    Zhipu AI · on CLF AI Gateway
    $0.56 / $1.76
    Has every key capability
    60% less
  • DeepSeek V4 Pro
    DeepSeek · on CLF AI Gateway
    $0.528 / $1.58
    Has every key capability
    63% less

Call it

Using Z.ai's API.

Python
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"
}