glm_chat_completions
Create chat completions using Zhipu GLM models through AceDataCloud API. Handles Chinese language understanding, generation, and reasoning. Send messages to get responses.
Instructions
Create a GLM chat completion using the AceDataCloud GLM API.
Sends messages to the specified GLM model and returns the generated response.
Supports all GLM models: glm-5.2, glm-5, glm-5-turbo, glm-5.1, glm-4.7, glm-4.6, glm-3-turbo.
Use this when:
- You need to chat with a Zhipu GLM model
- You need Chinese language understanding or generation
- You want to use GLM's reasoning capabilities
Returns:
JSON response containing the chat completion result.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | How many chat completion choices to generate. Default 1. | |
| seed | No | Random seed for deterministic sampling. | |
| stop | No | Stop sequences where the API will stop generating tokens. | |
| user | No | End-user identifier for abuse monitoring. | |
| audio | No | Parameters for audio output. | |
| model | No | The GLM model to use. Options: glm-5.2, glm-5, glm-5-turbo, glm-5.1, glm-4.7, glm-4.6, glm-3-turbo. Default is glm-5.2. | glm-5.2 |
| store | No | Whether to store the output of this request. Default False. | |
| tools | No | List of tools the model may call. | |
| top_p | No | Nucleus sampling probability mass. Default 1. | |
| stream | No | Whether to stream partial message deltas. Default False. | |
| logprobs | No | Whether to return log probabilities of output tokens. Default False. | |
| messages | Yes | Conversation messages. Each message is a dict with 'role' and 'content' keys. Required. | |
| metadata | No | Key-value pairs for storing additional information. | |
| logit_bias | No | Modify the likelihood of specified tokens appearing in the completion. | |
| max_tokens | No | Maximum number of tokens to generate. | |
| modalities | No | Output types to generate (e.g. ['text', 'audio']). | |
| prediction | No | Static predicted output content for latency reduction. | |
| temperature | No | Sampling temperature between 0 and 2. Higher = more random. Default 1. | |
| tool_choice | No | Controls which tool is called. Can be 'none', 'auto', or a dict. | |
| service_tier | No | Service tier: auto, default, flex, scale, priority. Default auto. | |
| top_logprobs | No | Number of most likely tokens to return at each token position. | |
| stream_options | No | Options for streaming response. | |
| response_format | No | Response format specification (e.g. {"type": "json_object"}). | |
| presence_penalty | No | Presence penalty between -2.0 and 2.0. Positive values increase topic variety. Default 0. | |
| reasoning_effort | No | Reasoning effort level: minimal, low, medium, high. Default medium. | |
| frequency_penalty | No | Frequency penalty between -2.0 and 2.0. Positive values decrease repetition. Default 0. | |
| web_search_options | No | Options for web search tool. | |
| parallel_tool_calls | No | Enable parallel function calling. Default True. | |
| max_completion_tokens | No | Upper bound for tokens that can be generated for a completion. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |