Updated

GLM API

Zhipu's API for its GLM models, sold internationally as Z.ai, with OpenAI- and Anthropic-compatible endpoints and some free Flash models.

14 open-source projects declare GLM API in their code; no maker's live product we track uses it yet.

Free tierPaid from Pay per token

Profile checked

Ask your AI about this, with this page as the source:ChatGPT ↗Claude ↗Perplexity ↗
Recent changesFollow GLM API (RSS)
  • Oct 2026 Now covered: GLM API, for llm api.

How makers use GLM API

What GLM API is used for

LLM API · Model provider →GLM coding and agent models through Z.ai, with free Flash models and Anthropic-format access for Claude Code.Trade-off: Caching is still in beta with unpublished rules, and the international and mainland platforms are separate accounts.

GLM API vs the alternatives makers chose

OptionMakers' products2026 launchesFree forAt 10,000 usersOpen source
OpenAI API736 80%77%~1,000 users$10/mo · GPT-6 LunaNo
Claude252 27%21%~1,000 users$10/mo · Claude Haiku 5.5No
Gemini API99 11%12%~360 users$28/mo · Gemini 3.1 Flash-LiteNo
Groq39 4%3%~1,500 users$6.75/mo · GPT OSS 20BNo
Azure OpenAI22 2%0%——No
Mistral AI15 2%1%~1,700 users$6.00/mo · Ministral 3 (3B)No
GLM API0 0%0%~800 users—No

For LLM API: how many of the 923 makers' products we know the LLM API of chose each option, and the share among the 256 launched in 2026, since a tool that came first has products from every year, and what each costs at 10,000 users.

Costs are the cheapest plan that fits, from each vendor's pricing page, at the usage our stack planner assumes for a product with that many users. Free for: the users its cheapest plan a business can use stays free for.

When to use GLM API, and when not

Something else fits better if

  • You want the strongest general models and the widest ecosystem of examples and integrations: OpenAI API or Claude or Gemini API.
  • Token cost dominates your budget, for example high-volume batch or agent workloads: DeepSeek or Groq or Mistral AI.
  • You want to try or mix many models with one key and one bill, and fall back when a provider is down: OpenRouter.
  • You want that routing and spend control but self-hosted, with keys and logs on your servers: LiteLLM.
From each decision's guide, written from what makers' products chose and why.

The GLM API is how you call Zhipu's GLM models: GLM-5.3 and the lighter GLM-5.3-Flash and FlashX, with 1M-token context, plus older GLM-4.x text and vision models. Internationally it's sold as Z.ai; in mainland China the same company runs bigmodel.cn, with its own account and prices in yuan.

More about GLM API

The Z.ai API speaks the OpenAI Chat Completions format at https://api.z.ai/api/paas/v4/ and the Anthropic Messages format at https://api.z.ai/api/anthropic, so the official OpenAI or Anthropic SDKs and tools such as Claude Code work by swapping the base URL and key. Z.ai also publishes its own Python SDK (zai-sdk) and Java SDK. Usage is deducted from a prepaid balance.

Useful for a small team: a few smaller models (GLM-4.7-Flash, GLM-4.5-Flash and GLM-4.6V-Flash) cost nothing to call; caching is in open beta, with cache hits at about a fifth of the input price and cache storage free for now; GLM-5.3-Flash is released as an open model; and the GLM Coding Plan is a separate monthly subscription for use in coding agents.

Limits: the international service is run by JINGSHENG HENGXING TECHNOLOGY PTE. LTD. from Singapore under Singapore law. The terms forbid using the service or its outputs to train models that compete with Z.ai, and require AI-generated output to be prominently marked as AI-generated.

GLM API pros and cons

Themes that recur in makers' words and Hacker News comments, each linked to what it summarises, with how Product Hunt tags its reviews.

Pros

Product Hunt review tags
strong coding capabilities7
open source5
agentic tasks4
high-quality PPT generation4
free2

Cons and watch-outs

Product Hunt review tags
error occurrence3
4.8★ from 8 reviews on Product Hunt ↗

What Hacker News says about GLM API

On Hacker News, 39% of comments about GLM API recommend it and 4% criticize it: net praise +35%, 2nd best liked of 12 tools HN discusses for LLM API. Commenters chose it 20.6× as often per month in 2026 as in 2025.

By year

YearComments choosing it, per monthNet praise
20230.1+100%
20240.0—
20252.3+25%
2026 (8 mo)48+36%

In their words

  • “I use GLM 5.2 in OpenCode, running in a Docker container with CodeNomad as the web-based GUI. It works perfectly” HN, Jul 2026
  • “As much as I like GLM 5.2 it's clearly a step below Opus” HN, Jul 2026
  • “I didn't think GLM 4.7 was very good” HN, Jan 2026

Hacker News comments January 2023 to August 2026 that name GLM API in a sentence like "I use" or "we moved to", Claude read a sample of 57 and the counts scale it to all of them; net praise is comments recommending it minus comments criticizing it, as a share of all comments about it. How it's counted, and how HN compares with makers.

Who uses it

No maker's live product on record yet, and 14 open-source projects that declare it in their code.

We haven't found a maker's live product that uses GLM API yet — only the open-source projects below, which declare it in their code.

Open source: a project that declares GLM API as a dependency in its public code — verifiable, but not necessarily a live product.

Alternatives to GLM API

All alternatives by situation →

Further reading

Questions makers ask about GLM API

What are the alternatives to GLM API?

For LLM API, the other options makers' products we track chose most are OpenAI API (736), Claude (252), Gemini API (99), Groq (39), Azure OpenAI (22), Mistral AI (15). Each alternative, with the situation it fits, is on the GLM API alternatives page.

Where is my data processed?

Z.ai says it generally provides its services from Singapore, so customer data is generally processed there. The operator is JINGSHENG HENGXING TECHNOLOGY PTE. LTD., a Singapore company. source ↗

Does Z.ai train on my API data?

Not by default. For businesses and developers using the API, Z.ai says it won't use your content to develop or improve its services unless you explicitly agree. source ↗

Does Z.ai keep my prompts and outputs?

Its data processing addendum for API customers says the content you or your end users send or generate is processed in real time and not saved on its servers; other customer data is kept only as long as needed to provide the service or meet legal requirements. source ↗

Can I use the OpenAI SDK?

Yes. Install the OpenAI SDK and set its base URL to https://api.z.ai/api/paas/v4/ with a Z.ai API key; Z.ai shows this for Python, Java and Node.js. source ↗

Can I use GLM in Claude Code?

Yes. Set ANTHROPIC_BASE_URL to https://api.z.ai/api/anthropic and use a Z.ai API key. source ↗

Are any models free?

Yes. GLM-4.7-Flash, GLM-4.5-Flash and GLM-4.6V-Flash are listed as free for input, output and cached tokens. The newer GLM-5.3 models are paid. source ↗

Can I run GLM myself?

GLM-5.3-Flash, a 320B-parameter model with 18B active, is released as an open-source model, so you can serve it yourself or through another host. source ↗

Is GLM API free?

Yes — there is a free tier a small product can run on; paid use starts at Pay per token. source ↗

Is GLM API open source or self-hostable?

Not open source, and hosted only.

Can AI coding agents work with GLM API?

No llms.txt, official MCP server or CLI found yet.

Who uses GLM API?

No maker's live product we track yet; 14 open-source projects declare it in their code. source ↗