Our own visit statistics are always on. Google Analytics, which helps us understand how people use our public pages (not your signed-in workspace), is enabled only with your permission. See our Privacy policy.

GLM 5.3 in Claude Code: a Zhihu and Weibo topic script

How to use GLM 5.3 in Claude Code with a Z.ai or BigModel key, then let it write a script that compares Zhihu answers and Weibo comments, with real costs.

Isometric illustration. On the left, a wooden rack holds long paper scrolls full of text. On the right, a wall is covered with white speech bubbles, and one bubble is teal. Two teal tubes connect both sides to a small machine with a dark screen in the middle. The machine prints a page with two columns, and a teal frame marks the left column.

If you follow AI tools in China, two sites tell you most of what developers think. Zhihu is a question-and-answer site where people write long answers and do the math. Weibo is a microblog where people react in a few words. Read them together and you see both the mood and the reasons behind it.

This article tests one setup for that job. We point Claude Code at GLM-5.3 or GLM-5.3-Flash from Zhipu. GLM then writes a script called topic_pulse.py that pulls Zhihu answers and Weibo comments on one topic through EveryInfra. Finally, GLM reads the output and writes a short comparison.

The topic we use is "Coding Plan price increase". Zhipu changed its Coding Plan to a credit system on 2026-07-30, and developers on both sites still argue about it. That makes it a good test: the topic is narrow, technical, and close to the tool we use.

Here is what is real and what is not. We have no Zhipu account on the test machine. So every step that runs Claude Code on GLM is a configuration example, based on the Z.ai and BigModel docs we read on 2026-11-04. We did not run GLM inside Claude Code. The data side is real.

Between 00:16 and 02:08 SGT on 2026-11-04, we sent 52 requests to the EveryInfra API. Of those, 34 returned data and were charged, for a total of $0.020404. The other 18 failed or came back empty, and none of them was charged. One of the 52 went through the MCP tools/call method.

We ran the full script three times. The second run also read full answer text, made 12 requests and cost $0.00581. The third run is the final script: 7 requests, all successful, for $0.004142.

1. What a glm 5.3 claude code setup can do here

The task has two halves: the API fetches the data, and GLM reads it. The first half needs structured records, one row per answer or comment. Each row has a like count, a date, and the question or post it belongs to. A script can count and sort these rows with no model at all.

The second half is reading the data. You must decide which comments are emoji, which repeat, which complain about price, and which count quota. That part needs a model.

Claude Code connects the two halves. You describe the job in one sentence. The model writes the script, runs it, reads the output, and reports back. We picked GLM-5.3 because Zhipu publishes a guide for Claude Code, and its per-token prices are public (sections 2 to 4 cite each page). For readers outside China, the Z.ai site sells the same models in USD.

The table below lists every capability we called and what came back. "Rows" is the number of items in each response. The price is the EveryInfra catalog price per request. Failed requests and empty results are not charged.

CapabilityCalls on 2026-11-04Catalog priceWhat came back
weibo/search6 (one through MCP)$0.00080620 posts each time
weibo/comments9 with data, 1 empty$0.0005562 to 43 comments per post
zhihu/search5$0.00055620 answers with 51 to 86 character excerpts
zhihu/content_comments7$0.0005563 to 26 comments per answer
zhihu/content_detail (optional)7 with data, 1 rate-limited$0.000556full answer text, up to 756 characters

The final script uses only the first four rows. On Zhihu it starts from zhihu/search, which already returns the question title, answer link, excerpt and like count. Then zhihu/content_comments reads the comments under the top answers. If you need the full text of one answer, add one zhihu/content_detail call. The table has no GLM rows, because we did not run that side.

Isometric illustration of a robot arm between two sides. On the left, book spines stand behind a glass window (only the titles show, like search results with titles and excerpts). On the right, open archive drawers hold scrolls and slips tied with thread (one drawer is teal, like the full answers and comments that a data API returns).
Web search shows the book spines. A data API opens the drawers. Illustration generated for this article

2. GLM-5.3 and GLM-5.3-Flash in short

GLM-5.3 is the flagship text model from Zhipu. It went live on the BigModel platform on 2026-08-19. The model page says it takes text only, has a 1M token context window, and returns up to 128K output tokens (GLM-5.3 model page). Thinking is always on. You can pick low, high or max, and max is the default. You cannot turn thinking off.

GLM-5.3-Flash followed on 2026-08-26. It is a multimodal model with a mix of linear and sparse attention (BigModel release notes). It has 320B total parameters and 18B active parameters. Zhipu says it needs much less compute and KV cache than GLM-5.3.

The recommended settings are temperature 1, top_p 0.95 and reasoning_effort set to max (GLM-5.3-Flash model page). For a data script, the main difference is cost. In section 11, Flash costs about one ninth of GLM-5.3 for the same session.

ItemGLM-5.3GLM-5.3-FlashSource, read 2026-11-04
Release date2026-08-192026-08-26BigModel release notes
Inputtext onlytext and imagesmodel pages
Context window1M tokens1M tokens with the [1m] settingmodel page, switch guide
Thinkingalways on, low, high or maxalways on, max recommendedmodel pages
Z.ai price per 1M tokens$1.4 in, $0.26 cached, $4.4 out$0.15 in, $0.03 cached, $0.50 outZ.ai pricing page
BigModel price per 1M tokensCNY 8 in, CNY 2 cached, CNY 28 outCNY 0.8 in, CNY 0.23 cached, CNY 2.8 outBigModel pricing page
Coding Plan credit factors6.9, 1.7, 242.3, 0.56, 8Coding Plan overview

The Z.ai prices come from the Z.ai pricing page. The CNY prices come from the BigModel pricing page. That page also says that cache storage is free for a limited time. It also says one token equals about 1.6 Chinese characters.

We use that ratio for every token estimate below. At the 2026-11-03 central parity rate of 6.7150 CNY per USD, CNY 8 is about $1.19 (SAFE exchange rate page). So the two sites charge similar amounts.

The two sites use different base URLs. On Z.ai, Claude Code talks to https://api.z.ai/api/anthropic (Z.ai Claude Code guide). On BigModel, the Anthropic-compatible URL is https://open.bigmodel.cn/api/anthropic. BigModel also lists https://open.bigmodel.cn/api/v1 for Codex and https://open.bigmodel.cn/api/coding/paas/v4 for other OpenAI-compatible coding tools. The plain pay-as-you-go API is at https://open.bigmodel.cn/api/paas/v4. Do not mix them up. Only the coding URLs draw from plan quota.

ToolBase URLUses plan quotaRead on
Claude Code on Z.aihttps://api.z.ai/api/anthropicyes2026-11-04
Claude Code on BigModelhttps://open.bigmodel.cn/api/anthropicyes2026-11-04
Codex on BigModelhttps://open.bigmodel.cn/api/v1yes2026-11-04
Other OpenAI-compatible coding toolshttps://open.bigmodel.cn/api/coding/paas/v4yes2026-11-04
Plain pay-as-you-go APIhttps://open.bigmodel.cn/api/paas/v4no2026-11-04

We also found a gap between two Zhipu pages. The BigModel Claude Code guide still shows glm-5.2[1m] for the main model and glm-4.7 for the small model. The newer model switch guide uses glm-5.3-flash[1m] for all three model slots. It also says it was verified on Claude Code 2.1.140.

The Coding Plan overview explains why the old example still works. Calls to GLM-5.2 or GLM-5.1 go to GLM-5.3. Calls to GLM-5-Turbo or GLM-4.7 go to GLM-5.3-Flash. So the old config runs, but you are not on the model you think you are on.

The two pages also map effort levels in different ways. Trust the newer page: the default is max, and in Claude Code you type /effort and pick high to make each turn shorter and cheaper.

3. Coding Plan tiers, credits and peak hours

The Coding Plan is a monthly subscription for coding tools. Since 2026-07-30 it counts usage in credits. The Z.ai docs say plans start "at just 18 USD per month" (Z.ai Coding Plan overview). The Z.ai plan page did not render in our headless browser, so we cannot quote each tier in USD.

On the Chinese site, the GLM Coding Plan page showed monthly prices on 2026-11-04. Lite cost CNY 118, Pro CNY 538 and Max CNY 1078. At 6.7150 CNY per USD, that is about $17.57, $80.12 and $160.54. Quarterly billing takes 20% off, and yearly billing takes 30% off.

Screenshot of the Zhipu GLM Coding Plan page with three price cards. The tabs offer monthly, quarterly (20% off) and yearly (30% off) billing, and the quarterly tab is active. The cards show Lite at 94.4 CNY a month, Pro at 430.4 and Max at 862.4 (struck-out list prices 118, 538 and 1078). Teal frames mark the tabs, the price row and the Lite credit line (10,000 credits per week, with Pro at 6 times and Max at 14 times the Lite quota).
Coding Plan prices read on 2026-11-04 (the quarterly tab shows the monthly average, and the struck-out price is the monthly plan). Screenshot of the GLM Coding Plan page

Each plan has two limits: one per 5 hours and one per week. Lite gives 2,000 credits per 5 hours and 10,000 per week. Pro gives 12,000 and 60,000. Max gives 28,000 and 140,000.

The 5-hour window refreshes 5 hours after each use. The weekly window runs for 7 days from the order date. When you run out, you wait. The plan does not charge your balance.

The credit formula is public. Model credits equal input tokens times the input factor, plus cached tokens times the cache factor, plus output tokens times the output factor. Then you divide by 10,000. Each MCP call for web search, web reading or repository reading costs 1.2 credits.

Off-peak model calls cost half. Peak hours are 14:00 to 18:00 SGT from Monday to Friday, as the Z.ai docs say. The BigModel docs give the same hours as UTC+8. If you work from Singapore, avoid long sessions in the afternoon.

TierMonthly price on 2026-11-04About USDCredits per 5 hCredits per weekGLM-5.3 sessions per week at peak
LiteCNY 118$17.572,00010,000about 48
ProCNY 538$80.1212,00060,000about 288
MaxCNY 1078$160.5428,000140,000about 673

The last column uses the example session from section 11. That session costs about 207.8 credits on GLM-5.3 and 68.7 credits on Flash. Off-peak, the count doubles. Treat these numbers as an order of size, not a promise.

Three rules matter when you build a data script. First, the plan works only in supported tools. API calls from anywhere else do not use plan quota. The Z.ai usage policy says this in five words: "Use limited to supported tools" (Z.ai usage policy).

The BigModel FAQ adds that your own apps, sites, bots and SaaS products need the standard API (Coding Plan FAQ). Second, since 2026-10-16, standard API keys and plan keys are separate. A standard key in a coding tool does not use plan quota (API key notice). Third, plans have no refunds and you cannot share an account (usage notes).

The first rule shapes the whole design. A tempting idea is to let topic_pulse.py call GLM itself to label comments. Then the script could run on a timer with no human. Under the plan rules, those GLM calls would not count as plan usage. You would pay standard API prices.

So our script does only two things. It fetches data, and it computes simple statistics that need no model. The reading and summarizing happen inside Claude Code, where the plan applies. As a bonus, the script runs on any machine, even one with no model access.

4. How to use GLM 5.3 in Claude Code: a configuration example

Below is a sample ~/.claude/settings.json for Z.ai. It follows the Z.ai Claude Code guide and the Claude Code environment variable reference. We did not run it, because we have no Z.ai account. The keys are placeholders.

json
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "your-zai-coding-plan-key",
    "ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.3[1m]",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.3[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5.3-flash[1m]",
    "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000",
    "API_TIMEOUT_MS": "3000000",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "EVERYINFRA_API_KEY": "your-everyinfra-key"
  }
}

Claude Code sends ANTHROPIC_AUTH_TOKEN as a Bearer token in the Authorization header (Claude Code environment variables). Use your Coding Plan key here, not a standard API key. The three ANTHROPIC_DEFAULT_*_MODEL values tell Claude Code which real model sits behind its opus, sonnet and haiku aliases. Z.ai puts GLM-5.3 behind opus and sonnet, and Flash behind haiku. The newer BigModel page puts Flash behind all three. We follow Z.ai, because script writing needs the stronger model. Background tasks can use Flash to save credits.

Keep the [1m] suffix. Claude Code does not know the glm-5.3 ID. For an unknown ID, the model config docs say it assumes 200K tokens and shows a warning at startup (Claude Code model configuration). With [1m] on the ID, it assumes a 1M window, which matches GLM-5.3. Without the suffix, Claude Code compacts the conversation far too early. You notice this most when the model reads long results.

