AB
AiBoss
Tutorials

How to integrate GLM-4.5 with Claude Code: A tutorial on the most cost-effective programming combination.

Tutorials

How to integrate GLM-4.5 with Claude Code: A tutorial on the most cost-effective programming combination.

On Monday evening, Zhipu officially released and open-sourced its new flagship model, GLM-4.5. It boasts all three strengths: native fusion inference, code, and agent capabilities, achieving state-of-the-art (SOTA) levels across open-source models. This article will guide you step-by-step through using GLM-4...

Yesterday, a friend asked: How do I connect to Zhipu?Claude In the code?

I immediately went to look into it~

On Monday evening, Zhipu was officially released andopen sourceThe new generation flagship model, GLM-4.5, has been launched.

There are two versions in total, both using MoE (Hybrid Expert) Architecture,Supports hybrid inference mode:

GLM-4.5Flagship model, total parameters 335B, activation parameters 32B;

GLM-4.5-AirLightweight version, total parameters 106B, activation parameters 12B.

In the past, some models were good at mathematics, while others focused on reasoning.

The GLM-4.5 is a triathlon champion:Native fusion reasoning, code,Agent Abilities fully achievedopen sourceModel State of the Ottoman (SOTA) level.

In just a few days, it surged to the top. Hugging Face is ranked #1 on the global trending list.It went viral among developers.

I tried it out immediately and ran a few tasks. The results were even more stable than I expected, especially the Chinese comprehension, which is really smart.

This article will teach you step by step. GLM-4.5 access Claude CodeNo magic or operation requiredSimple,useClaude The Code interface and the Zhipu brain, when combined, are simply amazing.

Zhipu also quietly launched a small perk: InClaude Code: $50 per month for a free GLM-4.5 plan. (Limited spots available, first come, first served!)

Case 1 3D Webpage

Prompt wordsDesign a 3D resume page built using Three.js. Display the resume content (education, projects, skills, etc.) as a floating panel in space, rotating around a central avatar. When a user clicks on a section of content, it will animate to enlarge and center that content, displaying detailed information.

Generating dynamic 3D pages with just one sentence works quite well and is suitable for creating resumes and portfolios.

Case 2 Front-end webpage

Prompt words: Create a Bing search website.

The front-end page is pretty good – the structure is reasonable, and the color scheme and layout are quite nice.

Case 3 News Aggregator + Hot Topic Map

Prompt wordsPlease develop a web application using HTML and JavaScript: The user enters a keyword (such as "...").artificialintelligentThe page will crawl relevant news and generate a hot topic concept map.

Require:

Supports retrieving from RSS or API.up to dateNews content (can be simulated);

Aggregate, summarize, and extract keywords from news content;

Construct a concept map based on word frequency and co-occurrence relationships;

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

It includes input boxes, a news summary area, and a hot topic graph area, all with a clear structure and aligned information.

Case 4 Bug Fix

Prompt words:

// 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 were undefined or undefined, and provided me with 4 solutions.

Now, you can directly experience GLM-4.5 by opening Zhipu Qingyan (https://chatglm.cn) or Z.ai (https://chat.z.ai/).

This time I used the Zhipu API for access. Claude The code is easier to test using the API and is closer to real-world development scenarios.

Get API Key

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

Copy this API Key; you'll need it later.

Install dependencies

Next weInstall Claude Basic dependencies required by the codeNode.js.

I recommend going directly to the official website: https://nodejs.org. The installation process is very simple.SimpleJust click "Next" through the default settings.

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

node -v

npm -v

Seeing the version number means it's installed correctly.

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 by entering 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, you should 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 BigModel, compatible with the Anthropic API protocol.Once you configure this interface address, it will default to using GLM-4.5..

We continue typing:

Claude

Press Enter to confirm.

Seeing this screen means you've succeeded! Just enter the information in the box.Prompt wordsThen it will be ready to use.

Reasoning, code,AgentThese three approaches, which previously each had their own strengths, are now beginning to merge. It's not simply a matter of one area excelling, but rather...With the overall quality level now aligned, domestically produced models finally have the confidence to be universally applicable.

GLM-4.5 access Claude The code is also easier to use than I expected.SimpleThere are many. The interface is smooth, the cost is controllable, and the overall experience is—sufficient, easy to use, and suitable for work.

More importantly, itopen sourceAnd the API pricing is super friendly too.

Input costs only 0.8 yuan per million tokens, and output costs only 2 yuan per million tokens. The high-speed version can reach up to 100 tokens per second.

Currently, the official API 50% off for a limited timeNew users get a free gift.20 million tokens.

As the American tech website Techi pointed out, China AI Currently inopen sourceBy breaking through technological barriers with low prices, they are gradually moving to the core of global competition.

Judging from this trend, domestic products... AI It does seem to be taking the lead.