Skip to main content
POST
创建 GLM-5.3 对话补全

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
model
enum<string>
必填

模型 ID,必须为 glm-5.3。

可用选项:
glm-5.3
示例:

"glm-5.3"

messages
object[]
必填

按时间顺序排列的完整对话消息。

Minimum array length: 1
示例:
thinking
object

省略此字段时仍默认开启思考;GLM-5.3 不接受 disabled。

reasoning_effort
enum<string>
默认值:max

推理强度:low 为轻量推理,high 为增强推理,max 为深度推理。

可用选项:
low,
high,
max
stream
boolean
默认值:false

为 true 时通过 SSE 流式返回响应增量。

do_sample
boolean
默认值:true

是否启用采样;为 false 时忽略 temperature 和 top_p。

temperature
number<float>
默认值:1

采样温度。通常只调整 temperature 或 top_p 其中一个。

必填范围: 0 <= x <= 1
示例:

1

top_p
number<float>
默认值:0.95

核采样阈值,AnyFast 接受 0 到 1。

必填范围: 0 <= x <= 1
示例:

0.95

max_tokens
integer
默认值:65536

最大生成 Token 数,智谱建议不小于 1024。

必填范围: 1 <= x <= 131072
tool_stream
boolean
默认值:false

开启流式响应时,是否流式返回 Function Call。

tools
object[]

模型可使用的 Function 或 MCP 工具定义。

tool_choice
enum<string>

工具选择策略。

可用选项:
auto
stop
string[]

最多四个停止词。

Maximum array length: 4
response_format
object

选择普通文本或 JSON 对象输出。

request_id
string

客户端提供的唯一请求 ID。

Required string length: 6 - 64
user_id
string

不含敏感信息的终端用户标识。

Required string length: 6 - 128

响应

成功生成响应

id
string
必填

对话补全 ID。

object
string
必填
示例:

"chat.completion"

created
integer
必填

Unix 秒级时间戳。

model
string
必填
示例:

"glm-5.3"

choices
object[]
必填
request_id
string

请求 ID。

usage
object