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.
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.
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.
Where it fits
Who uses it
No maker's live product on record yet, and 12 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 →Questions makers ask about GLM API
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; 12 open-source projects declare it in their code. source ↗