Skip to main content
Tired of limits? GLM Coding Plan — monthly access to world-class model GLM-4.6, compatible with top coding tools like Claude Code and Cline. All from just $3/month. Try it now →

Getting Started

1

Get API Key

4

Make API Call

After preparing your API Key and selecting a model, you can start making API calls. Here are examples using curl, Python SDK, and Java SDK:
  • cURL
  • Official Python SDK
  • Official Java SDK
  • OpenAI Python SDK
  • OpenAI NodeJs SDK
  • OpenAI Java SDK
curl -X POST "https://api.z.ai/api/paas/v4/chat/completions" \
-H "Content-Type: application/json" \
-H "Accept-Language: en-US,en" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
    "model": "glm-4.6",
    "messages": [
        {
            "role": "system",
            "content": "You are a helpful AI assistant."
        },
        {
            "role": "user",
            "content": "Hello, please introduce yourself."
        }
    ]
}'

Get More

⌘I