Skip to content

Instantly share code, notes, and snippets.

@balazsbohonyi
Created January 25, 2026 00:05
Show Gist options
  • Select an option

  • Save balazsbohonyi/cd3c7dc80f9521f6d71beb4bbb2ebcdf to your computer and use it in GitHub Desktop.

Select an option

Save balazsbohonyi/cd3c7dc80f9521f6d71beb4bbb2ebcdf to your computer and use it in GitHub Desktop.
Setting up Z.AI GLM-4.7 with Claude Code
# Add this to your ~/.bashrc file and then just launch claude like this: claude-zai
export ZAI_API_KEY="<your_api_key_here>"
claude-zai() {
ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic" \
ANTHROPIC_AUTH_TOKEN="$ZAI_API_KEY" \
API_TIMEOUT_MS="3000000" \
ANTHROPIC_DEFAULT_HAIKU_MODEL="glm-4.7-flash" \
ANTHTOPIC_DEFAULT_SONNET_MODEL="glm-4.7" \
ANTHTOPIC_DEFAULT_OPUS_MODEL="glm-4.7" \
claude "$@"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment