Anthropic API format for GLM Coding Plan
GLM Coding Plan supports both Anthropic API messages API format as well as OpenAI messages format.
So if you want to use the GLM Coding plan with say your Claude Code or an Claude SDK, you can use just change their base url and pass on your ZAI API key which should do the trick.
https://api.z.ai/api/anthropic
For example, your request will be something like this
curl -X POST https://api.z.ai/api/anthropic/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: $ZAI_API_KEY" \
-d '{
"model": "glm-5-turbo",
"max_tokens": 100,
"messages": [
{"role": "user", "content": "Why sky is blue?"}
]
}'