temperature | number | no | 1 | Sampling temperature. Lower values are more deterministic. · Range: 0 – 1 |
top_p | number | no | 0.95 | Nucleus sampling cutoff. · Range: 0.01 – 1 |
max_tokens | number | no | 4096 | Maximum output tokens. · Range: 1 – 32768 |
stop | array | no | - | Stop word list. Z.AI currently supports one stop string in array form. |
do_sample | boolean | no | true | Enable sampling. When false, temperature and top_p do not affect generation. |
enable_thinking | boolean | no | true | Turns thinking on or off. On by default; when on, the model decides whether to think. |
thinking | object | no | - | Advanced thinking object. Use {“type”:“enabled”} or {“type”:“disabled”}. When enabled, the model decides whether to think. |
tools | array | no | - | Function tools and the built-in web_search tool are supported. |
tool_choice | enum | no | "auto" | Only auto is supported. Omit tools to disable tool use. · Allowed: auto |
tool_stream | boolean | no | false | Stream function-call tool output when stream is true. Z.AI documents tool_stream for GLM-4.6 and newer models. |
tool_web_search | boolean | no | false | Enable built-in web search. Adds $0.033 per request when enabled. |
search_result | boolean | no | true | Return structured web search result metadata when web search is enabled. |
search_prompt | string | no | - | Optional instruction for summarizing retrieved web search results. |
count | number | no | 10 | Number of web search results to retrieve. · Range: 1 – 50 |
search_domain_filter | string | no | - | Optional domain whitelist for web search results. |
search_recency_filter | enum | no | "noLimit" | Optional web search recency window. · Allowed: oneDay, oneWeek, oneMonth, oneYear, noLimit |
response_format | enum | no | - | Return the output as a valid JSON object (JSON mode). Describe the fields you want in your prompt. |