> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyfast.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# glm-5.3

> 根据对话消息生成 GLM-5.3 响应。GLM-5.3 始终开启思考；thinking.type 只能为 enabled，reasoning_effort 只能为 low、high 或 max。



## OpenAPI

````yaml zh/api-reference/model-api/zhipu/openapi/glm-5.3/openapi.yaml POST /v1/chat/completions
openapi: 3.1.0
info:
  title: GLM-5.3
  description: 通过 AnyFast OpenAI 兼容接口调用智谱 GLM-5.3 旗舰推理模型。
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /v1/chat/completions:
    post:
      summary: 创建 GLM-5.3 对话补全
      description: >-
        根据对话消息生成 GLM-5.3 响应。GLM-5.3 始终开启思考；thinking.type 只能为
        enabled，reasoning_effort 只能为 low、high 或 max。
      operationId: createChatCompletionGlm53Zh
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - messages
              properties:
                model:
                  type: string
                  enum:
                    - glm-5.3
                  description: 模型 ID，必须为 glm-5.3。
                  example: glm-5.3
                messages:
                  type: array
                  minItems: 1
                  description: 按时间顺序排列的完整对话消息。
                  items:
                    type: object
                    required:
                      - role
                      - content
                    properties:
                      role:
                        type: string
                        enum:
                          - system
                          - user
                          - assistant
                          - tool
                        description: 消息角色。
                      content:
                        type: string
                        description: 消息的文本内容。
                      name:
                        type: string
                        description: 可选的参与者或工具名称。
                      tool_call_id:
                        type: string
                        description: role 为 tool 时对应的工具调用 ID。
                  example:
                    - role: system
                      content: 你是一名资深软件工程师。
                    - role: user
                      content: 请设计一个可靠的分布式任务队列。
                thinking:
                  type: object
                  description: 省略此字段时仍默认开启思考；GLM-5.3 不接受 disabled。
                  properties:
                    type:
                      type: string
                      enum:
                        - enabled
                      default: enabled
                      description: 仅支持 enabled。
                reasoning_effort:
                  type: string
                  enum:
                    - low
                    - high
                    - max
                  default: max
                  description: 推理强度：low 为轻量推理，high 为增强推理，max 为深度推理。
                stream:
                  type: boolean
                  default: false
                  description: 为 true 时通过 SSE 流式返回响应增量。
                do_sample:
                  type: boolean
                  default: true
                  description: 是否启用采样；为 false 时忽略 temperature 和 top_p。
                temperature:
                  type: number
                  format: float
                  minimum: 0
                  maximum: 1
                  default: 1
                  description: 采样温度。通常只调整 temperature 或 top_p 其中一个。
                  example: 1
                top_p:
                  type: number
                  format: float
                  minimum: 0
                  maximum: 1
                  default: 0.95
                  description: 核采样阈值，AnyFast 接受 0 到 1。
                  example: 0.95
                max_tokens:
                  type: integer
                  minimum: 1
                  maximum: 131072
                  default: 65536
                  description: 最大生成 Token 数，智谱建议不小于 1024。
                tool_stream:
                  type: boolean
                  default: false
                  description: 开启流式响应时，是否流式返回 Function Call。
                tools:
                  type: array
                  description: 模型可使用的 Function 或 MCP 工具定义。
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        example: function
                      function:
                        type: object
                        properties:
                          name:
                            type: string
                          description:
                            type: string
                          parameters:
                            type: object
                            additionalProperties: true
                tool_choice:
                  type: string
                  enum:
                    - auto
                  description: 工具选择策略。
                stop:
                  type: array
                  maxItems: 4
                  description: 最多四个停止词。
                  items:
                    type: string
                response_format:
                  type: object
                  description: 选择普通文本或 JSON 对象输出。
                  properties:
                    type:
                      type: string
                      enum:
                        - text
                        - json_object
                      default: text
                request_id:
                  type: string
                  minLength: 6
                  maxLength: 64
                  description: 客户端提供的唯一请求 ID。
                user_id:
                  type: string
                  minLength: 6
                  maxLength: 128
                  description: 不含敏感信息的终端用户标识。
            example:
              model: glm-5.3
              messages:
                - role: user
                  content: Reply with exactly OK.
              max_tokens: 128
      responses:
        '200':
          description: 成功生成响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletion'
              example:
                id: 20260819113252725deddc07234b73
                object: chat.completion
                created: 1787110376
                model: glm-5.3
                choices:
                  - index: 0
                    message:
                      role: assistant
                      reasoning_content: 用户要求只返回一个简短的固定结果，因此最终回答应为 OK。
                      content: OK
                    finish_reason: stop
                usage:
                  prompt_tokens: 17
                  completion_tokens: 91
                  completion_tokens_details:
                    reasoning_tokens: 88
                  prompt_tokens_details:
                    cached_tokens: 0
                  total_tokens: 108
        '400':
          description: 请求无效，包括关闭思考或数值参数超出范围。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: 该模型始终思考，不支持关闭思考；请使用 low、high 或 max。
                  type: upstream_error
                  param: ''
                  code: '1210'
        '401':
          description: API Key 缺失或无效
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 超过限流
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ChatCompletion:
      type: object
      required:
        - id
        - object
        - created
        - model
        - choices
      properties:
        id:
          type: string
          description: 对话补全 ID。
        request_id:
          type: string
          description: 请求 ID。
        object:
          type: string
          example: chat.completion
        created:
          type: integer
          description: Unix 秒级时间戳。
        model:
          type: string
          example: glm-5.3
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              message:
                type: object
                properties:
                  role:
                    type: string
                    example: assistant
                  content:
                    type: string
                    description: 最终回答文本。
                  reasoning_content:
                    type: string
                    description: 最终回答前生成的推理内容。
                  tool_calls:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        function:
                          type: object
                          properties:
                            name:
                              type: string
                            arguments:
                              type: string
              finish_reason:
                type: string
                enum:
                  - stop
                  - length
                  - tool_calls
                  - content_filter
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            completion_tokens:
              type: integer
            completion_tokens_details:
              type: object
              properties:
                reasoning_tokens:
                  type: integer
                  description: 推理使用的 Token 数。
            prompt_tokens_details:
              type: object
              properties:
                cached_tokens:
                  type: integer
                  description: 命中缓存的输入 Token 数。
            total_tokens:
              type: integer
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            type:
              type: string
            param:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key

````