CLAUDE_CODE_AUTO_COMPACT_WINDOW sets how full the context can get before compaction. It accepts values from 100,000 to 1,000,000. API_TIMEOUT_MS at 3,000,000 milliseconds is the Zhipu advice, because GLM at max effort can think for a long time. CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC stops telemetry and other optional requests.

The last line, EVERYINFRA_API_KEY, is for the script. Child processes that Claude Code starts can read it, so the script reads it from os.environ. The key never goes into the code.

VariableValue in our examplePurposeSource, read 2026-11-04
ANTHROPIC_BASE_URLhttps://api.z.ai/api/anthropicsend requests to Z.aiZ.ai Claude Code guide
ANTHROPIC_AUTH_TOKENplan keyBearer tokenClaude Code env reference
ANTHROPIC_DEFAULT_OPUS_MODELglm-5.3[1m]main modelZ.ai Claude Code guide
ANTHROPIC_DEFAULT_HAIKU_MODELglm-5.3-flash[1m]small background tasksZ.ai Claude Code guide
CLAUDE_CODE_AUTO_COMPACT_WINDOW1000000compaction thresholdClaude Code env reference
API_TIMEOUT_MS3000000request timeoutBigModel Claude Code guide

One fact needs a plain statement. The Claude Code gateway docs say any gateway with a supported API format works. They also say Anthropic "doesn't support routing Claude Code to non-Claude models through any gateway" (Claude Code LLM gateway). So Claude Code on GLM works because Zhipu built a compatible endpoint.

If something breaks, the Zhipu docs and support are the place to go. On 2026-11-04, the newest Claude Code release was 2.1.317 from 2026-11-03 (Claude Code changelog). The Zhipu page was verified on 2.1.140. Many releases sit between those two versions, so check both changelogs when you see an odd error.

If you prefer a guided setup, Zhipu offers an interactive tool, npx @z_ai/coding-helper (npm package). After setup, open a new terminal and run claude. Then type /status. The settings source must point to your ~/.claude/settings.json. The model line must show glm-5.3 or glm-5.3[1m].

5. Two MCP sets side by side

MCP stands for Model Context Protocol, an open protocol that lets a model call outside tools (MCP specification). The Coding Plan comes with its own MCP tools. On 2026-11-04 the docs listed web search (webSearchPrime), web reading (webReader), a repository reader called zread, and a vision server. The zread server has three tools: search_doc, get_repo_structure and read_file. The vision server runs locally as the @z_ai/mcp-server npm package. Its latest version, 0.1.6, came out on 2026-10-29 (npm package).

The web search and web reader pages share one sentence. With the Coding Plan in Claude Code, both tools are built into the model service (MCP for web search, MCP for web reading). You do not install them. You add them by hand only if you want them with a different model.

Built-in toolWhat it returnsCredits per callVersion or date
webSearchPrimetitle, URL, summary, site name, icon1.2docs read 2026-11-04
webReadertitle, body text, metadata, links1.2docs read 2026-11-04
zreadsearch_doc, get_repo_structure, read_file1.2docs read 2026-11-04
vision serverimage and video analysis, runs locallycounted as Flash0.1.6 on 2026-10-29

The docs also describe what each tool returns. Web search returns the page title, URL, summary, site name and site icon. Web reader fetches one URL and returns the title, body text, metadata and a list of links. That is a good fit for coding work. You can look up a library, read an error thread, or open a README.

A sentiment script needs data of a different shape. It needs one row per answer or comment, with likes, replies, a date, and the question or post it belongs to. With those rows, a script can sort, remove noise and compute medians. The table below compares the fields each kind of tool returns. The built-in column comes from the Zhipu docs only, because we have no Zhipu account. The EveryInfra column shows the fields that our live calls returned on 2026-11-04.

What you needBuilt-in search or reader (Zhipu docs)EveryInfra fields (live calls, 2026-11-04)Checked
Zhihu answers on a topicpage title, URL, summary, site namezhihu/search: question title, answer link, excerpt, likes, comments, saves, date (20 per call)2026-11-04
Full text of one answerpage title, body text, metadata, linkszhihu/content_detail: full text with likes, comments, saves2026-11-04
Comments on an answerone page of body textzhihu/content_comments: one row per comment with text, like_count, reply_count (3 to 26 rows)2026-11-04
Weibo keyword searchpage title, URL, summaryweibo/search: id, url, text, posted_at, comment, repost and like counts (20 per call)2026-11-04
Weibo commentssame as aboveweibo/comments: one row per comment (2 to 43 rows)2026-11-04
News, docs, GitHuba good fitnot what these capabilities are for2026-11-04

Both sites also run their own developer platforms. They suit you if you need only your own account's data, or if you integrate through the platform's own authorization. The Zhihu data platform search uses a Bearer token and a timestamp header. Its Count maximum is 10, ContentText is an excerpt, and HasMore is always false (Zhihu developer docs: search). Its hot list skill takes a limit from 1 to 30 (Zhihu developer docs: hot list).

On Weibo, the comments/show endpoint returns comments of the authorized user (Weibo API: comments/show). The search/topics endpoint is an advanced API that returns the latest 200 items (Weibo API: search/topics).

So the two MCP sets split the work. The built-in Zhipu tools cover docs, news and public pages, at 1.2 credits per call. The EveryInfra MCP server or API covers structured data inside the platforms, at a USD price per request. Both can stay connected in one Claude Code session, and the model picks by tool description. This is how you add the EveryInfra remote MCP server. We ran initialize and tools/list against it, and it listed 12 tools.

bash
claude mcp add --transport http everyinfra https://api.everyinfra.com/mcp \
  --header "Authorization: Bearer $EVERYINFRA_API_KEY"

# Check the connection: the list must show everyinfra and its tools
claude mcp list

A topic script needs only two of the 12 tools. everyinfra_list_capabilities lists platforms, capabilities and parameters. everyinfra_call_api runs a capability. At 00:23 SGT, we called weibo/search through MCP tools/call with the keyword "Zhipu Coding Plan" in Chinese. It returned 20 posts and cost $0.000806, the same as a direct call. The text result had 15,103 characters.

