AI EngineerGuide

How to use Claude Code with z.ai GLM-4.6

by Ashik Nesin Ashik Nesin

Z.AI has recently released GLM-4.6 - a open source model that performs as good as Anthropic Sonnet 4 based on the benchmark.

Similar to GLM-4.5, you can use it with Claude Code as well.

They offer GLM Code Plan, using which you can buy subscription instead of usage based billing as well.

2025-10-08-at-23.49.062x.png

How to do it?

Just set these environment variables before running Claude Code cli

export ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic
export ANTHROPIC_AUTH_TOKEN=YOUR_Z_AI_API

Once that is done, you can just start claude code

claude

How to get API Key?

Go to https://z.ai/model-api

Login with you z.ai account (same as z.ai chat account) and from there you can get the API key.

Happy claude coding!

Stay Updated

Get the latest AI engineering insights delivered to your inbox.

No spam. Unsubscribe at any time.