Z.ai API Proxy

Status

Operational

API Endpoints

Usage Examples

OpenAI format:

curl /v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "glm-5",
    "messages": [{"role": "user", "content": "Hello"}],
    "stream": true
  }'

Anthropic format:

curl /v1/messages \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "glm-5",
    "messages": [{"role": "user", "content": "Hello"}],
    "stream": true
  }'

Configuration

Variable Description Default
ZAI_API_KEY API key for authentication -
ZAI_RATE_LIMIT Requests per window 120
ZAI_RATE_WINDOW Window size (seconds) 60
ZAI_MODELS_CACHE_TTL Models cache TTL (seconds) 60
ZAI_DEFAULT_THEME Default theme (dark/light) dark