Key Capabilities
- OpenAI-compatible — Drop-in replacement for the OpenAI SDK, no other code changes needed
- Long context — supports large document processing and multi-turn conversations
- Streaming output — Real-time token streaming via SSE
- Strong reasoning — Suitable for complex multi-step tasks
Quick Example
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Fixed value: glm-4.7 |
messages | array | Yes | Array of objects { role, content } |
max_tokens | integer | No | Maximum number of tokens to generate |
temperature | float | No | 0–2, controls randomness, default 1 |
stream | boolean | No | Enable SSE streaming, default false |
top_p | float | No | Nucleus sampling threshold, default 1 |
stop | string / array | No | Sequences that trigger stop generation |
API Reference
View the interactive API Playground for GLM-4-7.

