Use the Right Z.ai Endpoint for the GLM 5.2 Coding Plan
Melvin Vivas · X post · 2026-06-21 · Open on X
Topics: LLM Fundamentals, AI Dev Tools & Productivity, LLMOps, Deployment & Monitoring · Level: intermediate
Summary
This post shares a tip from Ivan Fioravanti: GLM coding plan users should call the coding-optimized endpoint (api.z.ai/api/coding/paas/v4), not the general one (api.z.ai/api/paas/v4/). Where a tool supports it, use the Anthropic-compatible endpoint (api.z.ai/api/anthropic); Claude Code and OpenCode both do.
Key points
- Coding plan endpoint: https://api.z.ai/api/coding/paas/v4 (optimized for coding).
- Do not use the general endpoint https://api.z.ai/api/paas/v4/ with the coding plan.
- Anthropic-compatible endpoint: https://api.z.ai/api/anthropic. Use it where supported.
- Claude Code and OpenCode use the Anthropic-compatible endpoint.
- The caption link to the coding endpoint is cut off; the full path ends in /paas/v4.
Resources mentioned
- Z.ai coding plan API endpoint · docs · api.z.ai · paid
Coding-optimized OpenAI-compatible endpoint for the GLM coding plan; the full path is https://api.z.ai/api/coding/paas/v4. - Z.ai general API endpoint (paas/v4) · docs · api.z.ai · paid · open in a browser to verify
General-purpose Z.ai API endpoint, which should not be used with the coding plan. - Z.ai Anthropic-compatible endpoint · docs · api.z.ai · paid
Anthropic-API-compatible endpoint for using GLM models in tools like Claude Code and OpenCode. - Ivan Fioravanti (@ivanfioravanti) on X · person · x.com · free
AI practitioner who shares tips on local and open models and coding setups. - OpenCode · tool · x.com · free
Open-source terminal coding agent that can be configured with different model providers, including open models.
Also in: OpenCode Console Security Breach: Check Your Provider Keys (Melvin Vivas on X · notes), DeepSeek V4.1 Flash Now Free in OpenCode (Melvin Vivas on X · notes), OpenAI Makes GPT-6 Astra and GPT-6.1 Sol About 50% Faster (Melvin Vivas on X · notes), T3Code: a better interface for terminal coding agents (Melvin Vivas on X · notes) and 13 more - Claude Code · tool · code.claude.com · paid · recommended by both Bashiri Smith & Melvin Vivas
Build agents and pipelines from the terminal; the guide's main agentic coding tool.
Also in: First impressions: Claude Code in the cloud is good and fast (Melvin Vivas on X · notes), Why Claude Code feels faster: gzipped turns and instant cloud sessions (Melvin Vivas on X · notes), Watch What Fills Your Coding Agent's Context and When to Clear (Melvin Vivas on X · notes), Claude Code's Right Sidebar and Context Breakdown (Melvin Vivas on X · notes) and 124 more
Try this
- Check that your GLM coding plan setup uses https://api.z.ai/api/coding/paas/v4 (OpenAI-style) or https://api.z.ai/api/anthropic (Anthropic-style).
- Switch away from https://api.z.ai/api/paas/v4/ if you are on the coding plan.
More in LLM Fundamentals
- Google Interactions API is GA: recommended for Gemini
- GLM 5.2 open model now deployable on Google Cloud
- GLM 5.2 as a Default Open Model for Claude Code
- GLM 5.2 Leads Open-Source Models on Datacurve's Deep SWE Leaderboard
- GLM 5.2 vs Opus 4.8 for Landing Page Design: 6x Cheaper
- Free GLM-5.2 via Hugging Face Inference Providers in coding agents