Zhipu AI / GLM GLM Series Models API Zhipu AI GLM series large models offer strong Chinese understanding and excellent overall capability. GLM text-type models can be called via OpenAI Chat Completions, Anthropic Messages, and Gemini-compatible GenerateContent — three public protocols.
Model List Model ID Description Context Input / 1M tokens Output / 1M tokens glm-5.1GLM-5.1 Enhanced flagship 131K $6 $24 glm-5GLM-5 flagship model 131K $4 $18 glm-4.7GLM-4.7 general-purpose model 131K $3 $14
Request Example cURL Python
Copy curl https://nexusflow.vip/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5",
"messages": [
{"role": "user", "content": "Explain the principles of quantum entanglement"}
],
"stream": true
}'Three Protocol cURL Examples GLM text-type models share the same NexusFlow model ID, API key, balance, usage, and billing records.
OpenAI Chat Completions /v1/chat/completions
Copy curl -X POST 'https://nexusflow.vip/v1/chat/completions' \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.1",
"messages": [
{"role": "user", "content": "Only reply OK"}
],
"max_tokens": 8
}'Anthropic Messages /v1/messages
Copy curl -X POST 'https://nexusflow.vip/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": "Only reply OK"}
]
}'Gemini-compatible GenerateContent /v1beta/models/glm-5.1:generateContent
Copy curl -X POST 'https://nexusflow.vip/v1beta/models/glm-5.1:generateContent' \
-H "x-goog-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"role": "user",
"parts": [{"text": "Only reply OK"}]
}
],
"generationConfig": {
"maxOutputTokens": 8
}
}'