That size matters. Claude Code warns when one MCP result exceeds 10,000 tokens, and its default cap is 25,000 tokens. You can change the cap with MAX_MCP_OUTPUT_TOKENS. Text results above 50,000 characters go to a file instead of the context (Claude Code MCP docs).

Twenty posts fit easily. But if the model pulls 50 comments and 20 answers through MCP one call at a time, the context fills fast. That is why we let GLM write a script. The script folds dozens of calls into one small JSON file, and the model reads only that file.

One more detail affects gateways. Claude Code turns on tool search by default, so MCP tools load on demand. Requests then carry defer_loading fields and tool_reference blocks. Behind ANTHROPIC_BASE_URL, Claude Code expects the gateway to pass these through.

From version 2.1.305, if the gateway answers 400 or 422, Claude Code retries once without tool search and loads all MCP tools up front. We could not check whether the Zhipu endpoint accepts these fields. If your context looks full at the start of a session with many MCP servers, this may be the cause.

6. The flow of one comparison

Animated flow diagram that loops. A teal dot starts at the prompt (compare Zhihu and Weibo on a topic) and moves to Claude Code with GLM-5.3 (Z.ai Anthropic-compatible endpoint). It then goes to topic_pulse.py (the data script that GLM writes) and on to the EveryInfra API and back. The result is a JSON file (79 text rows, about 2,207 tokens), and the dot ends at the comparison summary that GLM writes.

The whole job is one straight line. First, you give Claude Code one sentence. For example: "Write a script that compares how Zhihu and Weibo talk about the Coding Plan price increase, then tell me the difference." Second, GLM reads the request. It calls everyinfra_list_capabilities or reads the API docs to learn the parameters, and then it writes topic_pulse.py.

Third, Claude Code runs the script. The script calls Weibo search, Weibo comments, Zhihu search and Zhihu comments in turn. It writes the results and the cost of each call to one JSON file. Fourth, GLM reads that file and writes the summary.

Two numbers stand out on this line. The first is compression. In the second run, the raw JSON from the API had 50,859 characters, or about 14,543 tokens. The script kept only the text fields, which left 4,315 characters, or about 2,207 tokens. That removes 85% of the input. GLM rereads its context on every turn, so this saving repeats many times in one session.

The second number is time. The second run went from 00:33:55 to 00:37:01 SGT, a little over 3 minutes. Most of that time was planned waiting. The script spaces calls to stay under 10 requests per minute. It also waited after one HTTP 429 response.

7. The script that GLM must write

This is the prompt we would give Claude Code. You can use it as is.

Write a Python script, topic_pulse.py, with the standard library only. It takes one topic keyword. It calls the EveryInfra API at POST https://api.everyinfra.com/api/v1/social with the key from the EVERYINFRA_API_KEY environment variable. It searches 20 Weibo posts with weibo/search. It keeps posts with at least 3 comments that contain a given word, and it reads 50 comments per post with weibo/comments.

It searches 20 Zhihu answers with zhihu/search and groups them by question. It keeps questions whose title matches a given pattern. For the top 3 questions, it reads 50 comments under the most-liked answer with zhihu/content_comments.

It waits 6.5 seconds between calls. On 429 or 503 it waits for retry_after and tries again. When recent_failures reaches 3, it stops calling that capability. It drops emoji-only, repeated, very short and bot comments. It writes one JSON file with counts, median lengths, the top 5 comments, and each call with its HTTP status and charged_usd.

Each line has a reason. Standard library only means the script runs anywhere with no installs. The 6.5 second gap keeps the script under the default limit of 10 requests per minute.

The retry rules and the recent_failures rule came after our first run, which took more than 7 minutes. The title filter came after the second run. Section 9 explains both. The bot rule exists because Weibo has an automatic search assistant that replies inside comment threads. Its long replies would distort the statistics.

Below is the core of the third version. We wrote it from the prompt above and ran it. The full file has about 120 lines, and this excerpt shows only the call, retry and Zhihu logic.

python
API = "https://api.everyinfra.com/api/v1/social"
KEY = os.environ["EVERYINFRA_API_KEY"]
GAP = 6.5            # seconds between calls: stay under 10 requests per minute
DOWN = set()         # capabilities that failed 3 times in 10 minutes

def call(platform, action, params, tries=3):
    if f"{platform}/{action}" in DOWN:
        return None
    body = json.dumps({"platform": platform, "action": action, "params": params}).encode()
    for attempt in range(tries):
        req = urllib.request.Request(API, data=body, method="POST", headers={
            "Authorization": f"Bearer {KEY}", "Content-Type": "application/json"})
        try:
            with urllib.request.urlopen(req, timeout=120) as r:
                code, d = r.status, json.load(r)
        except urllib.error.HTTPError as e:
            code, d = e.code, json.loads(e.read() or b"{}")
        log(platform, action, code, d)       # rows and billing.charged_usd
        time.sleep(GAP)
        err = d.get("error") or {}
        if code == 200:
            return d
        if (err.get("recent_failures") or 0) >= 3:   # the error says: stop retrying
            DOWN.add(f"{platform}/{action}")
            return None
        if code in (429, 503) and err.get("retryable") and attempt < tries - 1:
            time.sleep(min(err.get("retry_after", 30), 60))
            continue
        return None

# Zhihu: search, group by question, keep matching titles, read comments of the top answer
for q in top_questions:
    answers += by_q[q]                   # search rows: question title, link, excerpt, likes
    best = max(by_q[q], key=lambda x: x.get("like_count") or 0)
    zcomments += rows(call("zhihu", "content_comments", {"url": best["url"], "limit": 50}))

The key part is how the script reads errors. An EveryInfra error is a JSON object with fields, not a bare message. fault says whose problem it is. retryable and retry_after say whether to retry and how long to wait. recent_failures says how many times this capability failed recently.

next_steps tells the caller, in plain language, what to do next. example gives a request that is known to work. A script that reads these fields makes better choices than one that only counts HTTP codes. GLM can read the same fields in Claude Code and change its plan without a loop of retries. In the second run, one HTTP 429 came at 00:35:34 SGT. The script waited as the response said, and the retry 33 seconds later worked at no charge.

The noise rules are simple. First, the script removes the "reply to someone" prefix from each comment. A comment of 4 characters or fewer counts as short. A comment that has only emoji tags, spaces, digits, "yes" or laughter counts as emoji or a repeat. A comment from an author whose name contains the Weibo search assistant tag counts as a bot.

