Zhipu GLM (Z.ai)
ALIVEGLM-4.7-Flash free + GLM-5.2 flagship
GLM-4.7-Flash (203K context) and GLM-4.5-Flash are free for all registered users — no card. GLM-5.2 / GLM-4.6 are paid but often include signup credits.
- GLM-4.7-Flash free (203K ctx)
- Open-source GLM flagship
- OpenAI compatible
- OpenAI-compatible API
- Auth: Bearer (OpenAI)
glm-4.7-flashdefaultglm-4.5-flashglm-4.6glm-5.2https://api.z.ai/api/paas/v4/chat/completionshttps://api.z.ai/api/paas/v4/completionshttps://api.z.ai/api/paas/v4/models# settings.json "env" block, or your shell:
ANTHROPIC_BASE_URL=https://api.z.ai/api/paas/v4
ANTHROPIC_AUTH_TOKEN=<YOUR_API_KEY>
ANTHROPIC_MODEL=glm-4.7-flash
# Claude Code speaks the Anthropic Messages API. Use an Anthropic-compatible
# endpoint, or an OpenAI→Anthropic proxy in front of Zhipu GLM (Z.ai).You are being set up to use a free LLM API as your model backend.
Provider: Zhipu GLM (Z.ai)
Base URL: https://api.z.ai/api/paas/v4
Model: glm-4.7-flash
Auth: Bearer token (OpenAI-compatible)
Key env var: ZHIPU_API_KEY
Task:
1. Configure Claude Code to call the endpoint above using the OpenAI Chat Completions format.
2. Read the API key from the ZHIPU_API_KEY environment variable. Do NOT
ask me to paste the key in plain text in this chat — I will set it in my env.
3. If a setting requires a base URL, use exactly: https://api.z.ai/api/paas/v4
4. Send one short test message ("ping") and report back whether the call
succeeded, including the model name and latency.
If anything is missing (e.g. an account ID for the base URL), ask me for just
that value and nothing else.↳ You supply the key in your own env. apifreely never sees it.
curl https://api.z.ai/api/paas/v4/chat/completions \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-4.7-flash",
"messages": [{ "role": "user", "content": "Hello!" }]
}'{
"id": "chatcmpl-...",
"object": "chat.completion",
"model": "glm-4.7-flash",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Hello! How can I help?" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 9, "completion_tokens": 12, "total_tokens": 21 }
}Is it really free?
Yes — this entry lists a free tier or promo. Some are rate-limited or time-limited, so check the rate limit and any expiry before relying on it in production.
Where is my API key stored?
Nowhere. apifreely never receives your key. You paste it into your own agent or environment — every generator here runs in your browser.
How do I connect it to my agent?
Open the Setup tab for a copy-paste config per tool, or use the Prompt Generator to get a prompt your agent can run to configure itself.
What if the endpoint needs an account ID?
Some providers (e.g. Cloudflare) include a placeholder like {ACCOUNT_ID} in the base URL — replace it with your own from the dashboard.
1 · Base URL
https://api.z.ai/api/paas/v42 · API key
ZHIPU_API_KEY=••••••••••••••••••env onlyFree Flash models, rate-limited
FREE FLASH