Zhipu AI GLM Model API Zhipu AI's GLM model family offers strong language understanding and excellent all-round performance. GLM text models can be called via three public protocols: OpenAI Chat Completions, Anthropic Messages, and Responses API.
Models Model ID Description Context Tier 1 Input/1M Tier 1 Output/1M glm-5.2GLM-5.2 flagship for long-horizon tasks, 1M context 1M $8 $28 glm-5.1GLM-5.1 enhanced flagship 198K $6 $24 glm-5GLM-5 flagship model 198K $4 $18 glm-4.7GLM-4.7 general-purpose model 166K $3 $14
Request Examples cURL Python
Copy curl https://nexusflow.hk/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5",
"messages": [
{"role": "user", "content": "Explain the principle of quantum entanglement"}
],
"stream": true
}'Three-Protocol cURL Examples GLM text models share the same NexusFlow model IDs, API keys, balance, usage, and billing records.
OpenAI Chat Completions /v1/chat/completions
Copy curl -X POST 'https://nexusflow.hk/v1/chat/completions' \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.1",
"messages": [
{"role": "user", "content": "Reply with OK only"}
],
"max_tokens": 8
}'Anthropic Messages /v1/messages
Copy curl -X POST 'https://nexusflow.hk/v1/messages' \
-H "x-api-key: $API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.1",
"max_tokens": 8,
"messages": [
{"role": "user", "content": "Reply with OK only"}
]
}'Responses API /v1/responses
Copy curl https://nexusflow.hk/v1/responses \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.1",
"input": "Reply with OK only"
}'