nexusflow
Online
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.

POSThttps://nexusflow.hk/v1/chat/completions

This is the default example endpoint. For multi-protocol usage, see Multi-Protocol Support, Anthropic Messages, and Responses API.

Models

Model IDDescriptionContextTier 1 Input/1MTier 1 Output/1M
glm-5.2GLM-5.2 flagship for long-horizon tasks, 1M context1M$8$28
glm-5.1GLM-5.1 enhanced flagship198K$6$24
glm-5GLM-5 flagship model198K$4$18
glm-4.7GLM-4.7 general-purpose model166K$3$14

Request Examples

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
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
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
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"
  }'
Chat Completions
View the full chat API documentation
Quick Start
5-minute integration guide
Full Pricing
View pricing for all models