Skip to main content
POST
Create a GLM-5.3 chat completion

Authorizations

Authorization
string
header
required

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

Body

application/json
model
enum<string>
required

Model ID. Must be glm-5.3.

Available options:
glm-5.3
Example:

"glm-5.3"

messages
object[]
required

The complete conversation in chronological order.

Minimum array length: 1
Example:
thinking
object

Thinking configuration. Thinking remains enabled when this field is omitted. GLM-5.3 does not accept disabled.

reasoning_effort
enum<string>
default:max

Thinking intensity. Use low for lightweight reasoning, high for enhanced reasoning, or max for deep reasoning.

Available options:
low,
high,
max
stream
boolean
default:false

Streams partial response deltas over SSE when true.

do_sample
boolean
default:true

Enables sampling. When false, temperature and top_p are ignored.

temperature
number<float>
default:1

Sampling temperature. Adjust either temperature or top_p, not both.

Required range: 0 <= x <= 1
Example:

1

top_p
number<float>
default:0.95

Nucleus sampling threshold. AnyFast accepts values from 0 to 1.

Required range: 0 <= x <= 1
Example:

0.95

max_tokens
integer
default:65536

Maximum generated tokens. Zhipu AI recommends at least 1024.

Required range: 1 <= x <= 131072
tool_stream
boolean
default:false

Streams Function Call output when streaming is enabled.

tools
object[]

Function or MCP tool definitions available to the model.

tool_choice
enum<string>

Controls tool selection.

Available options:
auto
stop
string[]

Up to four sequences that stop generation.

Maximum array length: 4
response_format
object

Selects text or JSON object output.

request_id
string

Client-provided unique request ID.

Required string length: 6 - 64
user_id
string

Non-sensitive identifier for the end user.

Required string length: 6 - 128

Response

Completion generated successfully

id
string
required

Completion ID.

object
string
required
Example:

"chat.completion"

created
integer
required

Unix timestamp in seconds.

model
string
required
Example:

"glm-5.3"

choices
object[]
required
request_id
string

Request ID.

usage
object