Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>GLM for Copilot ChatNew to Visual Studio Code? Get it now.
GLM for Copilot Chat

GLM for Copilot Chat

Qi Yijiazhen

|
18 installs
| (0) | Free
Use GLM (Z.ai / Zhipu) models in GitHub Copilot Chat — your GLM Coding Plan or the standard GLM API. Thinking mode, tool calling, BYOK.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

GLM for Copilot Chat

VS Marketplace Version Installs CI License: MIT

GLM-5.2 answering a question in the GitHub Copilot Chat panel, selected from the Copilot model picker

Pick GLM-4.7, GLM-5, GLM-5.1, GLM-5.2, or GLM-4.5 Air from the Copilot Chat model picker — and keep everything else Copilot already gives you.

Use your own GLM API key (BYOK) to bring Zhipu AI's GLM models into GitHub Copilot Chat. No new sidebar, no new chat UI. Just new models in the picker you already use — with agent mode, tool calling, and thinking mode all working out of the box.

Unofficial, community-built extension. Not affiliated with, endorsed by, or sponsored by Zhipu AI, Z.ai, GitHub, or Microsoft. "GLM", "Copilot", and "Visual Studio Code" are trademarks of their respective owners. You bring your own GLM API key and pay your own usage.

Why this extension?

  • Don't replace Copilot — power it up. GLM models appear alongside GPT-4o, Claude, and others in the existing model picker.
  • Agent mode, tool calling, instructions, MCP — all still work. Copilot's full stack now runs on GLM.
  • BYOK, your bill. Your API key lives in the OS keychain, never in settings.json or your Git history.
  • Dual API. Use your GLM Coding Plan subscription or the pay-as-you-go Standard API, whichever fits your workflow.
  • Zero runtime dependencies. Pure VS Code API and Node.js built-ins. No Python, no Docker, no local server.

Features

GLM-4.7, GLM-5 series, and GLM-4.5 Air in the model picker

GLM-4.7, GLM-5, GLM-5.1, GLM-5.2, and GLM-4.5 Air appear in Copilot Chat's model selector. The picker automatically shows only the models available for your selected API Mode (some models are exclusive to the Coding Plan or the Standard API — see the Models table). Switch models mid-chat without losing history.

Dual API: Coding Plan and Standard

Choose between your Z.ai GLM Coding Plan subscription or the pay-as-you-go Standard API. For Standard, pick International (z.ai) or Mainland China (bigmodel.cn) as your region. See Coding Plan vs Standard API below.

Custom models

Add your own GLM model ids with the glm-copilot.customModels setting — useful for newly released models, fine-tunes, or proxy-hosted models. Each entry is a model id string or an object with optional name, maxInputTokens, maxOutputTokens, toolCalling, vision, and thinking. Custom models always appear in the picker and are sent to your active endpoint.

Thinking mode

GLM models support a thinking (step-by-step reasoning) mode, controlled by the glm-copilot.thinking setting (enabled by default). Set it to disabled for faster responses on simple edits.

Secure API key storage

Your key is stored in VS Code's SecretStorage (the OS keychain on macOS, Windows, and Linux). It never touches settings.json.

Inherits every Copilot capability

Because this extension plugs into Copilot's native Language Model Provider API, you get Copilot's full stack at no extra cost:

  • Agent mode — autonomous multi-step tasks
  • Tool calling — file edits, terminal, workspace search, Git, and more
  • Instructions and skills — your .instructions.md, AGENTS.md, and skills work as normal
  • MCP servers — any MCP tools you have configured keep working

Getting Started

Prerequisites

  • VS Code 1.116 or later
  • An active GitHub Copilot subscription (Free, Pro, or Enterprise)
  • A GLM API key from z.ai or bigmodel.cn, or a GLM Coding Plan subscription

Installation

Install from the VS Code Marketplace or search for "GLM for Copilot Chat" in the Extensions panel (Cmd/Ctrl + Shift + X).

Usage

  1. Open the Command Palette (Cmd/Ctrl + Shift + P) and run GLM: Set API Key.
  2. Paste your GLM API key. GLM key format is {id}.{secret}.
  3. (Optional) Open GLM: Open Settings to choose your API mode and region.
  4. Open Copilot Chat, click the model picker, and select a GLM model (e.g. GLM-4.7 or GLM-5.2).
  5. Start chatting.

To update or remove the key later, use GLM: Set API Key or GLM: Clear API Key from the Command Palette.

Models

Model Context Max Output Available on Tools Thinking
GLM-4.7 200K 128K Coding Plan + Standard Yes Yes
GLM-5 200K 128K Standard only Yes Yes
GLM-5.1 200K 128K Standard only Yes Yes
GLM-5.2 200K 128K Coding Plan only Yes Yes
GLM-4.5 Air 128K 96K Coding Plan + Standard Yes Yes

