POST /paas/v4/chat/completions

Changed on

Create a chat completion model that generates AI replies for given conversation messages. It supports multimodal inputs (text, images, audio, video, file), offers configurable parameters (like temperature, max tokens, tool use), and supports both streaming and non-streaming output modes.

Request

  • Base URL
    https://api.z.ai/api
  • URL
    https://api.z.ai/api/paas/v4/chat/completions
  • Auth
    HTTP bearer

Headers

Accept-Language'en-US,en'

Config desired response language for HTTP requests.

Example:en-US,en

Request body

OR

Example request

{
  "model": "glm-5.3",
  "messages": [
    {
      "content": "What opportunities and challenges will the Chinese large model industry face in 2025?"
    }
  ],
  "do_sample": true,
  "thinking": {
    "clear_thinking": true
  },
  "reasoning_effort": "max",
  "temperature": 1,
  "top_p": 0.95,
  "max_tokens": 1024
}

Response

Processing successful

idstring

Task ID

request_idstring

Request ID

createdinteger

Request creation time, Unix timestamp in seconds

modelstring

Model name

Example response

{
  "choices": [
    {
      "message": {
        "role": "assistant"
      }
    }
  ]
}

Changes

    • info

      added the new glm-5.3-flashx-legal enum value to the request property /

    • breaking

      removed the enum value autoglm-phone-multilingual of the request property /

    • breaking

      removed the enum value glm-4-32b-0414-128k of the request property /

    • breaking

      removed the enum value glm-4.5 of the request property /

    • breaking

      removed the enum value glm-4.5-air of the request property /

    • breaking

      removed the enum value glm-4.5-airx of the request property /

    • breaking

      removed the enum value glm-4.5-flash of the request property /

    • breaking

      removed the enum value glm-4.5-x of the request property /

    • breaking

      removed the enum value glm-4.5v of the request property /

    • breaking

      removed the enum value glm-4.6v of the request property /

    • breaking

      removed the enum value glm-4.6v-flash of the request property /

    • breaking

      removed the enum value glm-4.6v-flashx of the request property /

    • breaking

      removed the enum value glm-4.7-flash of the request property /

    • breaking

      removed the enum value glm-4.7-flashx of the request property /

    • warning

      removed the optional property /// from the response with the status