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

# GLM-5.3

> 通过 AnyFast OpenAI 兼容接口调用智谱 GLM-5.3 旗舰推理模型，支持 1M 上下文和 128K 输出。

GLM-5.3 是智谱面向复杂软件工程和长程智能体任务的旗舰文本模型。AnyFast 国内站使用模型 ID `glm-5.3` 提供 OpenAI 兼容接口。

## 模型规格

| 属性        | 取值                     |
| --------- | ---------------------- |
| 输入 / 输出模态 | 文本 / 文本                |
| 上下文窗口     | 1M Token               |
| 最大输出      | 128K Token（131072）     |
| 思考模式      | 始终开启                   |
| 推理强度      | `low`、`high`、`max`（默认） |

<Warning>
  GLM-5.3 不支持关闭思考。可以省略 `thinking`，或显式设置 `{ "type": "enabled" }`；不要传入 `disabled`。
</Warning>

## 快速示例

<CodeGroup>
  ```bash cURL theme={null}
  curl https://www.anyfast.com.cn/v1/chat/completions \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "glm-5.3",
      "messages": [{"role": "user", "content": "设计一个多地域可靠任务队列。"}],
      "thinking": {"type": "enabled"},
      "reasoning_effort": "max",
      "max_tokens": 4096
    }'
  ```

  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(api_key="YOUR_API_KEY", base_url="https://www.anyfast.com.cn/v1")
  response = client.chat.completions.create(
      model="glm-5.3",
      messages=[{"role": "user", "content": "审查这个架构的故障模式。"}],
      max_tokens=4096,
      extra_body={
          "thinking": {"type": "enabled"},
          "reasoning_effort": "high",
      },
  )
  print(response.choices[0].message.reasoning_content)
  print(response.choices[0].message.content)
  ```
</CodeGroup>

## 参数说明

| 参数                 | 类型      | 必填 | 说明                                   |
| ------------------ | ------- | -: | ------------------------------------ |
| `model`            | string  |  是 | 固定为 `glm-5.3`。                       |
| `messages`         | array   |  是 | 对话消息列表。                              |
| `thinking`         | object  |  否 | 仅支持 `{ "type": "enabled" }`；省略时仍会思考。 |
| `reasoning_effort` | string  |  否 | `low`、`high` 或 `max`，默认 `max`。       |
| `max_tokens`       | integer |  否 | `1`–`131072`，官方建议至少 1024。            |
| `temperature`      | number  |  否 | `0`–`1`，默认 `1`。                      |
| `top_p`            | number  |  否 | 核采样概率，默认 `0.95`。                     |
| `stream`           | boolean |  否 | 是否返回 SSE 流。                          |
| `tools`            | array   |  否 | Function 或 MCP 工具定义。                 |
| `response_format`  | object  |  否 | 文本或 JSON 对象格式。                       |

响应中的思考内容位于 `choices[0].message.reasoning_content`，最终答案位于 `choices[0].message.content`。

<Card title="API 参考" icon="code" href="/api-reference/model-api/zhipu/glm-5.3">
  查看 GLM-5.3 的交互式 API 参考。
</Card>

## 官方参考

* [GLM-5.3 模型文档](https://docs.bigmodel.cn/cn/guide/models/text/glm-5.3)
* [智谱对话补全 API](https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E5%AF%B9%E8%AF%9D%E8%A1%A5%E5%85%A8)

<script src="/feedback.js" />
