GLM 5.2 API
Complete API reference for GLM 5.2 LLM models powered by Z.ai.
Model Variants
This API supports one model variant:
Quick Comparison
GLM 5.2 Text to Text
Endpoint
http
Request Parameters
Required
Message Support
Optional
Example Request
javascript
Response Format
GLM 5.2 returns OpenAI-compatible completion responses. With stream: true, the response is Server-Sent Events; with stream: false, the response is a single JSON object.
Best Practices
- GLM 5.2 currently supports text-only input through this route.
- Use
top_pandtop_ktogether when you need tighter control over output diversity. - Keep prompts structured when generating long-form content or code.