This is by far the most direct & simple way to get started. The basic idea is to tell Claude Code to send its API requests to the GLM-4.5 API endpoint instead of Anthropic's. You do this by setting a couple of environment variables in your terminal.
This method essentially tricks Claude Code into using a different "brain." It's surprisingly effective.
First things first, you need an API key.
Now, open up your terminal. Before you run Claude Code, you'll need to export two environment variables. These variables will tell Claude Code where to send its requests & what credentials to use.
For macOS or Linux, you'll use the
command: