How to use GLM-5 via the GLM Coding Plan API
GLM-5 is getting launched now. Even though there is no offical annoncement about API support. If we just set the model id as glm-5 it does respond to it.
curl --location 'https://api.z.ai/api/coding/paas/v4/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Accept-Language: en-US,en' \
--header 'Authorization: Bearer $ZAI_API_KEY' \
--data '{
"model": "glm-5",
"messages": [
{
"role": "system",
"content": "You are a helpful AI assistant."
},
{
"role": "user",
"content": "Why sky is blue?"
}
],
"stream":true
}'