We wrote these rules after we read the first real batch, not before. They are not perfect. For example, a two-character "true" also goes out as short. For the question "how many people say something real", they work well enough.

8. One real round trip on both sites

Before the script, we called each capability by hand to check parameters and response shapes. The table lists the main calls in order. All times are SGT on 2026-11-04.

Time (SGT)CapabilityTargetHTTPRowsCharged
00:16:49weibo/searchkeyword "Coding Plan price increase"20020$0.000806
00:17:03zhihu/searchsame keyword20020$0.000556
00:21:42zhihu/content_detailan answer with 47 likes2001$0.000556
00:21:56zhihu/content_commentssame answer2007$0.000556
00:22:20weibo/commentsa post on four pricing strategies20011$0.000556
00:22:57weibo/commentsa letter short code instead of a numeric ID2000$0, empty result refunded

Weibo worked well. Each post from weibo/search has an id, url, text, posted_at, and counts for comments, reposts and likes. The 20 posts for our keyword ran from 2026-08-17 to 2026-10-26. A search for "GLM-5.3" at 00:21 SGT returned newer posts, from 2026-10-30 to 2026-11-03. weibo/comments accepts a numeric ID or a link with the numeric ID.

At 00:22:20 SGT we read 11 comments under a post that compared four pricing strategies. One reader wrote that "cost plus margin, then peak and off-peak" is easier to follow than one flat price. Another said Kimi was fine "but expensive and slow", so they would stick with DeepSeek. The one trap was link format.

We sent a letter short code on purpose. The API returned 200 with zero rows and the reason empty_result_refunded, and it did not charge. If you use the id field from search results, you never hit this.

Zhihu search also worked. It returned 20 answers with question title, answer link, excerpt, likes, comments, saves and date. That is enough for two steps. The script groups answers by the question ID in each link. Then it picks the most-liked answer in each group. zhihu/content_comments takes an answer link and returns its top-level comments, each with text, likes and replies.

The answer we read with zhihu/content_detail at 00:21:42 SGT came from a user who renewed a Max plan. They said the quarterly price was 422 CNY a month the day before, and "eight or nine hundred" the next day. It had 47 likes and 28 comments, and at 00:21:56 SGT we read 7 of its comments. You need zhihu/content_detail only when the excerpt is not enough, at one request per answer.

Screenshot of an API response in a dark terminal (POST to the EveryInfra social endpoint, HTTP 200, 11 rows, 02:07:56 SGT on 2026-11-04, third version of topic_pulse.py). The request is zhihu/content_comments with one Zhihu answer link and limit 50, and it shows 2 of the 11 comments with names hidden. Teal frames mark results, text, like_count and charged_usd (0.000556).
One response that the final script got for Zhihu comments (2 of 11 rows shown, names hidden). Each comment is one row with likes and replies. Screenshot of an EveryInfra API response

9. Three script runs: keyword drift, rate limits and a title filter

The first run used the keyword "Zhipu Coding Plan" in Chinese. It ran from 00:24:58 to 00:32:37 SGT, or 7 minutes and 39 seconds. It made 15 requests and charged 6, for $0.003586. The other 9 failed and were not charged. The run was slow because this version waited 60 seconds after every failure and did not read recent_failures.

The keyword also drifted. On Weibo, the post with the most comments was a livestream sales post. It had no link to the topic, but the script read its comments.

RunKeywordTime (SGT)RequestsChargedCost
FirstZhipu Coding Plan00:24:58 to 00:32:37156$0.003586
SecondCoding Plan price increase00:33:55 to 00:37:011210$0.00581
Third, finalsame, with a Zhihu title filter02:06:32 to 02:08:2277$0.004142

The second run fixed three things. It added the recent_failures rule. It also added --must "coding plan", so a Weibo post must contain that phrase. We changed the keyword to the narrower "Coding Plan price increase". This version also read full answer text with zhihu/content_detail.

The run went from 00:33:55 to 00:37:01 SGT, or 3 minutes and 6 seconds. It made 12 requests, charged 10, and cost $0.00581. The two free requests included the 429 at 00:35:34 SGT. The comparison numbers in section 10 use this run plus the manual calls.

The second run was cleaner, but it showed a flaw in picking questions by likes. Of the 20 Zhihu answers, 8 had titles that named Zhipu or GLM. One asked why the Zhipu plan costs more in China than abroad. Another asked how people see the "Zhipu Coding Plan price increase". The script picked the 3 questions with the most likes in total.

One asked why OpenAI paused its $200 Pro plan, with 523 likes. One asked where to buy a good-value coding plan now, with 378 likes. The third, with 235 likes, was about Alibaba Cloud stopping renewals of its Lite plan. All three discuss coding plan pricing, but none is about Zhipu.

If you want "what people think about the Zhipu increase", add a title filter, for example a title that names Zhipu or GLM. This is a good job for Claude Code. You read the first summary and say "only questions about Zhipu". GLM changes one line and runs again for less than one cent.

Weibo showed the same issue more strongly. Of the 20 posts for "Coding Plan price increase", only 7 mention coding plan in the text. Only 2 of those have 3 or more comments. One is a user who cancelled another plan and tried replacements.

The other says GLM 5.3 improved a lot, but the price went up too much. Together they gave only 5 comments. The other 13 posts include news reposts, daily digests and game news. The post with the most comments, 50, was a topic post on DeepSeek prices.

So niche technical topics get little discussion on Weibo, and most of the voice is on Zhihu. To get a fair sample, we merged 4 hand-picked comment sets from Weibo (73 comments) with the 5 from the second run. That gave 78 Weibo comments. On Zhihu, we merged 71 comments from the second run with 7 from the manual stage, also 78. Equal counts make the shares easy to compare.

The third run added the title filter, and it is the final script in this article. We dropped the full-text step and kept four capabilities. We added --zhihu-title with a pattern for Zhipu, GLM and a common nickname for Zhipu. The run went from 02:06:32 to 02:08:22 SGT on 2026-11-04, or 1 minute and 50 seconds. All 7 requests returned 200 and were charged, for $0.004142.

On Weibo it read the same 2 posts and 5 comments as the second run. On Zhihu, all 3 questions were now about Zhipu. One asked how people see the switch to credits on 2026-07-30 (top answer: 47 likes, 28 comments). One asked where to subscribe to the GLM-5 coding plan and why the model is so popular (36 likes). One asked why the Zhipu Coding Plan costs so much (7 likes).

Under those three answers the script read 7, 11 and 3 comments, 21 in total. The noise rules removed none of them, and the median length was 26 characters. The top comment, with 19 likes, asked why anyone pays for a full year when no one knows which AI will lead in three months. Another, with 4 likes, said the international plan costs "50% more than the domestic price".

Horizontal bar chart of the 7 requests in one run of the final script. Bars are in time order, and bar length is the charge in USD. The longest bar is weibo/search at 02:06:32 ($0.000806). Two weibo/comments calls at 02:06:53 and 02:07:08, one zhihu/search call at 02:07:26, and three zhihu/content_comments calls at 02:07:44, 02:07:56 and 02:08:09 cost $0.000556 each. The total is $0.004142.

10. What Zhihu and Weibo say

This section shows what GLM should write after it reads the results. To keep the model from grading itself, analysis.py computes every number from the raw responses, with no model involved. The text is our own example, based on those numbers.

Start with length. After noise removal, the median Weibo comment has 14 characters. Nine in ten Weibo comments have 36 characters or fewer, and the longest has 158. The median Zhihu comment has 28 characters, nine in ten have 70 or fewer, and the longest has 229.

The four Zhihu answers have a median of 310.5 characters and a maximum of 756. So a Zhihu comment is twice as long as a Weibo comment, and a Zhihu answer is ten times longer again. If you read only Weibo, you get mood. For reasons, you need Zhihu answers.

Horizontal strip chart on a log scale, where each dot is one text after noise removal and the axis shows characters. Weibo comments have 63 dots with a median of 14 (most between 5 and 42, two long ones at 92 and 158). Zhihu comments have 70 dots with a median of 28 (from 9 to 229). Zhihu answers have 4 dots (87, 276, 345 and 756) with a median of 310.5. Three vertical lines mark the medians.

Next, noise. Of 78 Weibo comments, the rules removed 15. Six were 4 characters or fewer, such as "yes". Four were emoji only.

Three were replies from the Weibo search assistant. One was a repeat, and one was only a link. Of 78 Zhihu comments, the rules removed 8: 3 too short, 2 links only, 2 repeats and 1 emoji only. The noise share is 19% on Weibo and 10% on Zhihu.

The bot replies deserve a note. Weibo users can tag the search assistant in a comment and ask, for example, "how much did DeepSeek raise its price". The assistant posts a long answer, and those answers rank high by likes. Without the bot rule, you would report what the assistant said as what people said.

Stacked horizontal bar chart, where each bar shows the parts of 78 comments. Weibo keeps 63 (6 too short, 4 emoji only, 3 bot replies, 1 repeat, 1 link only). Zhihu keeps 70 (3 too short, 2 links only, 2 repeats, 1 emoji only). The kept part is teal. Weibo has 19% noise and Zhihu has 10%.

Then, themes. We wrote a keyword list for each of six themes. Price covers words for rise, expensive, how much, CNY and dollars. Quota covers quota, usage, used up, 5 hours, week, credits and reset. Quality covers "dumbed down" and quantized.

Rivals covers DeepSeek, Kimi, Codex, Claude, Qwen and MiniMax. Local covers local, VRAM and deploy. Bans covers ban, risk control and rate limits. One comment can match more than one theme.

Of 63 kept Weibo comments, 22.2% discuss price and 15.9% compare rivals. Quality and local setups get 4.8% each, and quota gets only 3.2%. Of 70 kept Zhihu comments, 25.7% discuss quota. Price and rivals get 20% each. Quality and bans get 5.7% each, and local setups get none.

Grouped horizontal bar chart of six themes as a share of kept comments. Price is 22.2% on Weibo and 20% on Zhihu. Quota is 3.2% on Weibo and 25.7% on Zhihu (the Zhihu bar is teal). The other four themes are small (quality 4.8% and 5.7%, rivals 15.9% and 20%, local setup 4.8% and 0, bans 0 and 5.7%). Both sites talk about price, but only Zhihu counts quota.
MeasureWeibo, 78 commentsZhihu, 78 comments and 4 answersHow to read itData date
Kept after noise rules6370Weibo has twice the noise share2026-11-04
Median length14 characters28 for comments, 310.5 for answersreasons live on Zhihu2026-11-04
Likes on kept items112349 on comments, 1,183 on answersZhihu likes cluster on a few answers2026-11-04
Top themeprice, 22.2%quota, 25.7%"is it too expensive" against "is it enough"2026-11-04
Theme found on one side onlylocal setup, 4.8%bans, 5.7%small sample, a lead only2026-11-04

From these numbers, a GLM summary could read like this. It is our example text, not model output.

Both sites talk about price, in different ways. On Weibo, people give a one-line verdict, such as "prices keep getting more absurd", and rarely give a reason. About one comment in six names another vendor. On Zhihu, people do the math. The top answer says that any plan with an API discount above 15 times loses money when a user uses all of it.

The top comments are about quota. One with 74 likes says usage fell to about half of what it was "after the reset-card handout". On Zhihu, 5.7% of comments talk about bans and risk control, and Weibo has none. Some Weibo users ask whether a local setup can replace a plan, and this Zhihu batch has none. The sample is small, with 78 comments per site, and the Zhihu answers come from the most-liked questions.

We quote only public comment text, with no user names. Like counts come from the like_count field. One limit bears repeating. This is one topic, one night, and 78 comments per site.

The theme rules are keyword lists that we wrote. GLM may label comments more accurately, or it may make mistakes. The result answers "how do these two sites discuss the topic differently". It does not answer "what share of people support the price increase".

11. Cost: data, GLM tokens and plan credits

Start with data. The second run made 12 requests. weibo/search cost $0.000806, and each of the other 9 successful requests cost $0.000556. The two failed requests, one of them a 429, were free. The total was $0.00581. The run returned 79 text rows (5 Weibo comments, 3 Zhihu answers and 71 Zhihu comments) plus 40 search rows. That is $0.0735 per 1,000 text rows.

The final script drops the full-text step. One run makes 7 requests for $0.004142 and returns 5 Weibo comments, 21 Zhihu comments and 40 search rows. A daily run at the size of our second run costs $0.1743 per month, and the final script costs $0.12426 per month.

