v1

latestOpenAPI 3.0.1Z.AI Developer Agreement and Policy2026-07-131458163.2 KB

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.

post/paas/v4/chat/completions

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.2",
  "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"
      }
    }
  ]
}
All 14 operations