messages | array | Yes | Conversation so far. Empty array is rejected (messages is required). See Message format. |
model | string | No | A logical ID from GET /v1/models, such as z-ai/glm-5.2. Append :confidential for a model that serves the Confidential level. :encrypted for the Encrypted level, with the Encrypted headers. |
temperature | number | No | Sampling temperature. Nil passthrough. |
top_p | number | No | Nucleus sampling. Nil passthrough. |
max_tokens | integer | No | Cap on generated tokens. |
max_completion_tokens | integer | No | Newer alias for the completion cap. |
stream | boolean | No | Stream the reply as Server-Sent Events. See SSE transport. |
stream_options.include_usage | boolean | No | Append a trailing usage chunk to the stream. See Stream termination. |
reasoning | object | No | Ask a capable model to think first. See Reasoning parameters. |
reasoning_effort | string | No | Flat OpenAI-style effort: minimal, low, medium, or high. A nested reasoning.effort wins when both are present. |
response_format | object | No | {"type":"json_object"} on models that advertise json_mode; {"type":"json_schema", ...} on models that advertise structured_outputs. |
prompt_cache_key | string | No | Provider cache affinity key, forwarded where the route supports it. |
cache_control | object | No | Provider cache hints (raw JSON object), passed through. Model must support it. |
web_search | bool or object | No | Search the web and ground the prompt before the model answers. |
web_fetch | boolean | No | Fetch URLs named in the prompt before the model answers. |
tools | array | No | Function tools and hosted tools. See Tool calling. |
tool_choice | string or object | No | auto / none / required, or {type, function:{name}}. |
user | string | No | Opaque end-user identifier for your own bookkeeping. |