The picker shows only the models available for your selected API Mode, so you never pick a model your plan can't serve. GLM-5/5.1 are Standard-API only; GLM-5.2 is Coding-Plan only; GLM-4.7 and GLM-4.5 Air work on both. Need another model? Add it with glm-copilot.customModels.

Settings

Setting Default Description
glm-copilot.apiMode coding-plan Which GLM API to use: coding-plan or standard. See below.
glm-copilot.region international Region for Standard API mode: international (z.ai) or china (bigmodel.cn). Ignored in Coding Plan mode.
glm-copilot.baseUrl (empty) Override the API base URL. Overrides apiMode and region. Use for proxies or compatible APIs.
glm-copilot.maxTokens 0 Maximum output tokens per request. 0 means no explicit limit (uses API default).
glm-copilot.thinking enabled Step-by-step reasoning: enabled (higher quality) or disabled (faster). Applies to models that support thinking.
glm-copilot.customModels [] Add your own models. Array of model id strings or objects: { id, name?, maxInputTokens?, maxOutputTokens?, toolCalling?, vision?, thinking? }.
glm-copilot.modelIdOverrides {} Remap a built-in model's API id (keys = picker id, values = id sent to the API). Use for regional endpoints or proxies with different names.
glm-copilot.debugLogging false Write verbose debug logs to the GLM output channel. View with GLM: Show Logs.

Coding Plan vs Standard API

Coding Plan

Requires a Z.ai GLM Coding Plan subscription. All requests go to:

https://api.z.ai/api/coding/paas/v4

The region setting is ignored in this mode. Best for teams or high-volume coding workflows.

Standard API

Pay-as-you-go via the GLM Open Platform. The endpoint depends on your region:

Region Endpoint Key page
International https://api.z.ai/api/paas/v4 z.ai/manage-apikey/apikey-list
Mainland China https://open.bigmodel.cn/api/paas/v4 open.bigmodel.cn

Full API documentation: docs.z.ai

Commands

Command Description
GLM: Set API Key Set or update your GLM API key
GLM: Get API Key Open the key management page for your selected API mode
GLM: Clear API Key Remove your stored API key
GLM: Open Settings Open the extension settings
GLM: Show Logs Open the GLM output channel

Frequently asked questions

Is this an official GLM or GitHub extension?

No. It is an unofficial, community-built, open-source extension. It is not affiliated with Zhipu AI, Z.ai, GitHub, or Microsoft. It simply lets you use your own GLM API key inside GitHub Copilot Chat.

Do I still need a GitHub Copilot subscription?

Yes. This extension adds GLM models to Copilot Chat; it does not replace Copilot. You need an active GitHub Copilot subscription (Free, Pro, or Enterprise) and your own GLM API key.

Where does my API key go? Is it safe?

Your key is stored in VS Code's SecretStorage (the OS keychain on macOS, Windows, and Linux) and is sent only to the GLM endpoint you configure (api.z.ai or open.bigmodel.cn) over HTTPS. It is never written to settings.json and never committed to your repository.

Should I choose the Coding Plan or the Standard API?

Pick Coding Plan if you have a Z.ai GLM Coding Plan subscription — best for high-volume coding. Pick Standard for pay-as-you-go usage through the GLM Open Platform. See Coding Plan vs Standard API.

Why don't I see a model I expected in the picker?

The picker shows only the models available for your selected API Mode. GLM-5 and GLM-5.1 are Standard-API only; GLM-5.2 is Coding-Plan only; GLM-4.7 and GLM-4.5 Air work on both. To force-add any model (including new or proxy-hosted ones), use the glm-copilot.customModels setting.

Does agent mode, tool calling, and MCP work?

Yes. Because the extension plugs into Copilot's native Language Model Provider API, Copilot's full stack — agent mode, tool calling, instructions, and MCP servers — runs on GLM unchanged.

Is GLM-4.6 still supported?

GLM-4.6 was replaced by GLM-4.7 and the GLM-5 series in v0.2.0. You can still add it yourself with glm-copilot.customModels if your account serves it.

Can I point it at a proxy or self-hosted endpoint?

Yes. Set glm-copilot.baseUrl to any OpenAI-compatible endpoint; it overrides the API mode and region.

Contributing

Contributions are welcome. Please read the contributing guide and our Code of Conduct. All pull requests require review from a code owner and are never merged automatically.

  • Found a bug? Open a bug report.
  • Want a feature? Open a feature request.
  • Need help? See Support or start a Discussion.
  • Found a security issue? See our Security policy.

Changelog

See CHANGELOG.md for release history.

License

MIT © GLM for Copilot Chat contributors

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft