Skip to content

GLM โ€‹

Updated

Endpoint: https://mmu.vod-qcloud.com/v1Authentication: VOD ApiToken / Bearer

GLM is a text generation / chat model called through an OpenAI-compatible API, with JSON and SSE streaming responses. It supports the Chat Completions and Messages protocols, offers versions such as 5.1, 5, and 5-turbo, and can enable reasoning mode as needed.

Basic Information โ€‹

ItemValue
Call endpointhttps://mmu.vod-qcloud.com
AuthenticationVOD Application-issued ApiToken / Bearer
OutputText / Structured response
Response modeJSON / SSE

Supported Protocols โ€‹

SpecPathTarget
Chat CompletionsPOST /v1/chat/completionsAll models below
MessagesPOST /v1/messagesAll models below

The model IDs below use the corresponding spec. Authentication and common fields follow API Reference.

Sampling Options โ€‹

Commonly applies to all models listed in this document.

ParameterSetting
temperatureConfigurable
top_pConfigurable

temperature specifies the sampling temperature, and top_p specifies the cumulative probability range. Adjust centered on one method.

Per-Version Reasoning Settings โ€‹

Model IDConfigurationDisable
glm-5.1thinking_enabledCannot be disabled
glm-5-turbothinking_enabledfalse
glm-5thinking_enabledfalse

Based on Chat Completions. Reasoning content is read from reasoning_content, and the final answer from content. Do not pass a disable option to versions that cannot be disabled.

Request Parameters โ€‹

ParameterRequiredTypeDescription
modelRequiredStringA model ID from the per-version options table
messagesRequiredArrayConversation input for Chat Completions / Messages
max_tokensOptionalIntegerGeneration limit for Chat Completions / Messages. Required in Messages
streamOptionalBooleantrue: SSE / false: JSON

Request Examples โ€‹

Chat Completions โ€‹

json
{
  "model": "glm-5.1",
  "messages": [
    {
      "role": "user",
      "content": "Reply with exactly OK and nothing else."
    }
  ],
  "max_tokens": 512,
  "stream": false
}

Response โ€‹

json
{
  "id": "01a0de30-62c1-759a-a272-4c9750a9cebc",
  "object": "chat.completion",
  "model": "glm-5.1",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "OK",
        "reasoning_content": "1.  **Analyze the Request:**\n    *   Input: \"Reply with exactly OK and nothing else.\"\n    *   Constraint 1: Reply with \"OK\".\n    *   Constraint 2: Exactly that word, nothing else (no punctuation, no extra words, no formatting).\n\n2.  **Formulate the Output:**\n    *   Target string: \"OK\"\n\n3.  **Verify against constraints:**\n    *   Is it exactly \"OK\"? Yes.\n    *   Is there anything else? No.\n\n4.  **Final Output Generation:**\n    *   OK"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 13,
    "prompt_tokens_details": {
      "audio_tokens": 0,
      "cached_tokens": 0
    },
    "prompt_cached_tokens_details": {
      "audio_tokens": 0
    },
    "completion_tokens": 125,
    "completion_tokens_details": {
      "accepted_prediction_tokens": 0,
      "audio_tokens": 0,
      "reasoning_tokens": 0,
      "rejected_prediction_tokens": 0
    },
    "total_tokens": 138
  }
}

Messages โ€‹

json
{
  "model": "glm-5.1",
  "messages": [
    {
      "role": "user",
      "content": "Reply with exactly OK and nothing else."
    }
  ],
  "max_tokens": 512,
  "stream": false
}

Response โ€‹

json
{
  "id": "01a0de33-76c0-751e-9056-bd61bd234513",
  "model": "glm-5.1",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "thinking": "1.  **Analyze the Request:** The user is asking for a specific response: \"OK\" and nothing else.\n2.  **Formulate the Output:** The output must strictly be the string \"OK\" without any additional text, punctuation (beyond what constitutes \"OK\"), or newlines if possible (though a standard single newline at the end is usually unavoidable/system-level, the raw text should just be \"OK\").\n3.  **Verify Constraints:** Exactly \"OK\". No \"Sure\", no \"OK.\", no explanation.\n4.  **Final Output Generation:** OK",
      "type": "thinking"
    },
    {
      "text": "OK",
      "type": "text"
    }
  ],
  "stop_reason": "end_turn",
  "usage": {
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "input_tokens": 13,
    "output_tokens": 121
  }
}

Special Settings โ€‹

Pass conversation history in order in messages. In models that return reasoning, keep reasoning_content separate from the final answer. The generation limit also includes reasoning tokens, so specify a sufficiently large max_tokens for long reasoning tasks.

Built with VitePress ยท Deployed on Tencent EdgeOne Pages