All models
Z.ai

GLM-5.1 API: pricing, base URL and quick setup

GLM-5.1 is available on A2Agent as glm-5.1 at $1.15 per 1M input tokens, with a 200K context window, through one OpenAI-compatible endpoint. Coding sessions on Z.ai that fit inside 200K.

Specifications and pricing

Model idglm-5.1
PlatformZ.ai
Context window200K
Tagged forchat, coding
Discount
Input / 1M tokens$1.15
Output / 1M tokens$4.00

Prices synced with platform billing (USD per 1M tokens).

Quick setup

curl https://a2agent.me/v1/chat/completions \
  -H "content-type: application/json" \
  -H "authorization: Bearer sk-your-a2agent-key" \
  -d '{
    "model": "glm-5.1",
    "messages": [{"role": "user", "content": "Reply with OK"}]
  }'

Using it from a coding client

200K covers most single-repository work in Cline or Claude Code without chunking. For a cheap second opinion on the same diff, the coding-tagged MiniMax models run at a fraction of this rate.

How it compares within its family

GLM-5.1 shares its 200K window with GLM-5 and carries the coding tag where GLM-5 carries agent. It lists at $1.15 per million input tokens and $4.00 output, a little above the $1.00 and $3.20 of GLM-5, and a little under the $1.40 and $4.40 that GLM-5.2 and GLM-5.3 both list. What the extra money does not buy is context: 5.1 stays at 200K while 5.2 and 5.3 reach 1M. That makes 5.1 the pick when the work is code, the repository fits, and you would rather not pay 1M rates for a window you will not fill. Once sessions start spilling past 200K, GLM-5.3 is the next step rather than another round of prompt trimming.

Other models on this platform

Questions

Which GLM should I use for coding?

GLM-5.1 is the coding-tagged model at 200K. GLM-5.2 and GLM-5.3 are coding-tagged at 1M and cost more per token.

What is the context window?

200K tokens, the same as GLM-5.

Why does it cost more than GLM-5?

Different tuning, same window. GLM-5 is tagged for agent work and lists at $1.00 and $3.20; GLM-5.1 is tagged for coding at $1.15 and $4.00.

Can I use it inside VS Code?

Yes, through Cline or any extension that speaks the OpenAI Chat Completions API. Setup is a base URL, a key and this model id.

Trial credit on sign-up, billed per token, no minimum spend.