ScenarioRequestsUSDBasis
Second run, with full text12 sent, 10 charged$0.00581charged_usd
Third run, final script7 sent, 7 charged$0.004142charged_usd
Per 1,000 text rowsn/a$0.073579 rows
Daily for 30 days360$0.174330 × $0.00581
Flash summary read on Z.ai1$0.0010813,707 tokens

Next, the model. With no account, we could not measure a real session. So we borrow an example session from the Claude Code cost docs. It has 1.2k input tokens, 5.3k output tokens, 940k cache reads and 50k cache writes.

This shape is close to "write a 100-line script, run it twice, fix it once". Cache reads dominate, because each turn rereads the context. Zhipu has no separate price for cache writes, so we price them as normal input.

Model and siteExample sessionAbout USDOne summary readPlan credits at peak
GLM-5.3 on Z.ai$0.3394$0.3394$0.00969207.8
GLM-5.3 on BigModelCNY 2.438$0.3631$0.008884207.8
GLM-5.3-Flash on Z.ai$0.0385$0.0385$0.00108168.7
GLM-5.3-Flash on BigModelCNY 0.272$0.0405$0.00088868.7
One data run on EveryInfran/a$0.00581n/an/a

The "one summary read" column assumes 2,207 input tokens (the cleaned text from the second run) and 1,500 output tokens. This is the extra cost each day, after the script exists, to have GLM read fresh data. CNY values use the 2026-11-03 rate of 6.7150.

Horizontal bar chart on a log scale that compares one script-writing session with one data run, in USD. GLM-5.3 costs $0.3631 on BigModel and $0.3394 on Z.ai. GLM-5.3-Flash costs $0.0405 on BigModel and $0.0385 on Z.ai. One EveryInfra data run costs $0.0058 (teal bar). Writing the script costs 7 to 63 times one data run.

The chart makes one point. In this kind of task, most of the money goes to writing and fixing code, not to fetching data. One script session on GLM-5.3 costs about 60 times the data. On Flash it costs about 7 times. After the script exists, the daily cost is the data plus one summary read. With Flash on Z.ai, that is under $0.007 per day.

On a Coding Plan, model cost turns into credits. Lite gives 10,000 credits per week. That covers about 48 sessions like our example on GLM-5.3, or about 145 on Flash, all at peak. Off-peak, both numbers double. Built-in web search costs 1.2 credits per call, so a few doc lookups barely touch the quota.

One more cost is easy to miss: feeding the raw API response to the model. The raw JSON from the second run had about 14,543 tokens. At the Z.ai GLM-5.3 input price of $1.4 per million, one read costs about $0.02, which is more than three times the data cost. Every extra turn reads it again. Let the script compress first, so the model reads only about 2,207 tokens. That is the biggest single saving in this setup.

12. Limits

First, zhihu/question_answers, which reads every answer under a question, was not available during our tests, and the failed requests were not charged. So the script starts from zhihu/search and reads, for each question, only the answers that search found and the comments under them.

Second, we did not test anything on the Zhipu side. The configuration follows docs we read on 2026-11-04, and those docs disagree in two places. We have no data on what script GLM-5.3 would write, how many fixes it would need, or how many tokens it would use. The model cost is an estimate from an example session in the Claude Code docs, not a measurement.

Third, the sample is small. Each site has 78 comments. On Weibo, 73 of them come from posts we picked by hand, not by the script. Zhihu has only 4 answers. The theme rules are keyword lists, and short words such as "week" can match by accident. Use the results as leads, not as shares of opinion.

Fourth, plan quota works only in supported tools. A timer that runs the script and asks GLM to summarize, with no human in the loop, falls outside the plan. It would need the standard API. Our design runs only the script on a timer. The summary waits until you open Claude Code and ask GLM to read the latest file.

Fifth, Weibo comments from weibo/comments have no IP location field. Replies inside a thread come from weibo/comment_replies, which costs $0.000806 per call and includes location. If you need a regional view, add that call.

13. Recent changes around GLM-5.3 and the Coding Plan

On the model side, QbitAI reported on 2026-10-12 that Zhipu added GLM-5.3-Highspeed to ZCode 3.15.1. A user measured about 490 tokens per second (QbitAI). That model is only in ZCode for now, and the Coding Plan docs do not list it for Claude Code. The vision MCP package moved to version 0.1.6 on 2026-10-29.

On the safety side, Anthropic published research on 2026-09-29. It said GLM-5.3 can build end-to-end cyber exploits on its own and shipped without strong safeguards (Anthropic research). On 2026-10-30, Help Net Security covered an evaluation by Irregular.

GLM-5.3 refused none of 13 scenarios, and the evaluators advise testing restrictions before you give it more autonomy (Help Net Security). For this setup, that means least privilege. When GLM runs in Claude Code, the script needs one folder and one API, and nothing more.

On the price side, Zhipu split standard keys from plan keys on 2026-10-16. On 2026-10-23, 36Kr reported that Zhipu was one of few vendors with a real Singles' Day discount. The Lite monthly card dropped from CNY 118 to CNY 115 (36Kr). In late October, the BAAI community reported that some plan users got quota reset cards as compensation for a quality drop (BAAI Hub). That matches the Zhihu comment about usage after "the reset-card handout". We found no rules for these cards in the Zhipu docs.

DateChangeSource
2026-09-29Anthropic research on GLM-5.3 cyber skillsAnthropic
2026-10-12GLM-5.3-Highspeed in ZCode 3.15.1QbitAI
2026-10-16standard keys and plan keys splitBigModel notice
2026-10-23Lite monthly card from CNY 118 to CNY 11536Kr
2026-10-29@z_ai/mcp-server 0.1.6npm
2026-10-30Irregular evaluation of GLM-5.3Help Net Security
2026-11-03Claude Code 2.1.317Claude Code changelog

14. Steps to get started

Steps 1 to 3 are a configuration example. We ran steps 4 to 6.

  1. Subscribe to a Coding Plan on Z.ai and create a plan key.
  2. Edit ~/.claude/settings.json as in section 4.
  3. Open a new terminal, run claude, and type /status to check the model.
  4. Get an EveryInfra key from the quickstart and add it as EVERYINFRA_API_KEY.
  5. Give Claude Code the prompt from section 7. Start small with --weibo-posts 2 --zhihu-questions 2 and --zhihu-title.
  6. Ask GLM to read the JSON and write the summary, then add a title filter and run again.

