Get a Z.ai GLM key
Who this is for: anyone with a Z.ai (Zhipu GLM) account who wants GLM models through SpiderGate.
What this does: explains which Z.ai key to use, then walks you through creating it and adding it to your SpiderGate vault with the right billing and host.
Before you begin
A Z.ai account at z.ai, with either a GLM Coding Plan or pay-as-you-go credit. China-region accounts use bigmodel.cn instead.
About 2 minutes.
Limits and terms to know first
Since 16 October 2026, Z.ai manages coding plan keys and standard API keys separately, and "the key type determines how calls are billed". GLM Coding Plan usage is counted in credits per five hours and per week:
Plan | Credits per 5 hours | Credits per week |
|---|---|---|
Lite | 2,000 | 10,000 |
Pro | 12,000 | 60,000 |
Max | 28,000 | 140,000 |
Warning: Do not use a GLM Coding Plan key with n8n, scripts or your own apps. Z.ai's subscription terms say: "You shall not use the GLM Coding Plan quota for general-purpose API access or any scenarios outside such tools, including but not limited to directly invoking model APIs from your own applications, bots, websites, SaaS products or other systems". The same section forbids you to "proxy or otherwise provide the GLM Coding Plan to any third party". For anything automated, use a pay-as-you-go key.
Warning: Z.ai's usage policy says "Account sharing or multi-user access is prohibited." Keep any Z.ai key to your own brand.
Steps
Step 1 — Create the key
On z.ai/manage-apikey/apikey-list, open API Keys. For a coding plan key, create it under Personal Coding Plan. For a pay-as-you-go key, create a standard API key. Copy it.
Step 2 — Add it in SpiderGate
Open Gate → Vault (/dashboard/gate/vault) and click Add Provider. Zhipu GLM appears under Connect a subscription for a coding plan key and under Pay-as-you-go for a pay-as-you-go key. Paste the key into API Key and add a Label.
Set Billing to match the key, because it also picks the host:
Subscription for a coding plan key. SpiderGate then uses Z.ai's plan host,
https://api.z.ai/api/coding/paas/v4. Pick your package.Paid for a pay-as-you-go key. SpiderGate's default pay-as-you-go host is the China BigModel host. For a z.ai key, put
https://api.z.ai/api/paas/v4in Base URL (optional).
Under Routing, turn Share with SpiderIQ key pool off. Click Add key.
Verify it worked
When you click Add key, SpiderGate sends one request to Z.ai with the key before it stores anything: it lists models on the host your Billing selects.
If Z.ai accepts the key, the dialog closes and the key appears in your vault list.
If it does not, the dialog stays open and shows:
The zhipu key did not pass its check: <reason>. Nothing was saved.The reason is SpiderGate's own wording, never Z.ai's error text. The usual ones are Invalid API key (401 Unauthorized), Access denied (403 Forbidden) and The account behind this key has no credit left (402).
To see the key serve a request, give it a slot in one of your own routing aliases and send a request to that alias. The trace shows which provider answered.
Troubleshoot
A coding plan key fails the check. Billing was not set to Subscription, so the check went to the pay-as-you-go host. Change Billing and try again.
A z.ai pay-as-you-go key fails the check. Without a Base URL, SpiderGate checks it against the China BigModel host. Add https://api.z.ai/api/paas/v4 as the Base URL.
Too many keys checked for this workspace; try again in …s. SpiderGate runs at most 20 key checks per brand in any 10 minutes. Wait the number of seconds it gives, then click Add key again.
Request timed out (15s) or Could not reach … to check the key. Try again later. The provider did not answer in time. Nothing was saved. Try again in a minute.
The provider is rate-limiting us (429). Try again in a minute. The provider throttled the check itself. Wait a minute and retry.