Z Ai model

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.

Z AiPlatform curatedCatalog
Input priceStarting at $0.58 / 1M tokens
Output price$2.58 / 1M tokens
Context length198k tokens
Max output8.2k tokens
Input lengthInput / 1MOutput / 1MCache 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

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

Try it in the playground

Similar alternatives

AnthropicCatalog

Claude Sonnet 4.6 via NextModel: 1M-token context; $3 / 1M tokens in / $15 / 1M tokens out per 1M tokens. Capabilities: streaming, tool, json.

$3 / 1M tokensInput$15 / 1M tokensOutput1MContext
Best forimage understanding, multimodal chat
StreamingTool callingJSON modeVision
Platform curatedCurated and maintained in the NextModel catalog
View details
GoogleCatalog

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.

Starting at $2 / 1M tokensInput$12 / 1M tokensOutput1MContext
Best forimage understanding, multimodal chat
StreamingTool callingJSON modeVision
Platform curatedCurated and maintained in the NextModel catalog
View details
MiniMaxCatalog

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.

$0.31 / 1M tokensInput$1.22 / 1M tokensOutput200kContext
Best forChinese Q&A, general chat
StreamingTool callingJSON modeLong context
Platform curatedCurated and maintained in the NextModel catalog
View details

Reading

Articles that explain GLM-5

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.