The parameters and fields of each capability are on the Zhihu API page and the Weibo API page. See Zhihu search, Zhihu comments and the optional Zhihu content detail. For Weibo, see Weibo search and Weibo comments. The remote MCP tool list is on the MCP server page, and catalog prices are on the pricing page.

Related reading: to see how models do at the cleaning step and what it costs, read DeepSeek V4 in Claude Code for comment cleaning. The JSON from topic_pulse.py can feed that flow directly. For another Claude Code data pattern, see Claude Code dynamic workflows for Xiaohongshu comments. For the bias that "pick by likes" adds, see sample integrity in social media research, and for refunds on failed calls, see failure refund reconciliation.

FAQ

How to use GLM 5.3 in Claude Code, and why the [1m] suffix?

Set the values in the env block of ~/.claude/settings.json, as shown in section 4. The step people miss is the [1m] suffix. Claude Code does not know the glm-5.3 ID, so without the suffix it assumes a 200K window and compacts early. After the change, open a new terminal and check the model line with /status. Question source: search suggestions for "how to use glm 5.3 in claude code" and "glm 5.3 claude code", checked 2026-11-04. Basis: Z.ai Claude Code guide, Claude Code model configuration.

Can my own script use Coding Plan quota?

No. The plan works only in supported tools. Calls from your own apps, sites, bots or SaaS products need the standard API. Since 2026-10-16, the two key types are also separate. That is why our script only fetches data, and GLM in Claude Code writes the summary. Question source: search suggestions for "glm coding plan limits", checked 2026-11-04. Basis: Z.ai usage policy, Coding Plan overview.

What are the GLM Coding Plan base URL and endpoint for Claude Code?

On Z.ai, use https://api.z.ai/api/anthropic. On BigModel, use https://open.bigmodel.cn/api/anthropic. Codex and other OpenAI-compatible tools have their own coding URLs. The plain API URL does not draw from plan quota. Question source: search suggestions for "glm coding plan base url" and "glm coding plan endpoint", checked 2026-11-04. Basis: BigModel model switch guide, Z.ai quick start.

Should I pick GLM-5.3-Flash or GLM-5.3 to write the script?

On Z.ai, Flash input costs about one ninth of GLM-5.3 and output costs about one ninth too. In our estimate, one script session costs about $0.04 on Flash and $0.34 on GLM-5.3. For a 100-line data script, start with Flash and switch to GLM-5.3 only if Flash cannot fix a bug. Question source: search suggestions for "glm 5.3 flash vs glm 5.3" and "glm 5.3 flash cost", checked 2026-11-04. Basis: Z.ai pricing.

What can the built-in Coding Plan web search return?

The Zhipu docs say web search returns titles, URLs, summaries, site names and icons, and web reader returns the title, body text, metadata and links. That suits docs and news. A topic script needs one row per answer or comment with likes and dates, and for that we use zhihu/search, zhihu/content_comments, weibo/search and weibo/comments. We have no Zhipu account, so we did not test the built-in tools. Question source: search suggestions for "glm coding plan web search", checked 2026-11-04. Basis: MCP for web search, MCP for web reading.

Does Zhihu have an API?

Yes. The Zhihu data platform offers search and hot list endpoints. Search returns at most 10 excerpts per call with featured comments, and it uses a Bearer token with a timestamp header. It suits work that goes through the platform's own authorization.

Our script uses zhihu/search for 20 answers per call and zhihu/content_comments for the comments. On 2026-11-04 the final run read 21 Zhihu comments, and the Zhihu part cost $0.002224. Question source: search suggestions for "zhihu com api", checked 2026-11-04. Basis: Zhihu developer docs: search, Zhihu search capability page.

References

  1. Z.ai: Claude Code guide
  2. Z.ai: Coding Plan overview
  3. Z.ai: switch to the latest model
  4. Z.ai: usage policy
  5. Z.ai: quick start
  6. Z.ai: pricing
  7. Z.ai blog: GLM-5.3
  8. BigModel: model switch guide, read 2026-11-04
  9. BigModel: Claude Code guide
  10. BigModel: Claude Code introduction
  11. BigModel: Coding Plan overview
  12. BigModel: Coding Plan quick start
  13. BigModel: Coding Plan usage notes
  14. BigModel: Coding Plan FAQ
  15. BigModel: plan revision notice
  16. BigModel: API key notice, 2026-10-16
  17. BigModel: MCP for web search
  18. BigModel: MCP for web reading
  19. BigModel: zread MCP
  20. BigModel: vision MCP
  21. BigModel: supported tools
  22. BigModel: GLM-5.3 model page
  23. BigModel: GLM-5.3-Flash model page
  24. BigModel: pricing
  25. BigModel: release notes
  26. BigModel: fee questions
  27. BigModel: API questions
  28. GLM Coding Plan page, prices read 2026-11-04
  29. Claude Code: LLM gateway
  30. Claude Code: model configuration
  31. Claude Code: environment variables
  32. Claude Code: MCP
  33. Claude Code: settings
  34. Claude Code: costs
  35. Claude Code: changelog, 2.1.317 on 2026-11-03
  36. Claude Code repository changelog
  37. MCP specification, 2026-07-28
  38. Zhipu glm-cookbook: Claude Code example
  39. npm: @z_ai/mcp-server
  40. npm: @z_ai/coding-helper
  41. Zhihu data platform
  42. Zhihu data platform: search
  43. Zhihu data platform: hot list skill
  44. Weibo open platform CLI
  45. Weibo CLI quick start
  46. Weibo API: comments/show
  47. Weibo API: search/topics
  48. Weibo API: rate limits
  49. EveryInfra capability catalog, read 2026-11-04
  50. SAFE: RMB central parity rates
  51. Anthropic: GLM-5.3 and the spread of advanced cyber capabilities, 2026-09-29
  52. Help Net Security: Irregular evaluation of GLM-5.3, 2026-10-30
  53. QbitAI: GLM-5.3-Highspeed at 490 tokens per second, 2026-10-12
  54. 36Kr: token plans on Singles' Day, 2026-10-23
  55. BAAI Hub: quality drop and reset cards

Reference BL-81