Z.ai (formerly Zhipu AI) serves its GLM models at https://api.z.ai/api/paas/v4 with an OpenAI-compatible chat API. There's also an Anthropic-compatible endpoint at https://api.z.ai/api/anthropic.
Create a key at z.ai. Send it as Authorization: Bearer <key>. In the examples it's written {{ZAI_API_KEY}}.
Full reference: https://docs.z.ai/api-reference/introduction
curl https://api.z.ai/api/paas/v4/chat/completions \
-H "Authorization: Bearer {{ZAI_API_KEY}}" \
-H "Content-Type: application/json" \
-d '{"model": "glm-5.3", "messages": [{"role": "user", "content": "Explain what an API rate limit is in two sentences."}]}'
The faster, cheaper variant.
curl https://api.z.ai/api/paas/v4/chat/completions \
-H "Authorization: Bearer {{ZAI_API_KEY}}" \
-H "Content-Type: application/json" \
-d '{"model": "glm-5.3-flash", "messages": [{"role": "user", "content": "Write a one-line commit message for fixing a typo."}]}'
curl https://api.z.ai/api/paas/v4/models \
-H "Authorization: Bearer {{ZAI_API_KEY}}"