SuperAPI AI Directory

How to connect GLM-4.5 to Claude Code, the ultimate cost-effective programming combo tutorial

Author: AI小集 · Original source: AI工具集

Yesterday a friend asked: how do you connect Zhipu to Claude Code?

I immediately went to look into it~

On Monday night, Zhipu officially released and open-sourced a new-generation flagship model GLM-4.5。

There are two versions in total, both using MoE (Mixture of Experts) architecture,supporting hybrid reasoning mode:

GLM-4.5, the flagship model, with a total parameter count of 335B and 32B activated parameters;

GLM-4.5-Air, the lightweight version, with a total parameter count of 106B and 12B activated parameters.

In the past, some models were good at math, and some focused more on reasoning.

But GLM-4.5 is a triple threat:natively integrated reasoning, code, and Agent capabilities all comprehensively reach the SOTA level among open-source models。

In just a few days, it shot straight to No. 1 on the Hugging Face trending list globally, flooding the developer community.

I also got hands-on and tried it right away, ran a few tasks, and the results were even more stable than I expected, especially the Chinese understanding ability, it's really smart.

This article will teach you step by step how to connect GLM-4.5 to Claude Code, no magic needed, simple to operate, using Claude Code's interface and Zhipu's brain, the combination is simply too satisfying.

Zhipu also quietly launched a little perk: in Claude Code, 50 yuan per month for unlimited use of GLM-4.5. (Limited spots, first come first served~)

 

01. Hands-on testing

 

Case1 3D webpage

Prompt: Design a 3D personal resume page built with Three.js. Display the resume content (education, projects, skills, etc.) as panels floating in space, rotating around a central avatar. When the user clicks a certain part of the content, that content will be animated to enlarge and center, and detailed information will be displayed.

Generate a dynamic 3D page in one sentence, the effect is pretty good, suitable for personal resumes, portfolios~

Case2 Front-end webpage

Prompt: Make a Bing search website.

The front-end page is done pretty well~ the structure is reasonable, and the color scheme and layout look quite good.

Case3 News aggregation + hotspot graph

Prompt: Please use HTML + JavaScript to develop a web application: the user enters a keyword (such as "artificial intelligence"), and the page will crawl related news and generate a hotspot concept graph.

Requirements:

Support obtaining the latest news content from RSS or API (can be simulated);

Aggregate, summarize, and extract keywords from the news content;

Build a concept graph based on word frequency and co-occurrence relationships;

The page structure includes a keyword input box, a news summary area, and a hotspot graph area;

The input box, news summary area, and hotspot graph area are all there, with a clear structure and aligned information.

Case4 BUG fix

Prompt:

// React 中某个组件报错:TypeError: Cannot read property 'map' of undefined

exportdefault function TaskList({ tasks }){  return (    <ul>      {tasks.map(task => (        <li key={task.id}>{task.title}</li>      ))}    </ul>  );}

请找出错误原因并修复

I asked it to help me debug a BUG, and GLM-4.5 correctly identified that the error was that tasks was undefined or undefined, and provided me with 4 fix options.

 

02. GLM-4.5 + Claude Code configuration tutorial

 

Now, openZhipu Qingyan(https://chatglm.cn)或 Z.ai(https://chat.z.ai/),就能直接体验 GLM-4.5。

This time I used the Zhipu API to connect to Claude Code. Using the API is more convenient for testing and also closer to real development scenarios.

Get API Key

Open https://bigmodel.cn/usercenter/proj-mgmt/apikeys Create a new API Key。

Copy this API Key, you will need it later.

Install dependencies

Next, weinstall the basic dependencies required for Claude Code:Node.js。

It is recommended to go directly to the official website:https://nodejs.org The installation process is very simple; just click Next all the way with the defaults.

After the installation is complete, open the cmd terminal and enter the following two commands to confirm whether the installation was successful:

node -v

npm -v

If you see the version number, it means it is installed.

Install Claude Code

Next, we enter the following code in the terminal to install Claude Code:

npm install -g @anthropic-ai/claude-code

After it finishes installing, we continue to enter the following in the cmd terminal:

set ANTHROPIC_BASE_URL=https://open.bigmodel.cn/api/anthropicset ANTHROPIC_AUTH_TOKEN=前面获取的智谱API Key

If you are a Mac/Linux user, replace the above command with:

export ANTHROPIC_BASE_URL="https://open.bigmodel.cn/api/anthropic"

export ANTHROPIC_AUTH_TOKEN="前面获取的智谱API Key"

Key point:https://open.bigmodel.cn/api/anthropic is a dedicated interface provided by Zhipu, compatible with the Anthropic API protocol.As long as you configure this interface address, you are using GLM-4.5 by default。

We continue to enter:

Claude

Press Enter to confirm.

Seeing this interface means it was successful! We can directly enter the prompt in the box and use it.

 

03. Some sharing

 

Reasoning, code, and Agent—these three directions previously had models with their own strengths, and now they are beginning to merge together. It is not just one item standing out, butthe level has been comprehensively aligned, and domestic models finally have the confidence for generality.

Integrating GLM-4.5 into Claude Code is also much simpler to use than I imagined. The calls are smooth, the cost is controllable, and the overall experience is—sufficient, easy to use, and suitable for work.

More importantly, it is open source, and the API pricing is also super friendly.

Input is only 0.8 yuan/million tokens, output is only 2 yuan/million tokens, and the high-speed version can reach up to 100 tokens/second.

Currently the official website API limited-time 50% off, new users directly gettwenty million tokens。

As the American technology website Techi said, Chinese AI is breaking through technical barriers by relying on open source and low prices, and is gradually standing in the core area of global competition.

Looking at this pace, domestic AI really seems to be on the verge of leading.

Original link:A step-by-step guide to integrating GLM-4.5 into Claude Code: the complete guide to configuring the strongest open-source model