GLM 5.2
Chat
General text-in / text-out. Streaming + tool-calling.
§ 01
Chat completions
POST /v1/chat/completions — OpenAI-compatible endpoint. Streaming via SSE is supported when stream: true.
§ 02
Streaming
With stream: true, Server-Sent Events are returned in the OpenAI format — the same delta structure you're used to.
§ 03
Tool calling (function calling)
Define tools the model can call via tools. GLM 5.2 responds with tool_calls in the assistant message; you run the function yourself and send the result back with role: "tool".