Z.AI GLM API key setup
GLM coding plans via Z.ai: $18/month Lite, $80/month Pro, and $168/month Max before quarterly/yearly discounts. The free Z.ai chat surface and paid API/coding-plan limits are separate.
Disclosure: the sign-up link in step 1 is a partner link. Dracon may earn a commission when you create an account through it. It never changes the price you pay, and Z.AI GLM's own site is always reachable directly at z.ai.
Get your key
- Open the Z.AI GLM API keys page: z.ai/subscribe?ic=FD6ODRFLIG partner link
- Create an account and generate an API key.
- Paste it into the Dracon BYOK provider keys, stored encrypted (AES-256-GCM), used browser-direct, works in every Dracon tool.
Use your key in every tab
Two free extensions take the key you just set up. Both read the page you are on and use your own provider key: free, no account, nothing stored on a server we run.
AI Auto Form Filler
Complete a web form from a short description, using a model you bring yourself.
All extensions · last checked 2026-10-22.
Get the key and test it
- Open the Z.AI GLM API keys page: z.ai/manage-apikey/apikey-list Create a key and copy the secret straight away.
- Point your client at this provider's base URL:
https://api.z.ai/api/paas/v4It speaks the OpenAI-compatible shape, so an OpenAI SDK client works against it with no adapter: only the base URL and the key change. - Prove the endpoint answers before you trust it. Send one call
with no
Authorizationheader: a live endpoint answers401 Unauthorized, because it is waiting for a bearer key. The wording of that error differs by provider (some sayinvalid_api_key, othersincorrect_api_keyorToken is invalid), so read the 401 as the signal, not the error text. - Paste the key into the Dracon BYOK provider keys ; stored encrypted, used browser-direct, no relay.
- Compare other provider plans when this subscription does not match your usage or budget.
Test the key
Both examples read the key from the ZAI_API_KEY environment
variable, so the key stays out of the command line.
export ZAI_API_KEY="<YOUR_API_KEY>"
curl https://api.z.ai/api/paas/v4/chat/completions \
-H "Authorization: Bearer $ZAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"glm-4.6","messages":[{"role":"user","content":"hi"}]}' import os
from openai import OpenAI
# export ZAI_API_KEY="<YOUR_API_KEY>" first
client = OpenAI(
api_key=os.environ["ZAI_API_KEY"],
base_url="https://api.z.ai/api/paas/v4",
)
resp = client.chat.completions.create(
model="glm-4.6",
messages=[{"role": "user", "content": "hi"}],
)
print(resp.choices[0].message.content)Free tier
Yes. Z.ai chat is available free with current GLM access; the API and coding plans are paid with separate limits. no credit card required
Rate limits: Lite: 10,000 credits / week. Pro: 6× Lite usage. Max: 14× Lite usage. The plan supports 20+ agent tools; exact model access and limits can change.
Paid plans compared
Every tier Z.AI GLM publishes, with the price and the limit as the vendor states them, last checked 2026-10-26. Confirm with the provider before you buy. You pay them directly, no Dracon markup.
| Plan | Price | Usage limit | What you get |
|---|---|---|---|
| Lite | $18/mo | 10,000 credits / week; Billing periods: $18/month, $14.40/month on the quarterly plan (20% off) and $12.60/month on the yearly plan (30% off) |
|
| Pro | $80/mo | 6× Lite usage; Billing periods: $80/month, $64/month on the quarterly plan (20% off) and $56/month on the yearly plan (30% off) |
|
| Max | $168/mo | 14× Lite usage; Billing periods: $168/month, $134.40/month on the quarterly plan (20% off) and $117.60/month on the yearly plan (30% off) |
|
Official plan source: z.ai/subscribe
Connection details
- Base URL
https://api.z.ai/api/paas/v4- API shape
- OpenAI-compatible
- Env var
ZAI_API_KEY- Models
- glm-4.6, glm-4.5-air
- Model lineup
- GLM-5.3, GLM-5.3-Flash, GLM-5.2, GLM-5-Turbo
Our verdicts on this kind of provider
Independent comparisons we keep current as pricing and free tiers shift. A guide is setup; a verdict is whether it's worth setting up.