GLM-5 API
GLM-5 is Z Ai's budget general chat model, priced at $0.58 per million input tokens and $2.58 per million output tokens. We ran our CacheSafety Bench on it: 50 prompts, zero upstream errors, zero bad hits. This page lists the public id you send to the OpenAI-compatible endpoint, what the bench numbers actually mean, and when to pick a different model instead.
| Input length | Input / 1M | Output / 1M | Cache hit / 1M |
|---|---|---|---|
| ≤ 32k | $0.58 | $2.58 | $0.12 |
| 32k - 200k | $0.86 | $3.16 | $0.18 |
What is GLM-5 API in NextModel?
GLM-5 is Z Ai's budget general chat model, priced at $0.58 per million input tokens and $2.58 per million output tokens. We ran our CacheSafety Bench on it: 50 prompts, zero upstream errors, zero bad hits. This page lists the public id you send to the OpenAI-compatible endpoint, what the bench numbers actually mean, and when to pick a different model instead.
GLM-5 via NextModel: 198k-token context; Starting at $0.58 / 1M tokens in / $2.58 / 1M tokens out per 1M tokens. Capabilities: streaming, tool, json.
Best use cases
- Your traffic is high-volume general chat or API workloads and token cost is the main line item.
- You need streaming and can work without a published context window.
- You want a model where exact-cache replay never served a stale answer in our measurements.
When not to use
- Your application depends on cache hits returning exact expected answers: measured safe hit rate is 30%.
- You need a published context window for capacity planning; the catalog does not list one.
- Your latency budget is under 5 seconds per call; that is what we observed in serial bench conditions.
OpenAI-compatible code example
curl https://api.nextmodel.app/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $NEXTMODEL_API_KEY" \
-d '{"model":"z-ai/glm-5","messages":[{"role":"user","content":"Reply with OK."}]}'Switching models only changes the model field.
Similar alternatives
Claude Sonnet 4.6 via NextModel: 1M-token context; $3 / 1M tokens in / $15 / 1M tokens out per 1M tokens. Capabilities: streaming, tool, json.
Gemini 3.1 Pro Preview via NextModel: 1M-token context; Starting at $2 / 1M tokens in / $12 / 1M tokens out per 1M tokens. Capabilities: streaming, tool, json.
MiniMax M2.5 via NextModel: 200k-token context; $0.31 / 1M tokens in / $1.22 / 1M tokens out per 1M tokens. Capabilities: streaming, tool, json.
Reading
Articles that explain GLM-5
GLM-5 CN cache safety review: family data only, CN still unmeasured
Family CacheSafety numbers, and a clear note that the CN id itself is unmeasured.
Lin Qiming
Bad Hit Rate: the metric every LLM cache needs
GLM-5's 30% Safe Hit Rate is not a raw cache hit rate. This is the metric definition.
Lin Qiming
Semantic Caching for LLM APIs: A Practical Guide
The bench used exact-cache semantics; a one-word-different prompt should miss.
Lin Qiming
How to estimate AI API cost before you ship
Use the listed $0.58 / $2.58 prices to size traffic before you ship.
Lin Qiming
FAQ
GLM-5 API questions
What model id do I send for GLM-5?
Send z-ai/glm-5 to https://api.nextmodel.app/v1 with your OpenAI SDK. If that id is missing from /v1/models, the page is stale.
How does GLM-5 perform on cache safety?
We measured the GLM-5 family API (z-ai/glm-5) with a 50-prompt bench run: Bad Hit Rate 0% (0 of 10 trap pairs served a stale answer), Semantic Trap Failure Rate 0% (0 of 10 fresh questions hit cache), Safe Hit Rate 30% (3 of 10 exact repeats replayed the expected answer). Small sample; treat as a signal, not a guarantee.
How does GLM-5 compare to GLM 5.1 and GLM 5.2?
GLM-5 is the cheapest of the family: $0.58 in / $2.58 out, versus $0.83 / $3.31 for GLM 5.1, $1.18 / $4.12 for GLM 5.2, and $1.40 / $4.40 for GLM 5.3 CN. We have bench data only for the GLM-5 id, so speed and quality comparisons between the siblings are unverified.
Start now
Ready to start building?
Passwordless signup, pay-as-you-go billing, and one OpenAI-compatible endpoint for every model. Create your key and send your first request in minutes.