Skip to content
OpenKey

GLM 5.1

Z.aiReleased Apr 7, 2026

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...

Try in playground
Context window
203K tokens
Input
text
Output
text
Tokenizer
Other
Released
Apr 7, 2026
Reasoning
optional

Pricing

Per 1M tokens. The provider price and our flat 3% fee are separate columns — what you pay is their sum.

Per 1M tokensProvider+ 3% feeYou pay
Input$0.975$0.029$1.00
Output$4.30$0.129$4.43

Benchmarks

Artificial Analysis

Intelligence index
40.2
Coding index
55.8
Agentic index
29.9

Design Arena

CategoryEloWin rateRank
3Dmodels134363.9%#5
ASCII artmodels118149.2%#31
Codemodels133260.3%#5
Data vizmodels136667%#2
Game devmodels133962%#6
SVGmodels128562.1%#5
UI componentsmodels134062.5%#4
Websitesmodels131757.2%#7
agenticgamedevagents121654.1%#4
agentichtmlslidesagents120552%#6
agenticslidesagents124554.4%#3
agenticslides(html)agents120451.8%#6
agenticslides(python-pptx)agents124053.3%#4
androidnativeagents124453.8%#7
Full-stackagents123356.9%#8
godotgamedevagents123655.9%#4
htmlslidesagents120652.7%#7
Mobile appsagents123655.4%#7
pptxslidesagents124153.5%#4
python-pptxslidesagents125854.2%#3
Web appsagents124355.1%#10

Head-to-head preference voting. How we filter and rank

Supported parameters

  • frequency_penalty
  • include_reasoning
  • logit_bias
  • logprobs
  • max_tokens
  • min_p
  • parallel_tool_calls
  • presence_penalty
  • reasoning
  • reasoning_effort
  • repetition_penalty
  • response_format
  • seed
  • stop
  • structured_outputs
  • temperature
  • tool_choice
  • tools
  • top_k
  • top_logprobs
  • top_p

Call it

OpenAI-compatible: point your SDK at api.openkey.ai/v1 and use model z-ai/glm-5.1.

Code sample language
curl https://api.openkey.ai/v1/chat/completions \
  -H "Authorization: Bearer $OPENKEY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-ai/glm-5.1",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.openkey.ai/v1",
    api_key=os.environ["OPENKEY_API_KEY"],
)

completion = client.chat.completions.create(
    model="z-ai/glm-5.1",
    messages=[{"role": "user", "content": "Hello"}],
)
print(completion.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.openkey.ai/v1",
  apiKey: process.env.OPENKEY_API_KEY,
});

const completion = await client.chat.completions.create({
  model: "z-ai/glm-5.1",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(completion.choices[0].message.content);

Questions

How much does GLM 5.1 cost via API?
Through OpenKey, GLM 5.1 costs $1.00 per 1M input tokens and $4.43 per 1M output tokens. That is the provider price ($0.975 / $4.30) plus a flat 3% fee — nothing else.
What is GLM 5.1's context window?
GLM 5.1 accepts up to 203K tokens of context.
Is GLM 5.1 OpenAI-compatible?
Yes. Send requests to OpenKey's /v1/chat/completions endpoint with model "z-ai/glm-5.1" using any OpenAI SDK — only the base URL and API key change.
What inputs does GLM 5.1 support?
GLM 5.1 accepts text input and produces text output.

More from Z.ai

All Z.ai models →