z-ai/glm-5.1

Z.ai: GLM 5.1

Context length
205K
Input / 1M tokens
$0.97
Output / 1M tokens
$3.04
Released
2026-04-07
Modality
text->text

About Z.ai: GLM 5.1

GLM-5.1 delivers a major leap in coding capability, with particularly significant gains in handling long-horizon tasks. Unlike previous models built around minute-level interactions, GLM-5.1 can work independently and continuously on...

Call Z.ai: GLM 5.1

Via OpenRouter: one base URL for every provider.

curl https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-ai/glm-5.1",
    "messages": [{"role": "user", "content": "Say hello"}]
  }'

Direct on Zhipu / Z.ai (GLM):

curl https://api.z.ai/api/paas/v4/chat/completions \
  -H "Authorization: Bearer $ZHIPU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.1",
    "messages": [{"role": "user", "content": "Say hello"}]
  }'

Zhipu / Z.ai (GLM) keys

OpenRouter keys

OpenRouter keys work for z-ai/glm-5.1 regardless of the upstream provider.