GLM-5.1 API: pricing, base URL and quick setup
Use GLM-5.1 on A2Agent with model ID glm-5.1. The catalog lists a 200K context window. Check token rates below and verify the features your app needs.
Specifications and pricing
| Model ID | glm-5.1 |
|---|---|
| Platform | Z.ai |
| Context window | 200K |
| Tagged for | chat, coding |
| Discount | — |
| Input / 1M tokens | $1.15 |
| Output / 1M tokens | $4.00 |
USD per 1M tokens. Final billing depends on your API key group and metered usage.
What GLM-5.1 costs on A2Agent
Prices on this page come from the live catalog. Compare the official price with the A2Agent price in the table above, then multiply by your monthly token volume.
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
In Cline or Claude Code, leave room for tool results and generated code within the 200K limit. Compare billed usage on the same task before choosing a larger model.
How it compares within its family
These comparisons use catalog context limits, tags and reference rates, not independent quality benchmarks. Rates can change. Check current pricing above and test your workload; a higher price or a larger context window does not establish better results.
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
- GLM-5200K
- GLM-5.21M
- GLM-5.31M
- GLM-5.3 Flash1M
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?
The catalog lists different tags at the same window size. 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.
Billed per token. Top up from $5, no top-up fee.
