Skip to main content
Model ID

API Usage

You can interact with the GLM-5.1 model through multiple programming environments using a RESTful API. The examples below demonstrate how to call the model for text generation and function-calling tasks.

API Examples

Generate a Chat Completion

Use the chat completion endpoint to generate responses from the GLM-5 model.

Shell

Function Call Example