Skip to content

GLM + Cline in VS Code: Step-by-Step on Windows

Use GLM models with the Cline extension in VS Code on Windows. OpenAI-compatible provider setup, model choice, plan vs pay-per-token, plan mode, and fixes.

MGMCSA Guru Team July 6, 2026 3 min read
The Cline extension in VS Code configured to use GLM on Windows

If you prefer working inside VS Code, Cline brings an AI coding agent into the editor — and it pairs nicely with GLM, since the GLM Coding Plan explicitly supports Cline. You get a visual plan-and-approve workflow on a cheap backend, with no terminal and no WSL required.

This is the GLM + Cline setup on Windows. For the same approach with DeepSeek, see DeepSeek + Cline in VS Code.

Step 1: Install Cline

In VS Code, open Extensions, search Cline, and install. A Cline icon appears in the sidebar.

Step 2: Get a Z.AI key or plan

Sign up at Z.AI for an API key, via pay-per-token or the GLM Coding Plan (from $18/month, and built to work with Cline).

Step 3: Configure the provider

Open Cline’s settings and set:

Cline settings for GLM

API Provider OpenAI Compatible
Base URL https://api.z.ai/api/paas/v4
API Key your Z.AI key
Model ID glm-5-turbo (or glm-5)

Choose OpenAI Compatible, paste the base URL and key, set the model, and save. Cline now runs on GLM. Confirm the exact base URL in Z.AI’s docs.

Step 4: Plan, then Act

Cline’s two modes:

  • Plan — the model outlines its approach first for you to approve.
  • Act — it edits files and runs commands, showing diffs.

Start non-trivial tasks in Plan mode to keep a cheaper model focused and avoid wasted edits (and, on a coding plan, wasted prompts against your window).

Pick the model

  • glm-5-turbo — fast, cheap, all plans. Best default.
  • glm-5 — flagship, Pro plan, for hard tasks.
  • glm-4.7 — solid alternative on all plans.

Switch the Model ID in settings anytime. See GLM-4.6 vs GLM-5 vs GLM-5-Turbo.

Pricing

Cline is free; GLM bills via pay-per-token or the GLM Coding Plan (rolling-window caps, commonly per 5 hours). For heavy in-editor use, the plan is usually cheaper. See GLM Coding Plan setup.

Troubleshooting

  • Format errors — you used /anthropic; switch to the OpenAI (paas/v4) URL.
  • Auth errors — wrong key or stray spaces when pasting.
  • Access denied on glm-5 — your plan tier doesn’t include it; use glm-5-turbo.
  • No diffs — you’re in Plan mode; switch to Act to apply changes.

GLM + Cline checklist

  • Cline installed in VS Code
  • Z.AI key or GLM Coding Plan active
  • Provider set to OpenAI Compatible
  • Base URL (paas/v4) and key entered
  • Model set to glm-5-turbo; tested in Plan mode

Wrapping up

GLM with Cline gives you an in-editor agent on a cheap backend: install the extension, pick OpenAI Compatible, set Z.AI’s OpenAI base URL and key, and choose glm-5-turbo. Use Plan mode to keep edits focused — good for results and for stretching a coding plan’s window.

Prefer the terminal? See GLM + OpenCode or run GLM-5 with Claude Code.

Frequently asked questions

How do I use GLM in Cline?

Install Cline in VS Code, open its settings, pick the OpenAI Compatible provider, set the base URL to Z.AI's OpenAI-compatible endpoint, paste your key, and set the model to glm-5-turbo or glm-5. Save and start a task.

Which base URL do I use?

Z.AI's OpenAI-compatible endpoint (commonly https://api.z.ai/api/paas/v4). Cline's OpenAI Compatible provider expects that format — not the Anthropic endpoint. Confirm the path in Z.AI's docs.

Does the GLM Coding Plan work in Cline?

Yes. Cline is one of the tools the GLM Coding Plan supports, and you can also use pay-per-token. Heavy daily users usually prefer the plan from $18/month.

Can I run GLM-5 in Cline?

If your Z.AI plan tier includes GLM-5 (Pro), yes — set it as the model ID. Otherwise use glm-5-turbo, which is available on all plans and is a strong default.

Does this need WSL?

No. Cline runs inside VS Code on native Windows since it's an editor extension. WSL only matters for where your project files live, not for Cline itself.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.